simon-git: mastodonochrome (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Feb 4 15:10:04 GMT 2024


TL;DR:
  8464456 Add README and metadata.
  dc652c7 Remove redundant license-file from Cargo.toml.
  9d37656 impl TextFragmentOneLine for CentredInfoLine.
  d2265d9 Move terminal output into a sub-struct.
  cc9258b Make execute_and_log_request a method of Client.
  72e5bbe Implement a visible 'busy' indicator.
  bd55eaf Merge Ian's ColouredString improvements.

Repository:     https://git.tartarus.org/simon/mastodonochrome.git
On the web:     https://git.tartarus.org/?p=simon/mastodonochrome.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2024-02-04 15:10:04

commit 846445671cf172a3b56f94609cad64ae026ec0b6
web diff https://git.tartarus.org/?p=simon/mastodonochrome.git;a=commitdiff;h=846445671cf172a3b56f94609cad64ae026ec0b6;hp=de46af38aed6c476652f9b2b96c29cd0100e8643
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 4 10:40:23 2024 +0000

    Add README and metadata.
    
    So I can publish to crates.io, reserving the name and allowing
    installation of the binary via 'cargo install mastodonochrome'.

 Cargo.toml |  5 +++++
 README.md  | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+)

commit dc652c7605f1ce2b6c1a6fdea8a5339b3dd818b2
web diff https://git.tartarus.org/?p=simon/mastodonochrome.git;a=commitdiff;h=dc652c7605f1ce2b6c1a6fdea8a5339b3dd818b2;hp=846445671cf172a3b56f94609cad64ae026ec0b6
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 4 14:08:42 2024 +0000

    Remove redundant license-file from Cargo.toml.
    
    Now I see the warning pointing out that it's not necessary to have
    that _as well_ as the license = "MIT". Seems odd to me, because
    there's still more detail in the full file (copyright holders, dates),
    but whatever.

 Cargo.toml | 1 -
 1 file changed, 1 deletion(-)

commit 9d3765699f4531c90046122e3c943ab77d75709c
web diff https://git.tartarus.org/?p=simon/mastodonochrome.git;a=commitdiff;h=9d3765699f4531c90046122e3c943ab77d75709c;hp=dc652c7605f1ce2b6c1a6fdea8a5339b3dd818b2
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 4 14:51:08 2024 +0000

    impl TextFragmentOneLine for CentredInfoLine.
    
    This always draws exactly one line, and I'm about to want to use it in
    a context that expects that and doesn't want to worry about unpacking
    a returned vector.

 src/text.rs | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

commit d2265d98e79714dfba37c72d8234d694127bfb73
web diff https://git.tartarus.org/?p=simon/mastodonochrome.git;a=commitdiff;h=d2265d98e79714dfba37c72d8234d694127bfb73;hp=9d3765699f4531c90046122e3c943ab77d75709c
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 4 14:09:41 2024 +0000

    Move terminal output into a sub-struct.
    
    The sub-struct is held in an Rc<RefCell> by Tui, which will allow me
    to make other copies of the Rc and use them to give preliminary
    display updates.

 src/tui.rs | 57 +++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 41 insertions(+), 16 deletions(-)

commit cc9258b50974108d03bbe03e1c5ca2b2e4d5766c
web diff https://git.tartarus.org/?p=simon/mastodonochrome.git;a=commitdiff;h=cc9258b50974108d03bbe03e1c5ca2b2e4d5766c;hp=d2265d98e79714dfba37c72d8234d694127bfb73
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 4 14:57:10 2024 +0000

    Make execute_and_log_request a method of Client.
    
    All the calls to it happen inside methods of Client, so there's no
    reason this is difficult. The only reason it was a separate function
    in the first place was so that the old version of login.rs could use
    it, which did login outside the full TUI via a separate network
    interaction module. But now all the functions of that module have been
    moved into Client, execute_and_log_request is fine as it is.
    
    It also doesn't need to be pub any more.

 src/client.rs | 67 ++++++++++++++++++++++++++++++-----------------------------
 1 file changed, 34 insertions(+), 33 deletions(-)

commit 72e5bbe02ee415d8f514e010e5f1e8dfeec813fb
web diff https://git.tartarus.org/?p=simon/mastodonochrome.git;a=commitdiff;h=72e5bbe02ee415d8f514e010e5f1e8dfeec813fb;hp=cc9258b50974108d03bbe03e1c5ca2b2e4d5766c
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 4 14:23:48 2024 +0000

    Implement a visible 'busy' indicator.
    
    This is implemented by giving Client a reference to the TuiOutput,
    which it can call to notify that a network operation has started. So
    whenever any keystroke results in network activity, we immediately
    update the screen to indicate that something is happening that takes
    time, reducing the risk that the user will believe their keystroke was
    ignored.
    
    The Client's reference is wrapped in a new 'TuiBusyIndicator' struct,
    in case we need to change the notification mechanism. (For example, if
    this business ever starts to sprawl across multiple threads, it might
    be more convenient to make TuiBusyIndicator contain the sending end of
    a sync_channel, so that the display thread would receive the busy
    indication from wherever it was sent.)
    
    All client activity goes via the just-moved execute_and_log_request
    method, so that's the only place I need to insert a call to set_busy.
    So this causes no extra boilerplate per Client method.

 TODO.md       | 11 ----------
 src/client.rs | 14 +++++++++++++
 src/tui.rs    | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 78 insertions(+), 12 deletions(-)

commit bd55eaf7e0b9695a1c5639144a4761da343aae23
web diff https://git.tartarus.org/?p=simon/mastodonochrome.git;a=commitdiff;h=bd55eaf7e0b9695a1c5639144a4761da343aae23;hp=72e5bbe02ee415d8f514e010e5f1e8dfeec813fb
Merge: 72e5bbe a9b5c77
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Feb 4 15:03:37 2024 +0000

    Merge Ian's ColouredString improvements.



More information about the tartarus-commits mailing list