chiark / gitweb /
mastodonochrome.git
2 years agoWhen caching a status, cache its reblog too.
Simon Tatham [Wed, 3 Jan 2024 16:26:46 +0000 (16:26 +0000)]
When caching a status, cache its reblog too.

That's another whole status, which we should be able to look up.

2 years agoReclassify status info as a utility activity.
Simon Tatham [Wed, 3 Jan 2024 13:40:51 +0000 (13:40 +0000)]
Reclassify status info as a utility activity.

I meant it to be that in the first place - that's why I entered
InfoStatus in the utilities enum. But then I forgot it was there and
made a separate entry for it.

When you're invoking status info from within a file, I think it makes
more sense as a utility, the way I first had it.

2 years agoSupport saving login details. We can now log in!
Simon Tatham [Wed, 3 Jan 2024 10:55:39 +0000 (10:55 +0000)]
Support saving login details. We can now log in!

2 years agoMove TopLevelError up to the root of the crate.
Simon Tatham [Wed, 3 Jan 2024 10:55:17 +0000 (10:55 +0000)]
Move TopLevelError up to the root of the crate.

If that's not a candidate for putting at the top level then I don't
know what is.

2 years agoImplement the login procedure, without saving.
Simon Tatham [Wed, 3 Jan 2024 08:19:37 +0000 (08:19 +0000)]
Implement the login procedure, without saving.

Currently, the JSON-serialised AuthConfig is written to stdout, just
to prove during development that it works. Next step is to save it to
where it ought to live.

2 years agoActually post something!
Simon Tatham [Wed, 3 Jan 2024 07:18:14 +0000 (07:18 +0000)]
Actually post something!

2 years agoPost-compose menu, up to but not including posting.
Simon Tatham [Tue, 2 Jan 2024 18:16:10 +0000 (18:16 +0000)]
Post-compose menu, up to but not including posting.

2 years agoGive MenuKeypressLine a width reset option.
Simon Tatham [Wed, 3 Jan 2024 06:56:05 +0000 (06:56 +0000)]
Give MenuKeypressLine a width reset option.

Then when I change menu items on the fly they won't always remember
the largest width the menu has ever had.

2 years agoMove prompt into SingleLineEditor.
Simon Tatham [Wed, 3 Jan 2024 06:55:03 +0000 (06:55 +0000)]
Move prompt into SingleLineEditor.

It was a mistake to put it in the wrapping BottomLineEditorOverlay,
because I'm going to want to put single-line editors elsewhere on the
screen with the same kind of prompt.

2 years agoUpdate html2text to 0.10.1.
Simon Tatham [Tue, 2 Jan 2024 17:30:34 +0000 (17:30 +0000)]
Update html2text to 0.10.1.

Chris has released a version containing my pull request that supports
the <del> tag, which I encountered in a toot last month.

2 years agoEditor: implement cut to end of line.
Simon Tatham [Tue, 2 Jan 2024 14:38:25 +0000 (14:38 +0000)]
Editor: implement cut to end of line.

2 years agoFix handling of newlines in is_char_boundary.
Simon Tatham [Tue, 2 Jan 2024 17:09:30 +0000 (17:09 +0000)]
Fix handling of newlines in is_char_boundary.

Newlines have width 0, so we were mis-classifying them as a combining
character, causing the point just before one to be considered not a
character boundary!

2 years agoEditor: support beginning/end of line.
Simon Tatham [Tue, 2 Jan 2024 14:20:50 +0000 (14:20 +0000)]
Editor: support beginning/end of line.

2 years agoEditor: support page-up and page-down.
Simon Tatham [Tue, 2 Jan 2024 14:15:57 +0000 (14:15 +0000)]
Editor: support page-up and page-down.

Not very useful just yet while we're not able to scroll to keep the
cursor in view, but even so, it's nice to be able to get to the bottom
quickly!

2 years agoEditor: implement Up and Down keystrokes.
Simon Tatham [Tue, 2 Jan 2024 14:11:47 +0000 (14:11 +0000)]
Editor: implement Up and Down keystrokes.

2 years agoEditor: make the cursor position persist.
Simon Tatham [Tue, 2 Jan 2024 13:56:46 +0000 (13:56 +0000)]
Editor: make the cursor position persist.

Then we'll still have it available to refer to when processing
keystrokes.

2 years agoFix an edge case of watching a nearly empty feed.
Simon Tatham [Tue, 2 Jan 2024 13:39:56 +0000 (13:39 +0000)]
Fix an edge case of watching a nearly empty feed.

This just came up when testing against a dev instance, which starts
off with 0 posts anywhere, of course.

2 years agoDevelop an explicit HTTP redirection policy.
Simon Tatham [Tue, 2 Jan 2024 11:27:00 +0000 (11:27 +0000)]
Develop an explicit HTTP redirection policy.

The Mastodon dev system runs its streaming API on a different port of
its VM. So you need to be able to follow an HTTP redirect from
http://mastodon.local to http://mastodon.local:4000 and still pass the
same auth token to that server.

But in general, one should not keep authentication configuration when
traversing a cross-site redirection! reqwest's automated redirect
following won't do it at all, and rightly so.

So I've written a custom redirection policy which allows _same_-host
redirection (just in case something turns out to need it), and doesn't
follow cross-site redirection (which would in general be useless
anyway because of this auth issue). And when setting up the streaming
API in particular, we catch the unfollowed redirection, vet it very
carefully (against the official streaming API location which the
instance happily advertises in its configuration record), and if we're
satisfied, make a fresh request to the target URL which _does_ pass
the same authentication.

As a result, now we can do streaming to the Mastodon dev instance,
which the Python version of this client _never_ managed!

2 years agoMake AuthError into a subcase of ClientError.
Simon Tatham [Tue, 2 Jan 2024 11:35:06 +0000 (11:35 +0000)]
Make AuthError into a subcase of ClientError.

Now tui.rs doesn't have to handle it directly, and our client setup
can return the more general ClientError.

2 years agoFix movement by words in the editor buffer.
Simon Tatham [Tue, 2 Jan 2024 11:05:17 +0000 (11:05 +0000)]
Fix movement by words in the editor buffer.

I apparently only half-finished writing is_word_boundary: it tested
that the _next_ character wasn't a space, but not that the previous
one was.

2 years agoStart of a full-screen editor for composing toots.
Simon Tatham [Mon, 1 Jan 2024 16:13:15 +0000 (16:13 +0000)]
Start of a full-screen editor for composing toots.

You can't actually post anything. And none of the keystrokes special
to the composing editor is implemented yet (ok, except [^O][Q] to quit
the editor). But you can at least start typing text into the buffer,
and it gets wrapped, colourised, and checked for being too long.

2 years agoMake our regex scanner into a lazy_static.
Simon Tatham [Tue, 2 Jan 2024 07:27:07 +0000 (07:27 +0000)]
Make our regex scanner into a lazy_static.

That way we only construct it once per runtime, not once per Editor we
instantiate. I've just realised that that must be what's making some
of my half-written editor unit tests slow.

2 years agoDecentralise version component of API URLs.
Simon Tatham [Tue, 2 Jan 2024 07:01:41 +0000 (07:01 +0000)]
Decentralise version component of API URLs.

I thought it was /api/v1/whatever, but I've just realised that it's
actually /api/v2/instance in particular. _That's_ why I keep seeing
"uri" from some servers and "domain" from others: if I requested the
up-to-date version of the record, it would agree on "domain".

2 years agoFix test failure introduced by format_date.
Simon Tatham [Mon, 1 Jan 2024 15:57:11 +0000 (15:57 +0000)]
Fix test failure introduced by format_date.

I didn't read carefully enough the code I was replacing with a
function call. It had an extra space at the end of the date format
string.

2 years agoSupport retrieving the Instance object.
Simon Tatham [Mon, 1 Jan 2024 15:25:23 +0000 (15:25 +0000)]
Support retrieving the Instance object.

Not much of it is decoded at the moment, but we'll need a few pieces
of configuration to inform the post composer about important things
like how to tell when it's hit its length limit.

2 years agoFill in percentage in file status lines.
Simon Tatham [Mon, 1 Jan 2024 14:02:05 +0000 (14:02 +0000)]
Fill in percentage in file status lines.

I was putting that off because I had a half-formed clever idea about
trying to do linear regression on the posts we _have_ formatted to the
current width, and using it to estimate the likely line height of the
ones we haven't. But then I decided that was either the perfect being
the enemy of the good, or a silly idea that was bound to explode in an
edge case, or both, and so I've done something simple instead.

The _main_ purpose is that '100%' means 'nothing more to read' and
anything less means there is. As long as we get that much right, we're
in reasonably good shape.

2 years agoElide 'foo: foo' in struct literals where possible.
Simon Tatham [Mon, 1 Jan 2024 13:51:45 +0000 (13:51 +0000)]
Elide 'foo: foo' in struct literals where possible.

Another thing I only just realised: although in general you're
supposed to explicitly say the name of each field you're initialising,
there's a special case where you can leave it out if the name of the
local variable you're initialising it _to_ is exactly the same.
Presumably on the grounds that that still doesn't allow much
confusion, and is terser.

2 years agoRemove lots of commas after braced match arms.
Simon Tatham [Mon, 1 Jan 2024 13:50:00 +0000 (13:50 +0000)]
Remove lots of commas after braced match arms.

I only just noticed from reading someone else's Rust code that they
aren't syntactically necessary!

2 years agoStop using ~ around struck-out text.
Simon Tatham [Mon, 1 Jan 2024 13:40:26 +0000 (13:40 +0000)]
Stop using ~ around struck-out text.

Apparently html2text is completely happy to render strikeout via
U+0336 COMBINING LONG STROKE OVERLAY, and needs no support from the
terminal escape-sequence system at all. So I don't need an artificial
indication that it happened.

2 years agoSupport reading hashtag feeds.
Simon Tatham [Mon, 1 Jan 2024 13:12:01 +0000 (13:12 +0000)]
Support reading hashtag feeds.

No trouble at all given the existing infrastructure.

2 years agoFill in the rest of View Post Info.
Simon Tatham [Mon, 1 Jan 2024 13:04:35 +0000 (13:04 +0000)]
Fill in the rest of View Post Info.

2 years agoRemove some assorted dbg! I don't need any more.
Simon Tatham [Mon, 1 Jan 2024 12:14:45 +0000 (12:14 +0000)]
Remove some assorted dbg! I don't need any more.

2 years agoStart of View Post Info.
Simon Tatham [Mon, 1 Jan 2024 12:14:17 +0000 (12:14 +0000)]
Start of View Post Info.

Currently it just shows the post in the ordinary way, without all the
extra detail. But it's plumbed through the menus, which is a start.

2 years agoFilled in account flags.
Simon Tatham [Mon, 1 Jan 2024 12:05:24 +0000 (12:05 +0000)]
Filled in account flags.

I think that's Examine User all done now!

2 years agoLeave out the double-check of the account name.
Simon Tatham [Mon, 1 Jan 2024 12:05:07 +0000 (12:05 +0000)]
Leave out the double-check of the account name.

Turns out it's case-insensitive, bah.

2 years agoShow account relationships.
Simon Tatham [Mon, 1 Jan 2024 11:58:03 +0000 (11:58 +0000)]
Show account relationships.

2 years agoFilled in most of the Examine User data.
Simon Tatham [Mon, 1 Jan 2024 11:36:50 +0000 (11:36 +0000)]
Filled in most of the Examine User data.

The missing part is Relationships, because those are a separate
server-side data structure.

2 years agoSorted out the approximate dates in Account.
Simon Tatham [Mon, 1 Jan 2024 11:31:37 +0000 (11:31 +0000)]
Sorted out the approximate dates in Account.

I couldn't parse last_status_at as a DateTime<Utc> in all cases at
all, and even in created_at, the time part was clearly nonsense.

chrono has an actual type for this, so let's use it! With bonus Baby's
First Custom Deserialize Impl.

2 years agoMake the [ESC][Y] shortcut work.
Simon Tatham [Mon, 1 Jan 2024 10:26:47 +0000 (10:26 +0000)]
Make the [ESC][Y] shortcut work.

Useful to do this before I start filling in the rest of the Examine
User display, so that it's quick to test it each time!

2 years agoStart of an actual Examine User display.
Simon Tatham [Mon, 1 Jan 2024 10:23:16 +0000 (10:23 +0000)]
Start of an actual Examine User display.

Doesn't contain most of the information yet, but we have the Account
struct in hand and can start filling it in.

2 years agoUNFINISHED examine
Simon Tatham [Mon, 1 Jan 2024 10:11:07 +0000 (10:11 +0000)]
UNFINISHED examine

2 years agoAbstract out FeedDataSource.
Simon Tatham [Mon, 1 Jan 2024 09:47:08 +0000 (09:47 +0000)]
Abstract out FeedDataSource.

Now a FileContents doesn't _have_ to contain a FeedId; I can replace
it with an alternative trait implementation containing a fixed set of
things.

2 years agoRename FeedFile and friends.
Simon Tatham [Mon, 1 Jan 2024 09:21:22 +0000 (09:21 +0000)]
Rename FeedFile and friends.

The scrolling-file system is about to be reused for things that aren't
feeds, so it will be confusing to have the structs all called FeedThing.

2 years agoAbility to abort a bottom-line prompt.
Simon Tatham [Mon, 1 Jan 2024 09:18:23 +0000 (09:18 +0000)]
Ability to abort a bottom-line prompt.

The new PopOverlay logical action returns to the previous non-overlay
activity, without reinitialising it.

2 years agoUse todo!() in place of panic!("FIXME").
Simon Tatham [Mon, 1 Jan 2024 09:14:45 +0000 (09:14 +0000)]
Use todo!() in place of panic!("FIXME").

I only just found out about that, and I should start getting into the
habit.

2 years agoMake the Examine prompt chain to another activity.
Simon Tatham [Mon, 1 Jan 2024 09:13:38 +0000 (09:13 +0000)]
Make the Examine prompt chain to another activity.

Doesn't _work_, because I haven't actually implemented that activity
yet. We now panic in a FIXME in tui.rs. But it's a start.

2 years agoUNFINISHED: first overlay activity: Examine User prompt.
Simon Tatham [Mon, 1 Jan 2024 08:14:02 +0000 (08:14 +0000)]
UNFINISHED: first overlay activity: Examine User prompt.

This doesn't actually examine users yet. When you press Return at the
prompt, it just beeps, because transferring the data to where you
actually wanted it is not yet implemented. But it's enough to test the
editing itself.

2 years agoIntroduce the concept of an 'overlay activity'.
Simon Tatham [Mon, 1 Jan 2024 07:21:08 +0000 (07:21 +0000)]
Introduce the concept of an 'overlay activity'.

This will be used for bottom-line editor prompts. Some of those are
triggered within the context of an existing activity (for example, if
you're reading a file and press the not-yet-implemented search key).
Others can be imposed from outside, e.g. pressing Alt+E while reading
a file. So there's a slightly fiddly mechanism to make the latter
work, and not treat it as two totally independent ESC and E
keystrokes (which would leave you looking at the Utilities Menu while
entering the name of a user to examine, instead of at the screen you
saw the username on).

The overlay activity is drawn on top of the topmost non-overlay
activity on the stack, at the bottom of the screen.

2 years agoEnough editing keys for a single-line editor.
Simon Tatham [Sun, 31 Dec 2023 20:21:28 +0000 (20:21 +0000)]
Enough editing keys for a single-line editor.

2 years agoStart of text editing: the EditorCore type.
Simon Tatham [Sun, 31 Dec 2023 19:25:44 +0000 (19:25 +0000)]
Start of text editing: the EditorCore type.

This is the common piece between bottom-line text entry and the
full-screen post composer, handling all the editing keys that work the
same in both.

2 years agoFix panic when going to Read Mentions.
Simon Tatham [Sun, 31 Dec 2023 15:11:07 +0000 (15:11 +0000)]
Fix panic when going to Read Mentions.

My rewrite of the ensure_enough_rendered loop introduced a further bug
in which we counted the number of visible lines of the bottom item
_plus_ its full height. Should have been _instead of_ its full height.
So we didn't get right to the top of the screen.

2 years agoBraino: < for <=.
Simon Tatham [Sun, 31 Dec 2023 15:06:29 +0000 (15:06 +0000)]
Braino: < for <=.

Would have caused an unnecessary coarsen_pos() if we were sitting on
the first _non-header_ item in a file at the point when it failed to
extend backwards.

2 years agoDon't put '?' on the end of parameterless URLs.
Simon Tatham [Sun, 31 Dec 2023 15:00:07 +0000 (15:00 +0000)]
Don't put '?' on the end of parameterless URLs.

If you call reqwest::Url::parse_with_params and give it an empty
parameter iterator, it still appends '?' to the URL, and then doesn't
put anything after it.

I don't _think_ that actually makes any difference, but it looks ugly.
More to the point, I noticed it while pasting HTTP transcripts to
report a bug in the Mastodon dev setup, and thought I'd better try
again without the spurious '?', in case it did make a difference.

2 years agoMake this program build on Windows!
Simon Tatham [Sun, 31 Dec 2023 14:29:20 +0000 (14:29 +0000)]
Make this program build on Windows!

I tried it out of pure curiosity. As I expected, the 'xdg' crate
didn't work (I already knew it was documented to not work on Windows),
but everything else was fine, and it compiles and runs!

2 years agoReport HTTP errors from all URLs we retrieve.
Simon Tatham [Sun, 31 Dec 2023 14:01:44 +0000 (14:01 +0000)]
Report HTTP errors from all URLs we retrieve.

2 years agoFix misreporting of HTTP errors not about auth.
Simon Tatham [Sun, 31 Dec 2023 14:01:00 +0000 (14:01 +0000)]
Fix misreporting of HTTP errors not about auth.

The prefix "unable to read authentication" was in the wrong part of my
error handling edifice.

2 years agoFix extending a totally empty home timeline.
Simon Tatham [Sun, 31 Dec 2023 13:46:49 +0000 (13:46 +0000)]
Fix extending a totally empty home timeline.

Again, probably only likely to come up in a new dev instance - but in
that situation, you do need it to work!

2 years agoUNTESTED: go to Read Mentions if user is mentioned.
Simon Tatham [Sun, 31 Dec 2023 13:38:24 +0000 (13:38 +0000)]
UNTESTED: go to Read Mentions if user is mentioned.

Annoyingly, I can't test this on the dev instance, because its
streaming API doesn't work!

2 years agoFile draw method: add a missing bounds check.
Simon Tatham [Sun, 31 Dec 2023 13:37:49 +0000 (13:37 +0000)]
File draw method: add a missing bounds check.

Don't try to render an item that doesn't even exist at all.

2 years agoensure_enough_rendered: forgot to render bottom item!
Simon Tatham [Sun, 31 Dec 2023 13:37:01 +0000 (13:37 +0000)]
ensure_enough_rendered: forgot to render bottom item!

We must render the actual item that our current position points at, as
well as the ones before that. I had my loop backwards.

2 years agoCall ensure_enough_rendered even if feed update failed.
Simon Tatham [Sun, 31 Dec 2023 13:36:15 +0000 (13:36 +0000)]
Call ensure_enough_rendered even if feed update failed.

Because then we're tinkering with the ExtendableIndicator, so we still
need to re-check our drawability.

2 years agoReplace an assert with sensible handling.
Simon Tatham [Sun, 31 Dec 2023 13:25:07 +0000 (13:25 +0000)]
Replace an assert with sensible handling.

It came up the first time I tried to test on a dev instance.

2 years agoInitial command-line parser.
Simon Tatham [Sun, 31 Dec 2023 11:39:11 +0000 (11:39 +0000)]
Initial command-line parser.

Allows '-c some_directory' to specify a non-default config dir.

2 years agoReorganise startup to pass in a config location.
Simon Tatham [Sun, 31 Dec 2023 11:26:32 +0000 (11:26 +0000)]
Reorganise startup to pass in a config location.

This begins to set up for specifying a non-default one on the command
line, which I'm going to need in order to start doing testing that
depends on a local test Mastodon instance.

2 years agoImplement the Ego Log.
Simon Tatham [Sun, 31 Dec 2023 09:53:02 +0000 (09:53 +0000)]
Implement the Ego Log.

This also meant fixing a loose end in the NotificationLog text
fragment type: it was still expecting to receive a Vec<Paragraph>,
because that's what it would have had available before we moved back
to html2text. Now it takes a single Paragraph, expecting that
Html::to_para() has sorted that out already.

2 years agoAdd the Read Mentions feed.
Simon Tatham [Sun, 31 Dec 2023 08:58:43 +0000 (08:58 +0000)]
Add the Read Mentions feed.

2 years agoTeach Client about the Notification type in the API.
Simon Tatham [Sun, 31 Dec 2023 09:37:27 +0000 (09:37 +0000)]
Teach Client about the Notification type in the API.

2 years agoMake FeedFile generic across type of item.
Simon Tatham [Sun, 31 Dec 2023 08:59:03 +0000 (08:59 +0000)]
Make FeedFile generic across type of item.

Now it can hold some other kind of TextFragment, instead of always
being StatusDisplay.

2 years agoRemove some pubs from html.rs.
Simon Tatham [Sun, 31 Dec 2023 08:35:52 +0000 (08:35 +0000)]
Remove some pubs from html.rs.

Just spotted that those aren't really needed.

2 years agoUse feed updates to lengthen the home timeline.
Simon Tatham [Sun, 31 Dec 2023 07:31:19 +0000 (07:31 +0000)]
Use feed updates to lengthen the home timeline.

Untested as yet, but this _should_ replicate the behaviour from the
Python version where you're reading your home timeline and a new post
quietly appears below what you can currently see.

2 years agoFix help message.
Simon Tatham [Sun, 31 Dec 2023 07:31:07 +0000 (07:31 +0000)]
Fix help message.

2 years agoBegin setting up the streaming subthread system.
Simon Tatham [Sat, 30 Dec 2023 11:57:51 +0000 (11:57 +0000)]
Begin setting up the streaming subthread system.

This gives Client two new methods. The first starts a subthread
listening to a stream, given a lambda function that you pass into the
subthread to handle the response. The second runs in the context of
the main thread, and the idea is that you give that same response
straight back to the client.

The owner of a Client object is responsible for doing the plumbing in
between, to arrange that a response passed to the lambda in the
subthread is transferred back to the main thread and given to
process_stream_update.

The implementation of that plumbing in Tui sends the data back to the
main thread over a clone of the sync_channel we already had, so that
it's received in the same event loop as terminal input.

So far, nothing is done with the updates.

Also not done: it would be nice to be able to ask a subthread to
terminate, if it's not needed any more. That way if the user tries to
read one of the fast-moving public timelines, we can dismiss its
update thread as soon as they're not looking at that file any more.

2 years agoAdd a couple more primary timelines.
Simon Tatham [Sat, 30 Dec 2023 11:25:27 +0000 (11:25 +0000)]
Add a couple more primary timelines.

2 years agoAbility to extend the feed backwards in time.
Simon Tatham [Sat, 30 Dec 2023 09:30:09 +0000 (09:30 +0000)]
Ability to extend the feed backwards in time.

Haven't yet tested the part where extension runs out, though. That
will be easier when we get some more kinds of feed, so I've left a
FIXME comment in there.

2 years agoRemove an unnecessary drop.
Simon Tatham [Sat, 30 Dec 2023 09:01:57 +0000 (09:01 +0000)]
Remove an unnecessary drop.

I had imagined that explicitly dropping a reference would terminate a
borrow. But firstly, rustc 1.74 says it does nothing at all, and
secondly, therefore I infer that this particular borrow wasn't in the
way in any case.

2 years agoMigrate back to html2text.
Simon Tatham [Fri, 29 Dec 2023 20:01:04 +0000 (20:01 +0000)]
Migrate back to html2text.

I gave up on using it previously because it lacked some important
features - in particular, it didn't support CSS on <a> elements, which
is necessary for identifying hashtags and mentions in Mastodon's
output HTML.

In 0.9.2 that feature is present, so I can try again! Also, 0.9.2 has
the neat ability to save the RenderTree that's an intermediate product
of the pipeline, just before we depend on the width. So we can keep
that after parsing a toot, and then only re-run the necessary back end
of the pipeline to re-render at a different width.

The amount of code is extremely reduced.

2 years agoUse ratatui's Color::Gray instead of Color::White.
Simon Tatham [Fri, 29 Dec 2023 22:29:36 +0000 (22:29 +0000)]
Use ratatui's Color::Gray instead of Color::White.

The former is the ESC[37m colour. The latter seems like the natural
name to my way of thinking, but it means tell the terminal you're
_really serious_ about wanting proper #ffffff.

2 years agoGo to top and bottom of file.
Simon Tatham [Fri, 29 Dec 2023 18:35:49 +0000 (18:35 +0000)]
Go to top and bottom of file.

I think this is all the basic 'paging around' actions done!

2 years agoAdd a file header!
Simon Tatham [Fri, 29 Dec 2023 18:31:50 +0000 (18:31 +0000)]
Add a file header!

2 years agoClip position at the top of the file.
Simon Tatham [Fri, 29 Dec 2023 18:24:19 +0000 (18:24 +0000)]
Clip position at the top of the file.

2 years agoScrolling downward, too.
Simon Tatham [Fri, 29 Dec 2023 18:14:01 +0000 (18:14 +0000)]
Scrolling downward, too.

2 years agoScrolling upward mostly works.
Simon Tatham [Fri, 29 Dec 2023 18:08:43 +0000 (18:08 +0000)]
Scrolling upward mostly works.

Doesn't clip at the top of the file yet, but this is a start!

2 years agoMore or less principled file-position tracking.
Simon Tatham [Fri, 29 Dec 2023 16:59:20 +0000 (16:59 +0000)]
More or less principled file-position tracking.

We still can't actually _scroll_ through the file, because I haven't
made any actual keystrokes work yet. But we begin displaying it at the
bottom, and do something sensible on resizing.

2 years agoNotify ActivityState mutably when it gets resized.
Simon Tatham [Fri, 29 Dec 2023 16:10:56 +0000 (16:10 +0000)]
Notify ActivityState mutably when it gets resized.

This should enable it to prepare anything it needs for the next
redraw.

2 years agoPass client through to handle_keypress.
Simon Tatham [Fri, 29 Dec 2023 16:05:30 +0000 (16:05 +0000)]
Pass client through to handle_keypress.

2 years agoForgot to break overlong logical lines.
Simon Tatham [Fri, 29 Dec 2023 14:34:18 +0000 (14:34 +0000)]
Forgot to break overlong logical lines.

Now URLs show up in a way that you can actually paste into a browser.

2 years agoFix paragraph wrap width.
Simon Tatham [Fri, 29 Dec 2023 14:32:23 +0000 (14:32 +0000)]
Fix paragraph wrap width.

We were wrapping to the full screen width, instead of Monochrome's
traditional w-1.

2 years agoBasically correct-looking display of toots \o/
Simon Tatham [Fri, 29 Dec 2023 14:18:28 +0000 (14:18 +0000)]
Basically correct-looking display of toots \o/

2 years agoNow we display the separator line of each toot. Progress!
Simon Tatham [Fri, 29 Dec 2023 13:26:50 +0000 (13:26 +0000)]
Now we display the separator line of each toot. Progress!

2 years agoURL in statuses is optional.
Simon Tatham [Fri, 29 Dec 2023 12:12:43 +0000 (12:12 +0000)]
URL in statuses is optional.

Reblogs don't have one: you can't view the reblogging status in the
web UI, only the reblogged one.

2 years agoNow we try to actually fetch a feed.
Simon Tatham [Fri, 29 Dec 2023 11:49:24 +0000 (11:49 +0000)]
Now we try to actually fetch a feed.

It doesn't work! JSON parsing error.

2 years agoPrepare to pass a Client through to activity constructors.
Simon Tatham [Fri, 29 Dec 2023 11:15:05 +0000 (11:15 +0000)]
Prepare to pass a Client through to activity constructors.

2 years agoTemporarily squelch some warnings.
Simon Tatham [Fri, 29 Dec 2023 11:10:05 +0000 (11:10 +0000)]
Temporarily squelch some warnings.

I _know_ all those things are unused - I haven't finished writing the
program yet. Shut up about them until I'm done!

2 years agoAllow error reporting as a PhysicalAction.
Simon Tatham [Fri, 29 Dec 2023 11:09:46 +0000 (11:09 +0000)]
Allow error reporting as a PhysicalAction.

Could easily come in useful!

2 years agoMake a Client and put it in the Tui.
Simon Tatham [Fri, 29 Dec 2023 11:08:52 +0000 (11:08 +0000)]
Make a Client and put it in the Tui.

This involved souping up the error handling so that we can absorb
errors from various different sources during Tui construction.

2 years agoUntested code to fetch feeds of items.
Simon Tatham [Fri, 29 Dec 2023 10:54:00 +0000 (10:54 +0000)]
Untested code to fetch feeds of items.

2 years agoReadonly mode for the client.
Simon Tatham [Thu, 28 Dec 2023 18:07:48 +0000 (18:07 +0000)]
Readonly mode for the client.

This was very useful when I was testing the editor last time round,
and surely it'll be just as useful this time.

2 years agoForgot to make sure ESC G worked!
Simon Tatham [Thu, 28 Dec 2023 18:06:52 +0000 (18:06 +0000)]
Forgot to make sure ESC G worked!

It _worked_ in the Python version, but I apparently left it out of the
visible menu options. But here they're more tightly tied together, so
leaving it out of the visible options made it not work at all.

2 years agoImproved first couple of client operations.
Simon Tatham [Thu, 28 Dec 2023 16:49:06 +0000 (16:49 +0000)]
Improved first couple of client operations.

Now we check errors sensibly rather than via cavalier .unwrap(); we
cache accounts as well as statuses per id; and we verify the returned
id against the one we asked for (to make it not an obvious attack
avenue to file things under the returned id).

2 years agoFilled in all the rest of the menus.
Simon Tatham [Thu, 28 Dec 2023 14:16:53 +0000 (14:16 +0000)]
Filled in all the rest of the menus.

Also, the actions that aren't implemented yet are clearly marked with
'NYI', and been if you try to select them.