mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
feat(sessions): TUI-style session picker with scope toggle and delete
This commit is contained in:
1 parent
f13463f82a
commit
85288d6393
13 files changed
+1189
-292
No files matched your search
@@ -31,7 +31,11 @@ function readStoredBoolean(key: string, fallback: boolean): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
function usePersistentBoolean(key: string, fallback: boolean): [boolean, () => void] {
|
||||
/**
|
||||
* Persists a boolean preference under `key` in localStorage and returns it with a toggler.
|
||||
* Falls back to `fallback` when the stored value is missing or malformed.
|
||||
*/
|
||||
export function usePersistentBoolean(key: string, fallback: boolean): [boolean, () => void] {
|
||||
const [value, setValue] = useState(() => readStoredBoolean(key, fallback))
|
||||
|
||||
const toggle = useCallback(() => {
|
||||
|
||||
Reference in new issue
Block a user