Repository navigation
feat: set the sources up in Settings, keys on the cards only (0.10.0) - #33
Merged
Merged
Conversation
The arrows reach the cards from anywhere in the window, as h, j, k and l do, instead of moving the focus through every button off the cards. On the page nothing but the cards takes the keyboard focus: the controls, the tabs, the New button, a stack's header, the empty-stack toggle, the "show more" button, a card's link and its menu button are built not focusable, and the board itself is not either, so neither GTK's first focus nor a click leaves the focus, and Enter, on one of them. The mouse clicks them as before. A card's menu closing gives the focus back to the card. Tab, or Shift+Tab, which GDK reports as its own key, switches between the Activity and the Board, next to 1 and 2. The card in focus wears a ring in the text colour, and the controls in dialogs too, instead of the accent at 60%, which read as a picked card or the open tab. The sources are at the top of Settings, and the Sources button, its s key and the sources scene are gone. The gear turns into the warning icon while a source needs a look, and its tooltip says so before what the view changes. The clock, which grows into the room the button left, keeps 24px from the controls.
An upgrade replaces the program on disk, but a window already running keeps the old one, and as the single instance it takes every later launch: after upgrading to 0.9.0, opening TasksPending or clicking its icon on the bar brought back the 0.8 window, without the keys dialog or the card keys. Linux shows such a program's /proc/self/exe as deleted; the window now reads it whenever its controls are drawn, and when it comes to the front, and the line under the controls then says "· restart to update", with a tooltip to quit (Ctrl+Q) and open it again. It says more than a newer version published, which it replaces.
The README, the operations guide and DESIGN.md say that the keyboard focus goes to the cards and nowhere else on the page, that the arrows move between them from anywhere and Tab switches tabs, that the focus ring is the text colour, and that the sources head Settings, with the gear's warning in place of the Sources button; the install guide sends config errors to Settings. The operations guide explains the restart note, AGENTS.md says how a new widget on the page stays out of the focus, and the changelog's Unreleased section gains the entries. The pictures are taken again without the Sources button, and its own picture is gone, Settings showing the sources now.
A TasksPending already running drops down in the same special workspace as the sandbox, at the same place, so the sandbox's toggle showed both windows and the real cards came through the translucent sandbox. dropdown-picture.sh now moves that window to another special workspace before the picture and puts it back on the way out, failure included.
The README's first picture showed the hero with its old Sources button. Retaken with scripts/dropdown-picture.sh: the gear now carries the sandbox's source warning, and the pointer is painted out.
…ext colour The page's scroller took GTK's first focus, before the cards were drawn, and kept it; it is no longer focusable, so the focus starts nowhere and the first move goes to the first card. Switches, rows and text fields in dialogs still showed the focus in the accent; they now use the text colour, as the buttons and cards do. A test no longer depends on the test binary staying in place, and comments stop naming a card's link and menu button as focus targets.
With the focus on the cards only, a stack's cards past the fifth, the stacks collapsed with the mouse and the snoozed list had no key. Down (or j) on the last card a stack shows, while it holds more, now opens the stack and goes on to the first card it was hiding; c opens the collapsed stacks on the Board; s lists the snoozed cards, and the snoozed link's tooltip names it. The keys dialog lists both, and its picture is retaken. Only tidying the Board (collapsing a stack, showing the empty ones, showing fewer cards) stays the mouse's.
pending_core::edit::ConfigDoc adds, removes, moves and rewrites sources and stacks, and sets the file's own keys, through toml_edit: comments, spacing and order stay as written, a changed value keeps the comment after it, and new stacks and keys are indented like their neighbours. Every table is renumbered after a change, since toml_edit writes tables in that order and a stack written last would join the last source. The old names, lane and columns, are kept where a file uses them.
The daemon reads the env file itself (~/.config/tasks-pending/env, where systemd's %E puts it) and lays its values over the process environment, so a token changed there applies on the next reload, as a config change does; a variable the file set at start and dropped since is dropped too. config::check loads a config text as the daemon would, stack keys and patterns included, without looking up credentials, and write_file replaces a file in one step, refusing when it changed since it was read, following links (a config kept in a dotfiles repository stays there) and keeping the env file private. GET /api/v1/files says which config and env file the dashboard follows, and the window asks it on start.
Each kind lists what it is, the board a new source starts on, the keys of its stacks (the one-of modes apart, the keys a stack cannot go without marked) with how each is filled in, and the env file variables its credentials come from, secrets marked. A runtime test holds the keys and their words to what each kind's stacks accept, and the variables to the names each kind reads.
The window no longer hides boards, groups and stacks of its own, nor refreshes every source on a timer: Settings will switch sources and stacks on and off in the config, and the daemon refreshes them as often as the config says. The view file keeps reading without the old settings, and drops them when saved again. With only the person asking for a refresh, the refresh command no longer says who asked.
Settings lists the sources by board, each with how its last refresh went and a switch, a board's switch for all of its sources, and adds sources of any kind. A source's page changes its name, board, interval, timeout and icon, sets its credentials in the env file (a secret is never shown, only whether it is set), switches, adds, reorders and removes its stacks, and moves or removes it. A stack's page is laid out from the kind's schema. The interval and the timeout of every source are set on the main page. Every change is made to the text Settings showed and checked as the dashboard loads it before the file is written in one step; one made to a file that changed outside Settings is refused, and Settings shows the file as it is now. The sandbox changes a config and an env file kept in memory. Two screenshot scenes show a source's page and a stack's.
operations.md describes the Settings pages for a source and a stack, how Settings writes the config and the env file, GET /api/v1/files, and the env file read again with the config; install.md drops the restarts after editing the env file. The README, AGENTS.md, DESIGN.md and the Makefile gain the source and stack pictures, and the changelog says what 0.9's hidden items and Auto-refresh became. The note under a source's board no longer calls boards tabs.
An env file saved as something other than text, or left unreadable by an edit as root, used to read as empty, and every source lost the tokens it started with; the last text read stays in use instead, with a warning. write_file writes through a link whose file does not exist yet rather than replacing the link, so a dotfiles link made first stays. The env parser's comment says which lines systemd reads differently, and the client reads GET /api/v1/files, and its 404 from an older daemon, in a test.
…oard only A secret typed as spaces was taken as no value and removed the token, with its other names, without the confirmation Remove has; it is now refused. Move up and Move down swap the source with the next one of its board (ConfigDoc::swap_sources), so the sources of other boards between them stay where they were and the boards keep their order.
…he focus c on the Activity opened the collapsed stacks out of sight, and saved it; it now brings the Board to the front first. Once a card's menu closes, the focus goes back to the card unless the entry chosen opened a dialog (Edit on a todo), which keeps it. operations.md no longer says the keyboard reaches the three-dot button: Ctrl+. opens it.
A step failing after the sandbox started (the bus lookup, gdbus, grim) put the running window back but left the sandbox up beside it; the exit trap now stops it by the PID it started, unless it already quit.
Bump the workspace to 0.10.0, matching the Arch package, and turn Unreleased into the 0.10.0 section: Settings sets the sources, their stacks and their tokens up, writing the config file with its comments kept and the env file, and the keyboard moves only between the cards. The four README pictures that show the version are taken again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Settings now sets the sources up, and the keyboard moves only between the cards. The 0.10.0 cut is on top, as with earlier releases.
enabled) and a page with its name, board, refresh, timeout and icons. From there it can be moved within its board or removed, and Add a source… adds one of any kind. Each stack has a page built from what its kind reads, defined inpending-core/src/schema.rs, which a runtime test holds to the providers. Refresh every and Give up on a refresh after set the globalrefresh_secondsandtimeout_seconds.toml_edit(pending-core/src/edit.rs), keeping comments, order and spacing. Before each write it reads the file again and refuses if the file changed since it was shown. It then checks that the new text loads as the daemon would load it, and writes it in one step, following links so a config kept in a dotfiles repository stays there. A config that does not load is not shown, only why.~/.config/tasks-pending/env, which Settings keeps at 0600. A secret is never shown, only whether it is set and under which name. The daemon reads the env file again with the config, every 2 s and on Refresh, so a changed token needs no restart. If the file becomes unreadable, the last values stay in use.GET /api/v1/filesnames the config file and the env file the dashboard follows. Over an older daemon, Settings says so and changes nothing but the window's own choices.enabled, and the window's Auto-refresh is replaced by the daemon'srefresh_seconds. Oldapp-view.jsonkeys still load and drop on the next save. What 0.9 hid shows again after the upgrade, which the changelog says.c,s, j past a stack's last card);restart to update.Verification
make ci-checkpasses on the branch head, the 0.10.0 cut included.pending-apphas 161 tests.con the Activity opened the Board's stacks out of sight;make screenshots), with the newsourceandstackscenes. The GTK pages have no unit tests. Their logic lives insettings.rs, which has tests, and the pages were checked through the pictures and the reviews.Known limits, not addressed here:
GITHUB_TOKENstill leaves thegh auth tokenfallback.Checklist
docs/operations.md,docs/install.md,AGENTS.md, the window'sDESIGN.md,config.example.toml, the changelog and the pictures.)make ci-checkpasses locally.