Commit graph

39 commits

Author SHA1 Message Date
aad9c74a63 Vanity 2024-08-17 08:29:27 -07:00
eede5b0e50 Support showing and hiding anonymous ports
I'm still not convinced that showing a big list of disabled ports is
the right thing to do so here's the ability to turn it off.
2024-08-17 08:03:41 -07:00
4fe255e7d2 Fix colors in the help box
When the lines of the help box overlap with disabled or error'd ports
you might notice that those lines are dark grey or red. That's
surprising!

The bug is that Style::default() means "don't change anything", just
continue being whatever color the current cell is, which is deeply
surprising. What we really want here is `Style::reset()`, which means
"reset the colors to whatever the terminal would show by default."
2024-08-13 10:52:20 -07:00
b381f71692 Move from tui to ratatui
Tui is no longer supported, ratatui is the new hotness. Fortunately
there is very little difference between the two, except I've noticed a
fun new bug in the help screen. (Maybe it's been there the whole time?)
2024-08-13 10:44:58 -07:00
a9bbd29f9f Fix enable/disable state changes
Enabled -> Broken -> Disabled -> Enabled

etc
2024-08-10 07:59:46 -07:00
a4745c92e2 Anonymous ports
This is the other way to allow ports to work when the processes
themselves cannot be enumerated: just report the port with an empty
description. We need to do some work to make sure this is safe for the
client; see comments.
2024-08-10 07:44:06 -07:00
69b9bc9824 Sometimes you can't get a clipboard, don't fail
This should fix CI as well, but there are possibly folks out there
that don't have a functioning clipboard and still want to run.
2024-08-10 07:29:54 -07:00
bb8c87bad9 Anonymous ports are described with a fixed string 2024-08-10 07:02:46 -07:00
b86a09131b Don't enable anonymous ports by default 2024-08-10 06:58:22 -07:00
de06612eb1 Respect server-wide auto setting 2024-08-10 06:54:26 -07:00
cc004df6e8 Clippy 2024-08-10 06:48:24 -07:00
0ad0fb1a56 That was completely wrong
Look the whole point of the ports in the config is to have them
enabled *even if the server doesn't show them to you.* The other
behavior was just completely wrong in that respect.
2024-08-08 18:21:47 -07:00
8f12945d83 Fix up port state interactions in the face of configuration 2024-08-08 14:26:41 -07:00
6736cdd431 Additional tests for configuration 2024-08-08 10:26:36 -07:00
e1768a0433 Honor the configured description for a port, if any
Get rid of that dumb warning, can't believe I forgot to wire this for
so long.
2024-08-08 10:15:42 -07:00
2a582e25a8 Many fixes for the clipboard and others
- Reverse connections must be maintained to ensure messages are
  processed in order. (Whoops!)
- The clipboard context must remain live in order for the data to
  remain available for applications, at least on X11. (And it couldn't
  hurt elsewhere, either, I guess.)
- Print out the server version at startup time, so we can be sure what
  we're talking to.
- Print out the full details of the error when something goes wrong
  with `browse` or `clip`.
2024-08-08 10:07:57 -07:00
Brandon W Maister
b983595049 feat: Show errored ports as an error state 2024-08-05 12:16:47 -07:00
08a41492b8 Clippy I guess 2024-06-21 08:26:56 -07:00
b85e3fa9a6 Fix crash on changing selection with no ports
No ports always means no selection
2023-04-30 07:33:06 -07:00
815ee5e86e Remove explanation for what fwd does
You probably know already, and it feels clunky here.
2023-04-30 07:24:18 -07:00
59b8b8f3dc Cleanup some help text 2023-04-26 12:00:01 -07:00
a3c4c3ea5e Track the selection across refreshes by port number
The next step would obviously be to track the selection only by port
number, so that we remember the selection if the port goes away and
comes back.
2023-03-23 19:40:42 -07:00
99d377d4ce Make help modal
I don't like that ENTER and the arrow keys still manipulate the list
while help is showing. Ignore other keypresses while the help screen
is shown.

Also, make the spelling/capitalization a little cleaner.
2023-03-21 23:17:16 -07:00
34340e2575 Simplify centering math, don't crash if the rectangle clips
Also, tests
2023-03-21 23:07:08 -07:00
Brandon W Maister
290dcff9b6 tui: Add a help popup 2023-03-21 22:53:35 -07:00
Brandon W Maister
381c008665 tui: Add a fwd column with a ✓ to show that ports are being forwarded
I didn't realize that everything was forwarded by default, this makes it more
obvious.
2023-03-21 22:53:35 -07:00
7410ec5143 Add tests for keypresses 2023-03-21 22:48:06 -07:00
f174f364a4 Re-add assertions and simplify wrapping 2023-03-21 19:45:17 -07:00
Brandon W Maister
3060032a95 ui: Wrap around list when at the endoflife
Pressing "up"/"k" at the top of the UI will now go to the end of the list. And
same in reverse.
2023-02-18 11:27:58 -08:00
Brandon W Maister
85dc2f0707 ui: Switch j and k keys to match vi -- j means down, k means up 2023-02-18 11:27:23 -08:00
81b53355f2 Some more bad tests because I'm bored 2022-12-19 20:53:26 -08:00
e0d1efb997 Add a test for that underflow I fixed 2022-12-19 19:45:07 -08:00
0bb3fac61b Don't underflow on no ports
If ports are empty we underflow on `len()-1`, which is bad. Stop doing
that.
2022-12-19 19:07:05 -08:00
abbb30d87b Remove ports when they're unconfigured
This is closer to what I had intended
2022-11-28 07:03:04 -08:00
46c9643ddf Remove unused import 2022-11-28 06:42:51 -08:00
fc75ffcd4e Remove the disconnected screen 2022-11-28 06:41:26 -08:00
dc374f0d20 Change UI to tui 2022-11-27 08:24:01 -08:00
efb7ef6929 Starting configuration, probably doesn't work 2022-10-18 11:28:56 -07:00
86ea099b2c Split client and server into modules 2022-10-17 19:57:47 -07:00
Renamed from src/ui.rs (Browse further)