Skip to content

feat: set the sources up in Settings, keys on the cards only (0.10.0) - #33

Merged
brunoomariano merged 18 commits into
developfrom
feat/settings-config
Nov 12, 2026
Merged

brunoomariano merged 18 commits into
developfrom
feat/settings-config

Conversation

@brunoomariano

Copy link
Copy Markdown
Owner

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.

  • Sources and stacks in Settings. Settings lists the sources by board. Each one has a switch (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 in pending-core/src/schema.rs, which a runtime test holds to the providers. Refresh every and Give up on a refresh after set the global refresh_seconds and timeout_seconds.
  • The config stays a TOML file. Settings edits it through 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.
  • Credentials in the env file. Each source's page sets its kind's variables in ~/.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/files names 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.
  • Window-only choices folded into the config. The 0.9 show/hide switches are now enabled, and the window's Auto-refresh is replaced by the daemon's refresh_seconds. Old app-view.json keys still load and drop on the next save. What 0.9 hid shows again after the upgrade, which the changelog says.
  • Keyboard (bcba266…174e42d):
    • the arrows and h/j/k/l move only between cards;
    • Tab switches tabs;
    • the focus ring is in the text colour, never the accent;
    • the Sources button is gone, and its sources head Settings;
    • what the focus no longer reaches has keys (c, s, j past a stack's last card);
    • a window that outlived an upgrade says restart to update.
  Settings
+ Sources by board: switch (enabled) and page per source
+   source page: fields + Save, credentials (env file, 0600), stacks, move, remove
+   stack page: generated from pending_core::schema
+ Refresh every / Give up on a refresh after  -> refresh_seconds / timeout_seconds
- show or hide switches (app-view.json)       -> enabled in the config
- Auto-refresh (window)                       -> the daemon's refresh_seconds
  daemon
+ env file read with the config (no restart)
+ GET /api/v1/files

Verification

  • make ci-check passes on the branch head, the 0.10.0 cut included. pending-app has 161 tests.
  • Mutation checks: the test fails with the logic undone for 7 of 7 schema mutants and 15 of 15 Settings mutants. The same holds for each review fix:
    • a blank secret is refused;
    • an unreadable env file keeps the last values;
    • a dangling link is written through;
    • moving a source swaps it with the next one of its board.
  • Two general reviews ran in a fresh context, one on the Settings and config work and one on the keyboard commits. Neither found anything blocking. The should-fix items are fixed here:
    • a secret typed as spaces removed the token;
    • an unreadable env file dropped every token;
    • a dangling dotfiles link was replaced by a plain file;
    • Move down reordered whole boards;
    • the client had no test for the new route;
    • c on the Activity opened the Board's stacks out of sight;
    • the menu's focus hand-back could take the focus from a dialog it opened;
    • the drop-down picture script could leave the sandbox running.
  • By hand, in the sandbox on Hyprland: the arrows and h/j/k/l move between the cards, Shift+arrows change a card's stage, Tab switches tabs and Ctrl+. opens the card's menu.
  • Pictures were taken headless on Broadway (make screenshots), with the new source and stack scenes. The GTK pages have no unit tests. Their logic lives in settings.rs, which has tests, and the pages were checked through the pictures and the reviews.

Known limits, not addressed here:

  • The window writes to the paths the daemon names, on this machine, and the daemon listens on loopback only.
  • An editor save that lands in the milliseconds between Settings' last read and its rename is overwritten.
  • Removing GITHUB_TOKEN still leaves the gh auth token fallback.

Checklist

  • I updated documentation when behavior, configuration or installation changed. (README, docs/operations.md, docs/install.md, AGENTS.md, the window's DESIGN.md, config.example.toml, the changelog and the pictures.)
  • I added or updated focused tests for the change.
  • make ci-check passes locally.

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.
@brunoomariano
brunoomariano marked this pull request as ready for review November 12, 2026 20:01
@brunoomariano
brunoomariano merged commit cab3a29 into develop Nov 12, 2026
6 checks passed
@brunoomariano brunoomariano mentioned this pull request Nov 12, 2026
3 tasks done
@brunoomariano
brunoomariano deleted the feat/settings-config branch November 12, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant