taro-ls: add indicator for pending operations; update readme

This commit is contained in:
Iris Lightshard 2023-04-02 21:18:27 -06:00
parent 43c5286527
commit df6e8dd49b
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
2 changed files with 68 additions and 12 deletions

View file

@ -35,7 +35,7 @@ The [.theme](https://wiki.xxiivv.com/site/theme.html) file format is supported -
3. Soft fg color eg. resize handle, textbox help (medium gray)
4. Foreground/text color (whitish gray)
Any 8x8 1bpp ASCII font in [icn](https://wiki.xxiivv.com/site/icn_format.html) format can be used. They can be created/edited in [nasu](https://git.sr.ht/~rabbits/nasu) and located at `TARO_LIB/font.icn`.
Any 8x8 1bpp ASCII font in [icn](https://wiki.xxiivv.com/site/icn_format.html) format can be used. They can be created/edited in [nasu](https://git.sr.ht/~rabbits/nasu) and should located at `TARO_LIB/font.icn`.
## usage
@ -66,6 +66,11 @@ The buttons on the bottom are as follows (with equivalent keybinds):
- refile [`m`]: move mail to the given folder
- trash [`Del`]: move mail to the Trash folder, unless it's already in the Trash, in which case it's deleted
In the bottom-left of the window is an indicator area with in which the following symbols may appear:
- `$`: search query is active - refresh or switch mailboxes to deactivate
- `*`: an operation is pending (ie, more messages have been sent than received)
There is a resize handle in the bottom right - clicking and dragging it resizes the window.
Additional keybindings:
@ -75,8 +80,6 @@ Additional keybindings:
- `shift+<up|down>`: naive multiselect
- `alt+<up|down|left|right>`: resize
At the bottom-left, a small indicator will appear if you have a search query active. Performing the refresh action or switching mailboxes will make it disappear.
### reading mail
Reading mail is currently done in a terminal that pipes the mail content into `less` and gives some keybind options:
@ -97,6 +100,12 @@ Writing mail is currently done by opening a terminal and calling `mcom`, which l
If you try to decrypt/sign with either `pinenetry-tty` or `pinentry-curses`, GPG will attach it to the stdio of `taro-ctl`, not the terminal window where you are viewing/composing mail. Use a graphical pinentry program instead.
### what it doesn't do
- manage your contacts (there are other programs for this)
- manage your calendar (and that)
- add/remove mailboxes (how many times a year do you do this?)
## TODO
- Add options to search (case-sensitive, search mail body, etc)

View file

@ -68,6 +68,7 @@
&sb_len $1 &sb_pos $2 &sb_step $2 ]
@btn_colors [ &compose $1 &refresh $1 &read_all $1 &search $1 &refile $1 &trash $1 ]
@btn_fns [ &compose $2 &refresh $2 &read_all $2 &search $2 &refile $2 &trash $2 ]
@pending_ops [ $1 ]
( program )
@ -196,6 +197,12 @@ JMP2r
JMP2r
&refresh_ui
( we may erroneously decrement if we have a pending operation
AND we close a reader/compose window but this is rare )
.pending_ops LDZ #00 EQU ,&no_dec_pending JCN
.pending_ops LDZ #01 SUB .pending_ops STZ
#01 .refresh/etc STZ
&no_dec_pending
.list/bytes LDZ2 .decoding/count LDZ2 NEQ2 ,&no_list JCN
#01 .refresh/list STZ
&no_list
@ -219,6 +226,7 @@ JMP2r
.list update_sb_pos
pending_ops++
#00 .textbox/searching STZ
#01 .refresh/etc STZ
@ -230,6 +238,9 @@ JMP2r
#00 .Console/write DEOk DEO
( message size is 0, no payload )
pending_ops++
#01 .refresh/etc STZ
JMP2r
@send_search ( -- )
@ -237,6 +248,14 @@ JMP2r
SEARCH_MAIL .Console/write DEO
;textbox_text strlen SWP .Console/write DEO .Console/write DEO
;textbox_text send_str
#0000 .list/select_index STZ2
#0001 .list/select_len STZ2
#0000 .list/top STZ2
.list update_sb_pos
pending_ops++
#01 .textbox/searching STZ
#01 .refresh/etc STZ
@ -251,6 +270,9 @@ JMP2r
SWP .Console/write DEO .Console/write DEO
;textbox_text send_str
pending_ops++
#01 .refresh/etc STZ
JMP2r
@send_trash ( -- )
@ -261,6 +283,9 @@ JMP2r
SWP .Console/write DEO .Console/write DEO
SWP .Console/write DEO .Console/write DEO
pending_ops++
#01 .refresh/etc STZ
JMP2r
@send_reader ( -- )
@ -304,6 +329,12 @@ JMP2r
JMP2r
@pending_ops++ ( -- )
.pending_ops LDZk INC SWP STZ
JMP2r
( -== input ==- )
@on_key ( -> )
@ -875,6 +906,7 @@ JMP2r
.refresh/etc LDZ #00 EQU ,&no_etc JCN
draw_search_indicator
draw_pending_indicator
draw_resize_handle
#00 .refresh/etc STZ
&no_etc
@ -890,13 +922,27 @@ BRK
@draw_search_indicator ( -- )
.textbox/searching LDZ #00 EQU ,&nothing JCN
;search_indicator #0000 .Screen/height DEI2 #0008 SUB2 #01 draw_str
JMP2r
;search_indicator #0000 .Screen/height DEI2 #0008 SUB2 #01 draw_str
JMP2r
&nothing
#0000 .Screen/x DEO2
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
;blank .Screen/addr DEO2
#01 .Screen/sprite DEO
#0000 .Screen/x DEO2
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
;blank .Screen/addr DEO2
#01 .Screen/sprite DEO
JMP2r
@draw_pending_indicator ( -- )
.pending_ops LDZ #00 EQU ,&nothing JCN
;pending_indicator #0008 .Screen/height DEI2 #0008 SUB2 #01 draw_str
JMP2r
&nothing
#0008 .Screen/x DEO2
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
;blank .Screen/addr DEO2
#01 .Screen/sprite DEO
JMP2r
@draw_bone ( -- )
@ -1218,6 +1264,7 @@ JMP2r
( -== data ==- )
@search_indicator "$ 00
@pending_indicator "* 00
@theme_file ".theme 00
@font_file "font.icn 00
@ -1261,7 +1308,7 @@ JMP2r
]
@metadata [ 00 "taro 0a
"v0.2.1 0a
"v0.2.2 0a
"GUI 20 "for 20 "mblaze 0a
"Derek 20 "Stevens 20 "<nilix@nilfm.cc> 0a 00
]