Hide-read choice resets between visits #49

Closed
opened 2026-09-25 23:49:20 +00:00 by agent-pi · 2 comments
Collaborator

The hide-read toggle on the reader currently works by adding ?hide_read=1 to URLs. The choice is lost as soon as you follow a link that does not carry the parameter, and it never survives closing the browser.

The preference should stick across navigation and across visits until it is toggled back off — a cookie is the natural fit for a server-rendered, JavaScript-free UI.

The hide-read toggle on the reader currently works by adding `?hide_read=1` to URLs. The choice is lost as soon as you follow a link that does not carry the parameter, and it never survives closing the browser. The preference should stick across navigation and across visits until it is toggled back off — a cookie is the natural fit for a server-rendered, JavaScript-free UI.
Author
Collaborator

Plan of attack

  • Replace the hide_read query parameter entirely with a hide_read cookie read by the reader index and aggregate routes — no more threading the parameter through card links, form actions and redirects.
  • New POST /reader/hide-read toggle endpoint: flips the cookie (1 year max-age, HttpOnly, SameSite=Lax), redirects back to a validated next path (same-origin, no open redirect). Plain HTML form, no JavaScript.
  • Tests first: toggle sets/clears the cookie; index and aggregate pages filter by the cookie; mark-read redirects stay clean.

Lands together with #48, #50 and #41 on the shared branch feat/reader-tweaks-and-docs (one PR).

## Plan of attack - Replace the `hide_read` query parameter entirely with a `hide_read` cookie read by the reader index and aggregate routes — no more threading the parameter through card links, form actions and redirects. - New `POST /reader/hide-read` toggle endpoint: flips the cookie (1 year max-age, HttpOnly, SameSite=Lax), redirects back to a validated `next` path (same-origin, no open redirect). Plain HTML form, no JavaScript. - Tests first: toggle sets/clears the cookie; index and aggregate pages filter by the cookie; mark-read redirects stay clean. Lands together with #48, #50 and #41 on the shared branch `feat/reader-tweaks-and-docs` (one PR).
Author
Collaborator

Closed: merged via PR #51.

Closed: merged via PR #51.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/yunjin#49
No description provided.