chiark / gitweb /
mastodonochrome.git
22 months agoAbility to prompt on the bottom screen line.
Simon Tatham [Sat, 9 Dec 2023 16:16:14 +0000 (16:16 +0000)]
Ability to prompt on the bottom screen line.

22 months agoFeature to print detailed info about a status.
Simon Tatham [Sat, 9 Dec 2023 15:44:00 +0000 (15:44 +0000)]
Feature to print detailed info about a status.

Now I can retrieve its URL to send to people, and find out all the
fiddly internals too.

22 months agoCope with a timeline not containing any posts!
Simon Tatham [Sat, 9 Dec 2023 15:56:31 +0000 (15:56 +0000)]
Cope with a timeline not containing any posts!

Of course, that's the first thing that happens when you log in to a
fresh Mastodon test instance.

22 months agoOverride for config directory.
Simon Tatham [Sat, 9 Dec 2023 15:42:44 +0000 (15:42 +0000)]
Override for config directory.

This provides a crude means of managing multiple accounts. At the
moment my only use case for this is logging in to a test server so
that I can test the fine points of posting without making a fool of
myself on the live fediverse. So I don't need to run the accounts in
parallel in a user-friendly way, and I can easily just pass a weird
command-line option when I'm doing testing.

22 months agoFix resizing the window smaller.
Simon Tatham [Sat, 9 Dec 2023 12:22:23 +0000 (12:22 +0000)]
Fix resizing the window smaller.

Some weird sequence of events was triggering an attempted redraw at
the old size, before properly noticing the change and redrawing at the
new size. When going from smaller to bigger this just caused a display
flicker (in fact not even a perceptible one), but bigger to smaller
caused an exception when we tried to draw a big screen in a small
window and curses caught us printing outside the screen area.

Now seems to work better.

22 months agoBodgy fix for poor performance of wcwidth.
Simon Tatham [Fri, 8 Dec 2023 17:56:45 +0000 (17:56 +0000)]
Bodgy fix for poor performance of wcwidth.

Mastodonochrome was running rather slowly, and when I profiled it, it
turned out the bottleneck was the 'wcwidth' Python module, which is
not a wrapper on the C function, but a reimplementation in pure Python
and therefore not very fast.

I've bodged it by just making one big cache of all the strings that
the program ever passes to wcwidth, since there were only two calls to
that function at all and they were both in text.py. I don't know if
that's the right fix in the long term, but it seems to have improved
things considerably for now.

(Also, while I'm at it, ColouredString now wcwidths its contents once
at construction time and doesn't redo it on every call, so it doesn't
even look up the same thing in the cache multiple times.)

22 months ago^K and ^Y for copy and paste to end of line.
Simon Tatham [Fri, 8 Dec 2023 12:59:59 +0000 (12:59 +0000)]
^K and ^Y for copy and paste to end of line.

Well, end of _paragraph_, for the moment. Perhaps end of line would be
better. But my immediate use cases won't care about the difference:

 - ^W^K to delete the last word I typed at the end of a paragraph
 - dealing with code snippets which don't wrap anyway

22 months agoEditor: ^W and ^T to go forward/back a word
Simon Tatham [Fri, 8 Dec 2023 12:56:48 +0000 (12:56 +0000)]
Editor: ^W and ^T to go forward/back a word

22 months agoProperly indicate whether we can extend backwards.
Simon Tatham [Fri, 8 Dec 2023 12:50:31 +0000 (12:50 +0000)]
Properly indicate whether we can extend backwards.

22 months agoAbility to retrieve the thread of a post.
Simon Tatham [Fri, 8 Dec 2023 12:48:49 +0000 (12:48 +0000)]
Ability to retrieve the thread of a post.

22 months agoFix a wrapping glitch I spotted this morning.
Simon Tatham [Fri, 8 Dec 2023 12:33:24 +0000 (12:33 +0000)]
Fix a wrapping glitch I spotted this morning.

22 months agoFix API mismatch in composer tests.
Simon Tatham [Fri, 8 Dec 2023 12:33:11 +0000 (12:33 +0000)]
Fix API mismatch in composer tests.

22 months agoAdd a final menu before posting a status.
Simon Tatham [Fri, 8 Dec 2023 09:01:11 +0000 (09:01 +0000)]
Add a final menu before posting a status.

So far it doesn't have anything useful in it, but the idea is that it
will be where you add all the other options in statuses, like media
attachments, content warnings, etc.

22 months agoMake the dry-run posting mode a standard option.
Simon Tatham [Fri, 8 Dec 2023 08:55:14 +0000 (08:55 +0000)]
Make the dry-run posting mode a standard option.

It's silly to keep hacking it out in the source code every time I want
to test something!

22 months agoProper old-fashioned [RET][.][RET] to finish a post
Simon Tatham [Fri, 8 Dec 2023 08:42:56 +0000 (08:42 +0000)]
Proper old-fashioned [RET][.][RET] to finish a post

22 months agoImplement extending feeds backwards.
Simon Tatham [Fri, 8 Dec 2023 08:26:03 +0000 (08:26 +0000)]
Implement extending feeds backwards.

22 months agoGet editor limits from the instance.
Simon Tatham [Fri, 8 Dec 2023 07:43:55 +0000 (07:43 +0000)]
Get editor limits from the instance.

22 months agoShow which things are already faved/boosted.
Simon Tatham [Fri, 8 Dec 2023 07:35:44 +0000 (07:35 +0000)]
Show which things are already faved/boosted.

Now we can only offer the right one of fave and unfave buttons, too.

22 months agoAdd target highlights in the Ego Log.
Simon Tatham [Fri, 8 Dec 2023 07:25:18 +0000 (07:25 +0000)]
Add target highlights in the Ego Log.

Forgot!

22 months agoAbility to [un]favourite posts.
Simon Tatham [Fri, 8 Dec 2023 07:07:29 +0000 (07:07 +0000)]
Ability to [un]favourite posts.

I had a conversation yesterday about how I should use that button
more, so I guess my personal client needs to have the functionality!

22 months agoPrepare to reuse post-selection UI for other things.
Simon Tatham [Fri, 8 Dec 2023 07:02:35 +0000 (07:02 +0000)]
Prepare to reuse post-selection UI for other things.

22 months agoFix a crash when hitting Return in the editor.
Simon Tatham [Thu, 7 Dec 2023 21:26:57 +0000 (21:26 +0000)]
Fix a crash when hitting Return in the editor.

22 months agoLeft and Right should page up/down in files.
Simon Tatham [Thu, 7 Dec 2023 21:22:35 +0000 (21:22 +0000)]
Left and Right should page up/down in files.

Didn't realise how much I'd internalised that keystroke pair until I
found it wasn't working.

22 months agoAll the machinery is ready to try to post!
Simon Tatham [Thu, 7 Dec 2023 18:52:56 +0000 (18:52 +0000)]
All the machinery is ready to try to post!

22 months agoNow we spawn an editor with the right set of recipients.
Simon Tatham [Thu, 7 Dec 2023 18:44:20 +0000 (18:44 +0000)]
Now we spawn an editor with the right set of recipients.

Still can't _do_ anything with it, though.

22 months agoFirst cut at an editor for composing posts.
Simon Tatham [Thu, 7 Dec 2023 08:34:39 +0000 (08:34 +0000)]
First cut at an editor for composing posts.

Basic editing keys are supported; no refinements. Let's see how this
goes before I decide which editing functionality to add next.

22 months agoSwitch to using Unicode input.
Simon Tatham [Thu, 7 Dec 2023 17:56:23 +0000 (17:56 +0000)]
Switch to using Unicode input.

I failed to notice that getch() delivers you single bytes in trad
fashion. Switched to get_wch(), which returns either a Python char
(that is, a length-1 str) or an integer containing a curses key code.

Also it throws an exception instead of returning curses.ERR, which
I've dealt with by the simplest possible method of turning it back
into curses.ERR. (The exception in this case is almost always 'stdin
is nonblocking and there's nothing to see here yet'.)

22 months agoScroll by a bit less than a full screen in files.
Simon Tatham [Thu, 7 Dec 2023 17:55:03 +0000 (17:55 +0000)]
Scroll by a bit less than a full screen in files.

Real Mono does this asymmetrically, it turns out: [SPACE] scrolls down
in such a way that the new screenful has 2 lines in common with the
old one, whereas [-] scrolls up by a little less so that you have 4
lines in common.

I can't quite bring myself to replicate _that_ oddity, so I've
compromised on 3 in both directions.

22 months agoPrevent accidentally stacking multiple [ESC][R].
Simon Tatham [Thu, 7 Dec 2023 07:45:30 +0000 (07:45 +0000)]
Prevent accidentally stacking multiple [ESC][R].

Now, if you [ESC] to get to where you already were, it will just go
back to the existing stack entry.

(But maybe this still isn't strong enough? Perhaps we need to search
for it all the way up?)

22 months agoActually show keypresses in menus
Simon Tatham [Thu, 7 Dec 2023 07:34:35 +0000 (07:34 +0000)]
Actually show keypresses in menus

22 months agoTry out the traditional ESC X X to exit.
Simon Tatham [Thu, 7 Dec 2023 07:25:15 +0000 (07:25 +0000)]
Try out the traditional ESC X X to exit.

Although I might go back to letting you [Q] out of the Main Menu; not
sure yet.

22 months agoAdd a Main Menu, at last.
Simon Tatham [Thu, 7 Dec 2023 07:18:29 +0000 (07:18 +0000)]
Add a Main Menu, at last.

Now that you can [RET] out of the home timeline, it's handy!

22 months agoFix getting stuck in the logs menus
Simon Tatham [Thu, 7 Dec 2023 07:14:08 +0000 (07:14 +0000)]
Fix getting stuck in the logs menus

22 months agoCorrect handling of [RET] in files and menus.
Simon Tatham [Thu, 7 Dec 2023 07:12:48 +0000 (07:12 +0000)]
Correct handling of [RET] in files and menus.

(a) turned out curses was returning it as \n not \r
(b) also, in a file, it should go down a line _or exit_.

22 months agoAmazingly horrible regexes for scanning post content.
Simon Tatham [Thu, 7 Dec 2023 07:00:37 +0000 (07:00 +0000)]
Amazingly horrible regexes for scanning post content.

22 months agoSupport <em> in post content.
Simon Tatham [Thu, 7 Dec 2023 05:35:32 +0000 (05:35 +0000)]
Support <em> in post content.

I just received a reply containing one.

22 months agoShow a Re: header on reply posts.
Simon Tatham [Thu, 7 Dec 2023 05:33:13 +0000 (05:33 +0000)]
Show a Re: header on reply posts.

22 months agoSpace out the ... at the end of a boost/fave record.
Simon Tatham [Thu, 7 Dec 2023 05:22:03 +0000 (05:22 +0000)]
Space out the ... at the end of a boost/fave record.

22 months agoDon't show @mentions in Ego Log post summaries.
Simon Tatham [Thu, 7 Dec 2023 05:18:52 +0000 (05:18 +0000)]
Don't show @mentions in Ego Log post summaries.

That way we get in as much as possible of the message _content_, which
should help disambiguate posts that are part of a long conversation
with the same user(s).

22 months agoFix missing 'you' after 'followed'.
Simon Tatham [Wed, 6 Dec 2023 19:03:26 +0000 (19:03 +0000)]
Fix missing 'you' after 'followed'.

22 months agoMake the ego feed refresh.
Simon Tatham [Wed, 6 Dec 2023 19:03:14 +0000 (19:03 +0000)]
Make the ego feed refresh.

22 months ago*Really* fix that crash on receiving a mention.
Simon Tatham [Wed, 6 Dec 2023 19:02:19 +0000 (19:02 +0000)]
*Really* fix that crash on receiving a mention.

Commit 35ba8f325faf3e3 replaced the wrong thing with a different wrong
thing, ahem.

22 months agoFirst cut at an 'ego log'.
Simon Tatham [Wed, 6 Dec 2023 12:57:27 +0000 (12:57 +0000)]
First cut at an 'ego log'.

Shows all the indications that people like me. Lives at the same place
Mono's Edit Log lives.

Formatting wants some work:
 - maybe trim out @mentions from the front, so we quote more actual text
 - do something to make log entries more nicely separated

22 months agoFix a crash on receiving a mention.
Simon Tatham [Wed, 6 Dec 2023 12:28:43 +0000 (12:28 +0000)]
Fix a crash on receiving a mention.

self.mentions_feed is a function; mentions_feed is the value it returned.

22 months agoCope with lack of XDG config directories.
Simon Tatham [Wed, 6 Dec 2023 07:34:22 +0000 (07:34 +0000)]
Cope with lack of XDG config directories.

If the host system is a pure server which you log into via ssh, it may
not have these at all. Hard-code the default ~/.config as a fallback.

22 months agoUNTESTED: beep and go to [ESC][R] on a message.
Simon Tatham [Wed, 6 Dec 2023 07:33:31 +0000 (07:33 +0000)]
UNTESTED: beep and go to [ESC][R] on a message.

22 months agoNow we can read 'messages'! (aka mentions)
Simon Tatham [Wed, 6 Dec 2023 07:30:03 +0000 (07:30 +0000)]
Now we can read 'messages'! (aka mentions)

22 months agoDo SIGWINCH handling ourselves.
Simon Tatham [Wed, 6 Dec 2023 06:52:06 +0000 (06:52 +0000)]
Do SIGWINCH handling ourselves.

It broke as a side effect of going into nodelay mode, I think because
our select loop didn't know to check curses's flag.

22 months agoSet curses nodelay mode.
Simon Tatham [Wed, 6 Dec 2023 06:28:28 +0000 (06:28 +0000)]
Set curses nodelay mode.

Otherwise, pressing M-g (in pterm, which curses will interpret as ESC
g, just as I'd want it to) delivers the ESC, but leaves the g in
curses's internal buffer, which we don't empty before diving back into
the select loop.

22 months agoDetect updates and append them to the file.
Simon Tatham [Tue, 5 Dec 2023 13:05:36 +0000 (13:05 +0000)]
Detect updates and append them to the file.

22 months agoPaging around a file now works!
Simon Tatham [Tue, 5 Dec 2023 13:05:23 +0000 (13:05 +0000)]
Paging around a file now works!

22 months agoVERY UNFINISHED attempt to start reading a file in curses.
Simon Tatham [Tue, 5 Dec 2023 07:09:40 +0000 (07:09 +0000)]
VERY UNFINISHED attempt to start reading a file in curses.

22 months agoTest of streaming
Simon Tatham [Mon, 4 Dec 2023 20:06:04 +0000 (20:06 +0000)]
Test of streaming

22 months agoUNTESTED attempt to make bidirectional incremental feeds
Simon Tatham [Mon, 4 Dec 2023 19:58:56 +0000 (19:58 +0000)]
UNTESTED attempt to make bidirectional incremental feeds

22 months agoChange my mind about account name policy.
Simon Tatham [Sun, 3 Dec 2023 07:18:06 +0000 (07:18 +0000)]
Change my mind about account name policy.

I think the leading @ is only for @mentioning people, and it's only
out of the Mastodon context that people put it on by habit as a hint
that they're talking about the fediverse.

Also, I think I prefer my account names fully qualified, so now I have
access to the correct instance domain, I'll put it in From lines where
the server didn't send one at all.

22 months agoAvoid ugly double blank line in media-only posts.
Simon Tatham [Sun, 3 Dec 2023 07:14:29 +0000 (07:14 +0000)]
Avoid ugly double blank line in media-only posts.

22 months agoCope with newlines in media descriptions.
Simon Tatham [Sat, 2 Dec 2023 19:21:50 +0000 (19:21 +0000)]
Cope with newlines in media descriptions.

22 months agoSeparate logical instance domain from physical URL.
Simon Tatham [Sat, 2 Dec 2023 19:15:35 +0000 (19:15 +0000)]
Separate logical instance domain from physical URL.

Some instances don't have the same domain name, e.g. Julia Evans's
personal instance lives at https://social.jvns.ca but the domain name
for username purposes is user@jvns.ca. Now I think we're correctly
distinguishing the two concepts.

22 months agoFirst cut at interleaving home timeline with mentions.
Simon Tatham [Sat, 2 Dec 2023 18:59:50 +0000 (18:59 +0000)]
First cut at interleaving home timeline with mentions.

It took so many tries to get that merge algorithm working that I
managed to get '429 Too many requests' from the server. I hope that's
sorted out tomorrow. Perhaps I should call it a night for now.

22 months agoLog JSON responses more usefully
Simon Tatham [Sat, 2 Dec 2023 18:59:38 +0000 (18:59 +0000)]
Log JSON responses more usefully

22 months agoProof of concept using Link response headers for pagination.
Simon Tatham [Sat, 2 Dec 2023 18:24:53 +0000 (18:24 +0000)]
Proof of concept using Link response headers for pagination.

22 months agoRemove redundant setup calls.
Simon Tatham [Sat, 2 Dec 2023 18:13:55 +0000 (18:13 +0000)]
Remove redundant setup calls.

22 months agoProof of concept fetching my notifications timeline.
Simon Tatham [Sat, 2 Dec 2023 18:12:39 +0000 (18:12 +0000)]
Proof of concept fetching my notifications timeline.

22 months agoColourise spaces properly.
Simon Tatham [Sat, 2 Dec 2023 18:01:26 +0000 (18:01 +0000)]
Colourise spaces properly.

It showed up in that error report, and it would have been nasty
copy-pasting as well.

22 months agoReport markup parse failures inline.
Simon Tatham [Sat, 2 Dec 2023 17:58:05 +0000 (17:58 +0000)]
Report markup parse failures inline.

Don't want to crash the whole client for them!

22 months agoHandle <strong> tags
Simon Tatham [Sat, 2 Dec 2023 17:48:11 +0000 (17:48 +0000)]
Handle <strong> tags

22 months agoShow media attachments in posts
Simon Tatham [Sat, 2 Dec 2023 17:38:25 +0000 (17:38 +0000)]
Show media attachments in posts

22 months agoShow boosted toots sensibly.
Simon Tatham [Sat, 2 Dec 2023 17:28:02 +0000 (17:28 +0000)]
Show boosted toots sensibly.

22 months agoNow actually use the login details.
Simon Tatham [Sat, 2 Dec 2023 17:21:50 +0000 (17:21 +0000)]
Now actually use the login details.

The public timeline is replaced with my home timeline, which I can now
access because my client is logged in.

22 months agoImplemented login.
Simon Tatham [Sat, 2 Dec 2023 17:14:16 +0000 (17:14 +0000)]
Implemented login.

22 months agoStart of a curses UI.
Simon Tatham [Sat, 2 Dec 2023 16:16:37 +0000 (16:16 +0000)]
Start of a curses UI.

Just does setup and teardown, but I've at least integrated the
ColouredString system from text.py into it

22 months agoSupport hashtags, mentions and code. <pre> still to do.
Simon Tatham [Sat, 2 Dec 2023 13:52:23 +0000 (13:52 +0000)]
Support hashtags, mentions and code. <pre> still to do.

22 months agoAdd some rendering unit tests
Simon Tatham [Sat, 2 Dec 2023 13:37:01 +0000 (13:37 +0000)]
Add some rendering unit tests

22 months agoStart colourising the rendering
Simon Tatham [Sat, 2 Dec 2023 12:30:50 +0000 (12:30 +0000)]
Start colourising the rendering

22 months agoFirst cut at printing post content.
Simon Tatham [Fri, 1 Dec 2023 17:39:19 +0000 (17:39 +0000)]
First cut at printing post content.

22 months agoAlso display From: lines.
Simon Tatham [Fri, 1 Dec 2023 09:03:52 +0000 (09:03 +0000)]
Also display From: lines.

22 months agoStart of a Monochrome-like Mastodon client.
Simon Tatham [Fri, 1 Dec 2023 09:00:43 +0000 (09:00 +0000)]
Start of a Monochrome-like Mastodon client.

Currently fetches a public timeline, and formats Mono-style post
separator lines without any colour. Much yet to do!