Skip to content

Persist entry list view mode and dictionary preview pin per project#2284

Merged
myieye merged 4 commits into
developfrom
claude/persist-list-view-mode-6E89l
May 22, 2026
Merged

Persist entry list view mode and dictionary preview pin per project#2284
myieye merged 4 commits into
developfrom
claude/persist-list-view-mode-6E89l

Conversation

@myieye
Copy link
Copy Markdown
Collaborator

@myieye myieye commented May 21, 2026

Summary

  • Persists the entry list view mode (simple / preview) per project so it survives reloads.
  • Persists the dictionary preview state (show / hide / sticky) per project, including the pin toggle.
  • Both use the existing ProjectStorage infrastructure (project-scoped localStorage via IPreferencesService).

Implementation

  • Added entryListViewMode and dictionaryPreview props to ProjectStorage.
  • In BrowseView.svelte and EntryView.svelte, the preference is read via $derived from the storage prop's reactive current, with a fallback default and type guard. Writes go through Svelte 5's function-pair bind:foo={getter, setter} syntax — no effects or init flags needed.

Test plan

  • Open a project, switch entry list to Preview, reload — list still in Preview.
  • Pin the dictionary preview, reload — still pinned.
  • Toggle dictionary preview to Hide, reload — still hidden.
  • Verify a different project keeps its own setting independently.

https://claude.ai/code/session_01XwVXy1GdK7kKAbbfhxKTp2


Generated by Claude Code

claude added 3 commits May 20, 2026 15:14
…ject

Stores entryListViewMode (simple/preview) and dictionaryPreview (show/hide/sticky)
in project-scoped localStorage so they survive page refreshes.

https://claude.ai/code/session_01XwVXy1GdK7kKAbbfhxKTp2
Use single $effect with untrack for one-time init from storage,
matching the pattern in TasksView. Non-reactive loaded flag prevents
persisting before the stored value has been read.

https://claude.ai/code/session_01XwVXy1GdK7kKAbbfhxKTp2
Read the preference directly via $derived from storage, and pass the
setter through Svelte 5's bind:foo={getter, setter} syntax. Removes
the init effect, persist effect, and loaded flag.

https://claude.ai/code/session_01XwVXy1GdK7kKAbbfhxKTp2
@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

UI unit Tests

  1 files  ±0   59 suites  ±0   30s ⏱️ +2s
176 tests ±0  176 ✅ ±0  0 💤 ±0  0 ❌ ±0 
245 runs  ±0  245 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 9af8c01. ± Comparison against base commit e362dd4.

♻️ This comment has been updated with latest results.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 800c7df9-fd52-4ed3-a333-3ae0de2520d1

📥 Commits

Reviewing files that changed from the base of the PR and between e362dd4 and 9af8c01.

📒 Files selected for processing (3)
  • frontend/viewer/src/lib/storage/project-storage.svelte.ts
  • frontend/viewer/src/project/browse/BrowseView.svelte
  • frontend/viewer/src/project/browse/EntryView.svelte

📝 Walkthrough

Walkthrough

This PR migrates two UI preferences from local component state to project-scoped persistent storage. New StorageProp fields are added to ProjectStorage, and BrowseView/EntryView components are updated to read and write these persisted preferences instead of managing local state.

Changes

Persist UI preferences to project storage

Layer / File(s) Summary
ProjectStorage contract extension
frontend/viewer/src/lib/storage/project-storage.svelte.ts
ProjectStorage adds entryListViewMode and dictionaryPreview as new readonly StorageProp fields, initialized in the constructor with project-scoped keys.
BrowseView entry mode persistence
frontend/viewer/src/project/browse/BrowseView.svelte
BrowseView derives entryMode from persisted entryListViewMode instead of local state and updates the EntryListViewOptions binding to propagate changes back to storage via entryListViewMode.set().
EntryView dictionary preview persistence
frontend/viewer/src/project/browse/EntryView.svelte
EntryView derives dictionaryPreview from persisted storage with validation, and updates the pin Toggle and ViewPicker bindings to read from and write back to dictionaryPreviewStorage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • sillsdev/languageforge-lexbox#2190: Established the ProjectStorage and StorageProp infrastructure that this PR extends by adding new persisted fields and integrating them into view components.

Suggested reviewers

  • rmunn
  • imnasnainaec

Poem

🐰 A pair of views found their UI dreams come true,
Stored safe in project vaults, persistent through and through.
Entry modes and preview peeks, now remembered with care,
The storage rabbit hops along, dancing through the air! 🌟

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/persist-list-view-mode-6E89l

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 21, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - May 22, 2026, 12:43 PM

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

C# Unit Tests

165 tests   165 ✅  19s ⏱️
 23 suites    0 💤
  1 files      0 ❌

Results for commit 9af8c01.

♻️ This comment has been updated with latest results.

Inline storage.set() at call sites — matches the pattern already used
for entryListViewMode in BrowseView.

https://claude.ai/code/session_01XwVXy1GdK7kKAbbfhxKTp2
@myieye myieye marked this pull request as ready for review May 22, 2026 13:25
@myieye myieye merged commit 7e2a20d into develop May 22, 2026
26 of 27 checks passed
@myieye myieye deleted the claude/persist-list-view-mode-6E89l branch May 22, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants