Skip to content

Auto-activate annotation groups and files in the full-screen TUI viewer - #222

Open
bobvh wants to merge 2 commits into
mainfrom
annotation-viewer-auto-activate
Open

Auto-activate annotation groups and files in the full-screen TUI viewer#222
bobvh wants to merge 2 commits into
mainfrom
annotation-viewer-auto-activate

Conversation

@bobvh

@bobvh bobvh commented Jul 29, 2026

Copy link
Copy Markdown
Member

Split out of #221. During that demo we also noticed the full-screen TUI viewer required manually toggling on annotation files every time, unlike the Jupyter and inline widgets where groups and files both auto-load.

  • DB-derived annotation groups already auto-activated on load; files now do too, sharing an activate_annotation_file helper with the checkbox toggle handlers. A file that fails to resolve is skipped instead of blocking the rest.
  • That surfaced a stale-frame redraw delay (auto-activation runs after the frame draws, so it could sit for up to an hour before the next input event redrew it) — now redraws immediately when activation did work.
  • Fixes a related sidebar bug: force_reload() was resetting the list selection to the top on every annotation-group change (which happens on nearly every block group switch). It now re-finds the row for the current selection instead.

bobvh and others added 2 commits July 29, 2026 16:52
DB-derived annotation groups already auto-activated on load; annotation
files required an explicit checkbox toggle every time, unlike the
Jupyter and inline widgets where both auto-load. Extract
activate_annotation_file, shared by the toggle handlers and a new
auto_activate_annotation_files_for_viewport pass that activates every
resolvable file, skipping ones that fail to load instead of blocking
the rest. Both groups and files clear and re-activate fresh on block
group switch.

Auto-activation runs after the frame has already drawn, so the
checkboxes and canvas from that frame are stale. The render loop then
blocked on input for up to an hour before redrawing. Track whether
activation did work this iteration and use a zero-length poll wait in
that case so the change is visible immediately.
force_reload() always reset list_state and picked the first selectable
item, discarding the current selection whenever annotation groups
changed (which happens on nearly every block group switch). It now
re-finds the row for the newly selected block group instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QzZ6H1MBUhwFzu4mMgkTBZ
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