Skip to content

Add persistent working directory with restore-last-folder setting#18

Open
johnseth97 wants to merge 1 commit intolcoutodemos:mainfrom
johnseth97:feature/persistent-folder
Open

Add persistent working directory with restore-last-folder setting#18
johnseth97 wants to merge 1 commit intolcoutodemos:mainfrom
johnseth97:feature/persistent-folder

Conversation

@johnseth97
Copy link
Copy Markdown

Saves the last chosen folder to localStorage and restores it on startup:

  • useThemeStore gains useLastFolder (default true) — persisted to clui-settings
  • sessionStore gains loadLastSession/restoreLastSession helpers and calls persistLastSession whenever setBaseDirectory is invoked
  • StatusBar always shows the current folder name (previously showed '—' until the user explicitly chose a directory)
  • SettingsPopover gains a "Restore last folder" toggle in the settings panel
  • App.tsx calls restoreLastSession after the first tab is created

Includes renderer unit tests (theme.test.ts, sessionStore.test.ts) covering the new persistence behaviour, plus vitest infrastructure (vitest.config.ts, src/test/setup.ts).

Saves the last chosen folder to localStorage and restores it on startup:
- useThemeStore gains useLastFolder (default true) — persisted to clui-settings
- sessionStore gains loadLastSession/restoreLastSession helpers and calls
  persistLastSession whenever setBaseDirectory is invoked
- StatusBar always shows the current folder name (previously showed '—' until
  the user explicitly chose a directory)
- SettingsPopover gains a "Restore last folder" toggle in the settings panel
- App.tsx calls restoreLastSession after the first tab is created

Includes renderer unit tests (theme.test.ts, sessionStore.test.ts) covering
the new persistence behaviour, plus vitest infrastructure (vitest.config.ts,
src/test/setup.ts).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@johnseth97
Copy link
Copy Markdown
Author

As the chat history appears to be tied to the CWD, I thought it would be nice to have the option in settings to retain previous WD for those who are working with long-lived projects across multiple reboots!

Great job on this project by the way, best UI I've ever used for CC.

Image of setting option(other updates from my fork are shown, but have been broken out into separate PRs):

image

simonweniger pushed a commit to simonweniger/nusoma that referenced this pull request Mar 19, 2026
Preserve the last selected working directory across app restarts via
localStorage. Adds a "Restore last folder" toggle in Settings (default: on),
updates StatusBar to always show the current folder name, and includes
vitest infrastructure with 22 unit tests covering the new persistence logic.

Adapted from lcoutodemos/clui-cc#18 by johnseth97.

https://claude.ai/code/session_01CbUoguWWnvvqvbyDRARuyR
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