feat: mobile adaptations for options and import/export (#293) #342
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"238901fb08e529cda9d4629aeb956ee4806bd9bc","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-27T04:43:00.147487Z">2026-11-27T04:43:00.147487Z</relative-time> | 238901f | PR opened |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
</details>
<sub><sub>!P1 Badge</sub></sub> Save options under the newly selected provider
When the provider is changed while Options is open, this updates only draft.provider; draft.providerOptions remains the bag for the provider that was active when the dialog opened. Moreover, onChangeOptions comes from useLLMSettings and still closes over that old provider when Done invokes it immediately after onChange, so, for example, selecting OpenAI from Gemini and entering an OpenAI key writes that key into Gemini's options while activating an unconfigured OpenAI provider. Keep drafts keyed by provider or otherwise ensure the selected provider's options are loaded and persisted under that provider.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Prevent Reset from restoring a cleared API key
If a user clicks Clear, clearApiKey immediately persists an empty key and marks providerOptions dirty, which prevents the subsequent prop update from replacing the original key retained in openValues. Clicking Reset then copies that original key back into the draft, and Done persists it again, so the Clear → Reset → Done sequence resurrects a credential that was documented as cleared immediately. Update the reset snapshot when clearing or otherwise exclude the removed key from restoration.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- codex-code-review-finding:v1 -->
💡 Codex Review
https://github.com/true-line/bookmarkit/blob/238901fb08e529cda9d4629aeb956ee4806bd9bc/src/components/OptionsModal.jsx#L404-L412
<sub><sub>!P2 Badge</sub></sub> Refresh models when the draft provider changes
The model-loading effect depends on the persisted provider prop rather than draft.provider, so changing only the provider selector does not trigger discovery when the key and base URL stay equal. This occurs reliably when switching between default Ollama and LM Studio configurations, where both draft values are empty: the previous provider's model list remains displayed and no request reaches the new endpoint until the user manually presses Refresh. Depend on draft.provider and clear stale results when it changes.
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
</details>
Fixed in afcdb2fe52874cdfecc8f47b02821fed57ddf3b4.
Fixed in afcdb2f: updateProviderOptions(changes, forProvider) now writes the patch under the named provider (falling back to the active one for existing callers), and the options dialog stages a provider switch wholesale — the provider select seeds the draft's options from allProviderOptions[nextProvider] (new prop, wired from the hook's keyed options map) and commitDraft passes draft.provider as the target, so the switch and its patch land in one breath under the chosen provider. Covered by new tests in OptionsModal.test.jsx ("seeds the staged options from the chosen provider and commits under it") and useLLMSettings.test.jsx ("writes a named provider's options under that provider, not the active one").
<!-- agent-bot-write: ghw_5ebe89cb7ff39e91 session=ba9070074325 bot=trueline-zcode-agent[bot] -->
Fixed in afcdb2fe52874cdfecc8f47b02821fed57ddf3b4.
Fixed in afcdb2f: clearApiKey now also clears apiKey in the at-open snapshot (openValues), guarded so it only applies when the snapshot still matches the staged provider. Since providerOptions is marked dirty by then, the source-sync effect can't reach the snapshot itself — without this, Reset restored the pre-Clear key and Done re-persisted it. Covered by the new test "does not resurrect a cleared key at Reset and Done".
<!-- agent-bot-write: ghw_5ebe89cb7ff39e91 session=ba9070074325 bot=trueline-zcode-agent[bot] -->
Approved these changes.
qwts
trueline-zcode-agent[bot]
Closes #293.
What
The two mobile-adaptation mockups, applied:
updateProviderOptionsstill merges,setLocalestill persists) and closes; Reset restores the at-open snapshot; every other exit — close, Escape, the sheet's back arrow — discards. The dialog footer says so: "Changes apply when you choose Done." Keys the user has not touched keep following their source (the stored locale loads a tick after open), touched keys belong to the draft alone until Reset. Actions stay immediate: theme upload, the encryption/unlock operations, and the destructive key Clear (which now also clears the staged field, so Done cannot resurrect what Clear removed).lgboth dialogs become the mockups' full-page sheets (#300's composition): a back bar ("Back to bookmarks") over the same body. Options carries the sticky Reset / Done footer and runs the provider row full width (.ui-sheet--options .ui-options-grid); Import & Export draws no footer (the mobile mockup has none) and names the library's size in the app bar, keeping #287's tabbed body. At dialog widths nothing changes — the existing panel cap already keeps both inside the viewport (the issue's acceptance)..ui-settings-row, the coarse-pointer floor from #291.Notes
ImportExportContent.jsxsat at the lint's line ceiling (449 code lines vs 400) once it gained the sheet twin, so the export tab moved out asExportPanel.jsx— the twin ofImportPanel.jsx— and the sheet chrome becameImportExportSheet.jsx(theDigestSheetpattern). UX-03's memoization moved with the export tab and now computes only while that tab is mounted.BackIconjoined the sharedicons.jsxset; the options modal imports it instead of its local copy (the older sheet twins still carry theirs — untouched here).installViewport, the BookmarkForm convention): the historical suites stay on the dialog, new suites cover the draft model (stage / Done / Reset / Escape-discard), the options sheet, and the IO sheet. Full suite 1358 green;npm run cigreen on the landed tree.bookmarkit_mobile_options_settings167–291,bookmarkit_mobile_import_export167–233.<!-- agent-bot-write: ghw_4067c6742a7b8a94 session=ba9070074325 bot=trueline-zcode-agent[bot] -->