Skip to content

Elements dialog (F7): add Tables and Lists views - #800

Merged
trypsynth merged 2 commits into
trypsynth:masterfrom
dan1982code:elements-tables-lists
Sep 7, 2026
Merged

Elements dialog (F7): add Tables and Lists views#800
trypsynth merged 2 commits into
trypsynth:masterfrom
dan1982code:elements-tables-lists

Conversation

@dan1982code

Copy link
Copy Markdown
Contributor

Elements dialog (F7): add Tables and Lists views

Follow-up to the Pages-view work (#775). The Elements dialog's View dropdown now offers
Headings / Links / Pages / Tables / Lists. The two new views each show one row per
Table / List marker in the document — the same containers that Go → Next/Previous Table and
Next/Previous List already jump between.

Behavior

  • A Tables row shows the table's caption — the text the table's first row reads, as next/previous
    Table navigation announces it (or, for a table with no caption, the line it sits on).
  • A Lists row shows the list's first rendered item — exactly what next/previous List navigation
    announces (List markers carry no text of their own).
  • No numbering: rows read like the Links view and like container navigation, so what you pick in
    the list and what you hear when you land match.
  • Choosing a row (double-click or OK on the selection) jumps to the container and announces the
    landing line, like the Links/Headings views already do — no change to ElementsKind, the
    announcement code, or navigation.rs.

What changed

  • paperback-core — new DocumentSession::element_list(mtype, position), returning one row
    per marker of a type with the text reading navigation announces, plus the row nearest the
    current position so the dialog can preselect it. link_list is now a thin wrapper over it.
    New ElementListItem/ElementList types and unit tests cover captions, the line-text
    fallback, closest-index tracking, and that ListItem markers don't leak into the Lists view.
  • paperbackTables and Lists entries in the View dropdown on both the Windows and the
    macOS/Linux (DataView) code paths. The two Rc<FlatView> arguments threaded through the
    toggle/double-click/OK handlers are grouped into a single FlatViews struct keyed by view, so
    a future flat view stays a one-entry change (the pattern the Pages view set up).

Two new translatable strings: "Tables" and "Lists" (they'll reach the translators through
the usual auto-translate workflow).

Testing

  • Confirmed working on Windows (release build) with PDFs — tables and lists appear in the
    Elements dialog and jumps land correctly.
  • cargo test -p paperback-core (663 tests) and cargo clippy pass.
  • The macOS/Linux DataView half is edited symmetrically but was not compiled or run on this
    machine (Windows host) — it needs a check there before relying on it.

dan1982code and others added 2 commits September 6, 2026 11:57
The Elements dialog (F7) View dropdown now offers Tables and Lists next
to Headings, Links and Pages. Each view lists one row per Table or List
marker - the same containers next/previous Table and List navigation
visit - reading as the reader announces them (a table's caption, a list's
first rendered item), so what you pick in the list is what you hear when
you land.

The flat list pane was keyed by view through per-view arguments; it now
routes through a single FlatViews struct, so a future flat view is one
dropdown entry plus one field. A new DocumentSession::element_list feeds
the marker views and link_list is now a thin wrapper over it.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Formatting change only, so the nightly format check (group_imports /
imports_granularity) passes.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@trypsynth
trypsynth merged commit 8476ea5 into trypsynth:master Sep 7, 2026
12 checks passed
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.

2 participants