Skip to content

Desktop: Reader tabs, several papers open at once - #52

Merged
codevector-2003 merged 2 commits into
mainfrom
reader-tabs
Nov 24, 2026
Merged

codevector-2003 merged 2 commits into
mainfrom
reader-tabs

Conversation

@codevector-2003

Copy link
Copy Markdown
Owner

Several papers can now be open in the Reader at once, one tab each, after a Library tab that holds the side menu and every other screen.

What changes for the person using it

  • Read opens the paper in a new tab after the one in front, or goes to its tab if it is already open. The Papers list marks open papers "Open in a tab", and the button reads Go to tab.
  • Cited on this page opens a cited paper that has a PDF in a tab beside the one being read. One with no PDF is shown in Papers.
  • Each tab keeps its page, zoom, side panel and find words, and shows its page on the tab.
  • Tabs close, reopen, can be dragged into another order, close on a middle click, and have a right-click menu and a list of all tabs at the end of the strip.
  • Go menu: Next Tab (Ctrl+Tab), Previous Tab (Ctrl+Shift+Tab), Close Tab (Ctrl+W), Reopen Closed Tab (Ctrl+Shift+T). Next Tab is Ctrl+Tab on macOS too, because Cmd+Tab is the system's app switcher.
  • The Reader's ‹ Back button is gone; the Library tab is the way back.
  • Tabs come back. Closing and reopening the app restores them in order, at their pages. Each library keeps its own.

How it is built

  • store: Meta / SetMeta on the existing meta table. No schema change. SetMeta refuses to touch schema_version.
  • library: ReaderTabs / SaveReaderTabs.
    • Reading leaves out papers that were deleted or have no PDF, and forgets a stored value it cannot parse.
    • Saving checks the fil IDs, caps at 50 tabs, keeps one tab per paper, and tidies page, zoom and side.
    • HasPDF is exported for the cited-on-this-page flag.
  • ui: GET / POST /api/tabs, with the body capped at 64 KB. The front door calls only library.
  • The page saves a second after a change, and at once before the app quits or the library switches. Saving is frozen during a switch, so a late save can't land in the next library.
  • Only the four tabs seen last keep their PDF.js document open. Older tabs reopen theirs at the same page.

Checked

  • New tests: store (TestMeta), library (save and restore, deleted papers, bad input, unreadable value), ui (the handler). go vet and every package's tests pass.
  • Live in the Windows desktop app, on a scratch library:
    • Ctrl+Tab, Ctrl+Shift+Tab, Ctrl+W and Ctrl+Shift+T sent as real key presses all reach the page inside WebView2;
    • opening, switching, dragging and middle-click all work;
    • "Cited on this page" opens a tab beside the paper;
    • closing with the window button and reopening restored the tabs;
    • switching to another library and back kept each library's tabs separate.
  • Not tested on macOS or Linux.

The desktop-app docs page on the website gets the new keys. The rebuilt pages carry today's date, as the site builder always stamps.

The Reader keeps one tab per paper, after a Library tab that holds the side
menu and every other screen. Read opens a paper in a tab after the one in
front, or goes to its tab; a citation on the page opens beside the paper it
is cited in. Each tab keeps its page, zoom, side panel and find words. Tabs
close, reopen, reorder by dragging, close on a middle click, and have a
right-click menu and a list of them all. Only the four tabs seen last keep
their PDF open.

Next Tab, Previous Tab, Close Tab and Reopen Closed Tab are in the Go menu:
Ctrl+Tab on every system, as Cmd+Tab is the Mac's app switcher, Ctrl+W and
Ctrl+Shift+T. The Reader's Back button goes; the Library tab is the way back.

The tabs are kept in the library's meta table as JSON, with no schema
change, so a library opened again shows its own papers where they were
left. Reading them back leaves out papers deleted since or with no PDF.
The page saves a second after a change, and at once before the app closes
or the library changes, never after.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T12:23:51.608418Z 66475f8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66475f8f33

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/ui/assets/tabs.js Resolved
With no paper tab in front, the app opened on Papers while the Library tab
named the screen kept, Search say. Show that screen.
@codevector-2003
codevector-2003 merged commit 265e1db into main Nov 24, 2026
7 checks passed
@codevector-2003
codevector-2003 deleted the reader-tabs branch November 24, 2026 12:34
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