You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(platform): create platform adapter module
Adds src/lib/platform/ with typed adapter interfaces for dialogs,
clipboard, file-opener, window, and settings. Settings implementations
are moved here from settings-manager/; all sub-adapters have tauri.ts
and web.ts implementations assembled by createTauriPlatform() and
createWebPlatform() in create.ts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(platform): wire PlatformAdapter into entry point and settings store
- main.tsx: create platform via isTauri() check, wrap app in
PlatformProvider, pass platform.settings to settings store init
- settings store: init() now accepts a SettingsManager param; removes
module-level createSettingsManager() and isTauri() call; imports
updated to @/lib/platform/settings/types
- App.tsx: replace isTauri() guard with capabilities.supportsAutoUpdates,
replace setupAppWindow() with platform.window.showMainWindow()
- Delete src/lib/settings-manager/ (consolidated into platform/settings/)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(platform): migrate components and hooks to usePlatform()
- Books.tsx: replace openPath/revealItemInDir/clipboard imports with
platform.fileOpener and platform.clipboard via usePlatform()
- Sidebar.tsx: replace isTauri() guard with
capabilities.supportsAutoUpdates via usePlatform()
- use-hardcover-book-actions.ts: replace openPath import with
platform.fileOpener.openPath() via usePlatform()
- LibrarySelectModal.tsx: replace selectLibraryFolderDialog with
platform.dialogs.openDirectory() via usePlatform()
- firstTimeSetup.tsx: replace selectLibraryFolderDialog with
platform.dialogs.openDirectory() via usePlatform()
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(platform): lift dialog out of library store, delete dead code
- library store: remove dialogOpen import, replace promptToAddBook() with
listValidFileTypes() and getImportableBookMetadata(filePath) actions
so the store is a pure data layer
- Sidebar.tsx: orchestrate dialog in selectAndEditBookFile — calls
listValidFileTypes(), platform.dialogs.openFile(), then
getImportableBookMetadata() with the result
- library/index.ts: remove pickLibrary, commitAddBook, promptToAddBook
exports (now dead)
- Delete: _internal/addBook.ts, _internal/pickLibrary.ts,
lib/utils/library.ts, lib/path.ts (all unused)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(platform): resolve lint errors in platform adapter
- types.ts: use T[] array syntax instead of Array<T>
- dialogs/web.ts, file-opener/web.ts: remove unnecessary async keywords,
return Promise.resolve() directly to satisfy @typescript-eslint/require-await
- context.tsx → context.ts: rename to .ts since no JSX is used; avoids
react-refresh/only-export-components warning from mixing hook + component
exports in a .tsx file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(platform): enforce capabilities in UI and harden settings manager
Address code-review findings on the platform-adapter abstraction:
- Gate UI controls on platform capabilities instead of always rendering
them: Add Book (canPickLocalFiles), Read (canOpenLocalPaths), format
reveal (canRevealInFileManager), and copy (canCopyToClipboard). Removes
silent no-op buttons on web; Tauri behavior is unchanged.
- Web fileOpener.openPath now opens with "noopener,noreferrer" to prevent
reverse-tabnabbing on external URLs.
- Move the settings SettingsManager from an uninitialized module global
into zustand store state; persistSetting reads it via get() and throws a
clear error if used before init().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments