Skip to content

feat(continue): resume reading and games on another device - #75

Open
MadhuS-1605 wants to merge 2 commits into
devudilip:mainfrom
MadhuS-1605:feat/continue-device
Open

MadhuS-1605 wants to merge 2 commits into
devudilip:mainfrom
MadhuS-1605:feat/continue-device

Conversation

@MadhuS-1605

@MadhuS-1605 MadhuS-1605 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Start on one device, carry on with another — no account, no server. A "Continue on another device" trigger on the reader, Padabandha, the daily word, and Collections builds a single progress snapshot and shows a QR code + link. The whole snapshot rides inside the URL hash (base64url JSON, ~36h self-expiry); nothing is uploaded and the daily-word answer is never included. Consistent with the site's offline-first, serverless design.

Closes: #21

What changed

  • blobCodec — encode/decode the progress blob for the URL hash, with version + expiry checks so an old or corrupt link fails cleanly. fitContinueUrl sheds optional parts (stars, then Padabandha) to keep the QR scannable, always keeping the reading position and the daily-word date/guesses.
  • buildProgress / applyProgress — read and write the same localStorage keys each feature already uses (reader progress, Padabandha grid, daily-word guesses, Favourites collection). No second save format.
  • loadWordGameState — replays a target-less carry-over record onto today's word instead of dropping it; normal local play is unaffected.
  • QrCode — inline SVG QR (pure qrcode-generator encoder, no canvas/network) with the Sirigannada mark knocked into the centre; error correction forced to "H" so the logo never breaks the scan.
  • /continue — landing page decodes the hash, applies progress into the features' own keys, then does a full-page redirect to the right screen (reading position wins, then games, then collections).
  • Entry points — labelled button on Padabandha / daily word / Collections; icon in the reader top bar.
  • Docs: README section (Kannada + English). .gitignore: ignore .claude-flow/. next.config.ts: removed stray dev-only cruft.

Testing

  • npm run typecheck — clean
  • npm test — 517 passing (66 files), including new blobCodec.test.ts and applyProgress.test.ts
  • npm run build — succeeds; /continue prerenders as static content

Start on one device, carry on with another — no account, no server. A
"Continue on another device" trigger on the reader, Padabandha, the daily
word, and Collections builds a single progress blob and shows a QR + link.
The whole snapshot rides inside the URL hash (base64url JSON, ~36h self
expiry); nothing is uploaded and the daily-word answer is never included.

- blobCodec: encode/decode with version + expiry checks, URL-size fitting
  that sheds stars then Padabandha while keeping the reading position
- buildProgress/applyProgress: read and write the same localStorage keys
  each feature already uses, so there is no second save format
- loadWordGameState replays a target-less carry-over onto today's word
- QR renders inline SVG with the Sirigannada mark, error correction "H"
- /continue landing page decodes, applies, and does a full-page redirect

Signed-off-by: MadhuS-1605 <madhusgowda56@gmail.com>
@devudilip devudilip added the preview Maintainer read the diff; mirror this fork PR to a preview/pr-N branch for a Cloudflare preview label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Preview (commit 0b357a5): https://preview-pr-75.sirigannada.pages.dev

Cloudflare needs a minute or two to build after each push. Test on a phone width. The branch preview/pr-75 is deleted automatically when this PR closes.

Signed-off-by: MadhuS-1605 <madhusgowda56@gmail.com>

# Conflicts:
#	src/components/icons/index.tsx
#	src/lib/i18n.ts
@MadhuS-1605

Copy link
Copy Markdown
Contributor Author

Merged main into this branch and resolved the conflicts (merge commit 0b357a5, DCO signed).

Conflicting files: src/components/icons/index.tsx and src/lib/i18n.ts — both trivial append-only unions:

  • icons/index.tsx — kept this branch's DevicesIcon alongside main's new BookOpenIcon/GamepadIcon/MenuIcon/ChevronDownIcon/PlayIcon/PauseIcon/SquareIcon.
  • i18n.ts — kept ...continueStrings alongside main's ...homeStrings/...moreStrings/...searchStrings/...contactStrings (imports auto-merged cleanly).

npm run typecheck clean, npm test 579 passing. All CI checks green; PR now shows mergeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Maintainer read the diff; mirror this fork PR to a preview/pr-N branch for a Cloudflare preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sync): continue reading and Padabandha on another device

2 participants