Skip to content

B87: saved copies of trail pages - #71

Merged
westernCasa merged 1 commit into
mainfrom
feat/saved-copies
Nov 8, 2026
Merged

westernCasa merged 1 commit into
mainfrom
feat/saved-copies

Conversation

@westernCasa

Copy link
Copy Markdown
Owner

B87. Saved copies of trail pages: offered, never forced, kept on your computer, checked by SHA-256.

Saving (your choice: button + trail setting)

  • Save a Copy of This Page: File menu, or right-click a page.
  • Save a copy: on a selected page card. With no tab open, the page loads in a hidden window first.
  • Keep copies: Off / On: in a trail's … menu in the switcher, off by default. When on, each page that becomes a card in that trail gets a copy.
  • The page becomes a card if it wasn't one.
  • Saving again when the page's text hasn't changed keeps the one copy and says so.
  • Never: sign-in, account and payment pages (B66), private tabs, opened (read-only) trails.

The copy (your choice: MHTML + text)

  • One MHTML file named by its SHA-256, plus its readable text beside it, in NODE's data folder.
  • MHTML files differ on every save (their date and part boundaries), so "unchanged" is decided by the page's text, not the hash.
  • Copy files that no trail names any more are deleted at start-up, after deleted trails are purged (B115).

On the card (your choice: card mark + send when ticked)

  • "Copy · 8 Nov 10:05", plus "· 2 copies" when there are more. The SHA-256 is in its tooltip.
  • Click it to open the copy in a tab. NODE checks the SHA-256 first; a copy that changed is not opened.

Sharing

  • Trail files list each copy: Copy: 8 Nov 2026 10:05 · SHA-256 ….
  • The copies themselves go only when Saved copies of pages is ticked in the share sheet: as files in a folder " copies" beside the trail file, linked from it (doc 26).
  • Opening such a file keeps each copy whose SHA-256 matches. One that doesn't is marked changed ("· 1 changed" on the card) and never opened.

Code

  • core/trail.js: addCopy, copyHashes, setKeepCopies, event copied, keepCopies in list(). core/trail-file.js: the Copy lines and the copies option.
  • main.js: saveCopyOf, copyTab, copyUrl, openCopy, cleanCopies, takeCopies; channels trail:copy-save, trail:copy-open, trail:keep-copies; share save with copies; menu items.
  • renderer/canvas.js, app.js, index.html, styles.css: card line, selection bar button, Keep copies chip, share sheet choice. Tokens only.

Not in this PR: the Chromium build; search past trails (B89) doesn't read the copies' text yet.

Tests

  • test/copies-demo.js (npm run test:copies, in test:unit): 4 checks.
  • New test/e2e/53-saved-copies.js (20 checks), in both CI e2e lists.
  • Locally: test:unit, and e2e 27, 33, 36, 38, 42, 43, 44, 49, 51 and 52 still pass.

Generated by Claude Code

Save a Copy of This Page (File menu, right-click) and Save a copy on a page
card save the page as an MHTML file named by its SHA-256, with its text, on
this computer. Keep copies in a trail's menu saves one for each page that
becomes a card. The card shows the newest copy and opens it after checking
its hash. Trail files list copies; they are sent only when ticked, in a
folder beside the file, and checked when the file is opened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011V7Bv7WZ9Q92MZoNWYwevQ
@westernCasa
westernCasa merged commit 7a736a8 into main Nov 8, 2026
3 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