feat(home): persist per-column Notes vs Notes-and-replies tab choice#3
Merged
Conversation
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>
Deploying jank with
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (matchesDEFAULT_FEED_TABSids).HomeColumnBodynow receives itscolumn, seeds the feed fromcolumn.config.feedTab, and persists the user's switch viaupdateColumnConfig— localStorage immediately, riding the deck's NIP-78 sync on the next deck save. The deck-sync codec already carriesconfigwholesale, 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.NormalFeedgains optionalinitialTabId/onTabChangeprops. 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
NormalFeedconsumers (Relay, Search) are unchanged. Existing decks with nofeedTabopen on Notes exactly as before.Tests
resolveInitialTabIdboundary cases: default / honored / stale / empty.deck-sync-codecround-trip provingfeedTabsurvives the NIP-78 wire format.npm run buildclean. eslint clean.🤖 Generated with Claude Code