Skip to content

feat(website): tell returning visitors what is new (features and dictionaries) - #66

Merged
forzagreen merged 1 commit into
mainfrom
feat/website-whats-new
Oct 16, 2026
Merged

forzagreen merged 1 commit into
mainfrom
feat/website-whats-new

Conversation

@forzagreen

Copy link
Copy Markdown
Owner

What

A «الجديد» (what's new) button in the site header, with a panel that opens by itself once when there is news the visitor's browser has not seen, and can be reopened from the button at any time. Closing it (✕, Esc, or a click anywhere else) marks the news as seen. "Seen" lives in localStorage like the theme: nothing is sent anywhere.

Two kinds of news:

  • Dictionaries added since the last visit — detected automatically from the dictionary ids built into every page (getDictionaryIndex() in db.ts, one cheap query cached per build, ~1 KB per page), so a new dictionary announces itself on the next deploy with no code change.
  • Features — the hand-written FEATURES list in website/src/lib/whatsNew.ts, meant for what a non-technical reader notices (never dependency / build changes). The first entry is the page links to the archive.org scans (feat: link page numbers to the paper dictionaries' scans on archive.org #65), with a small CSS animation of a pointer clicking the page number in the term table and the scanned page opening underneath. No video asset: it follows the theme, weighs nothing, and shows a still end state under prefers-reduced-motion.

A first visit records the state silently — everything is new to a first-time visitor, so the panel would only be noise.

Same mechanism as forzagreen/wikitermbase#122, with this site's own list and wording (قاموس, not معجم).

How to add a feature later

Append an entry to FEATURES in website/src/lib/whatsNew.ts: a stable id, a date, a title and a sentence in plain Arabic, optionally media. Prune entries after a few months. Documented in CLAUDE.md.

Tested

npm run build (700 pages, 1 m 17 s, same as before) and headless Chromium against astro preview: first visit (no panel, state recorded), returning visitor with 5 new dictionaries + the feature (panel opens, Esc closes it, state updated, dot gone), a dictionary page in dark mode, manual reopen, desktop/phone (bottom sheet). Unrelated and pre-existing: the home page overflows horizontally on a 390 px phone because of the dictionary table.

A «الجديد» button in the header with a panel that opens by itself when
there is news the browser has not seen yet, and closes into
localStorage (nothing is sent anywhere). Two kinds of news:

- dictionaries added since the last visit, detected from the
  dictionary ids built into every page (getDictionaryIndex(), one
  cheap query per build), so a new dictionary announces itself on the
  next deploy;
- features, from the hand-written FEATURES list in src/lib/whatsNew.ts,
  meant for what a non-technical reader notices. The first entry is
  the page links to the archive.org scans, with a small CSS animation
  of a click on the page number opening the scanned page.

A first visit records the state silently: everything is new to a
first-time visitor. The button reopens the whole list at any time.
Same mechanism as the one added to wikitermbase, with its own list.
@forzagreen
forzagreen merged commit ccbf902 into main Oct 16, 2026
@forzagreen
forzagreen deleted the feat/website-whats-new branch October 16, 2026 15:17
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