Skip to content

feat(home): persist per-column Notes vs Notes-and-replies tab choice#3

Merged
DocNR merged 1 commit into
mainfrom
feat/home-default-feed-tab
Jun 13, 2026
Merged

feat(home): persist per-column Notes vs Notes-and-replies tab choice#3
DocNR merged 1 commit into
mainfrom
feat/home-default-feed-tab

Conversation

@DocNR

@DocNR DocNR commented Jun 13, 2026

Copy link
Copy Markdown
Owner

What

The Home column's feed tab (Notes / Notes and replies) was ephemeral component state in NormalFeed — it defaulted to Notes on every mount and forgot the user's choice on reload. This makes the choice persist per-column: pick "Notes and replies" once and that Home column reopens there across reloads, and the preference follows the account's deck across devices via the existing NIP-78 deck sync.

How

  • TColumnConfig.feedTab?: 'posts' | 'postsAndReplies' — new optional config field (matches DEFAULT_FEED_TABS ids).
  • HomeColumnBody now receives its column, seeds the feed from column.config.feedTab, and persists the user's switch via updateColumnConfig — localStorage immediately, riding the deck's NIP-78 sync on the next deck save. The deck-sync codec already carries config wholesale, so no codec or migrator change is needed.
  • resolveInitialTabId (new pure helper) — picks the persisted tab when it matches a visible tab, else falls back to Notes (today's default). Tolerates a stale/unknown persisted value.
  • NormalFeed gains optional initialTabId / onTabChange props. Only the Home column wires them — Relay / Search / Hashtag feeds keep the hardcoded "Notes" default.

Scope

5 wiring files + 1 type + 1 new helper. Other NormalFeed consumers (Relay, Search) are unchanged. Existing decks with no feedTab open on Notes exactly as before.

Tests

  • resolveInitialTabId boundary cases: default / honored / stale / empty.
  • deck-sync-codec round-trip proving feedTab survives the NIP-78 wire format.
  • Full suite: 834 passed, 1 skipped. npm run build clean. eslint clean.

🤖 Generated with Claude Code

The Home column's feed tab ("Notes" / "Notes and replies") was local
component state in NormalFeed, defaulting to "Notes" on every mount and
forgetting the user's choice across reloads.

Add an optional `feedTab` to TColumnConfig. HomeColumnBody now seeds the
feed from `column.config.feedTab` and persists the user's choice back via
updateColumnConfig — localStorage immediately, riding the deck's existing
NIP-78 sync on the next deck save (config is carried wholesale by the
deck-sync codec, so no codec/migrator change is needed). Absent or stale
config falls back to "Notes", today's default, via the new pure
resolveInitialTabId helper.

NormalFeed gains optional `initialTabId` / `onTabChange` props; only the
Home column wires them, so Relay / Search / Hashtag feeds keep the
hardcoded "Notes" default. Per-column means one Home can show Notes while
another shows Notes-and-replies, and the choice follows the account's deck
across devices.

Tests: resolveInitialTabId boundary cases (default, honored, stale, empty)
and a deck-sync-codec round-trip proving feedTab survives the wire format.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying jank with  Cloudflare Pages  Cloudflare Pages

Latest commit: dbdc468
Status: ✅  Deploy successful!
Preview URL: https://d0d8f2d0.jank-4ii.pages.dev
Branch Preview URL: https://feat-home-default-feed-tab.jank-4ii.pages.dev

View logs

@DocNR DocNR merged commit 6f92275 into main Jun 13, 2026
2 checks passed
DocNR added a commit that referenced this pull request Jun 13, 2026
Arms the in-app "What's new" dialog for the Home column Notes /
Notes-and-replies tab persistence shipped in #3 (6f92275). Optional +
fail-silent per the release-notes ritual; bumps package.json to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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