Skip to content

feat(native): wire Browser settings defaults & profiles for server-streamed preview (ST-BROWSER, PN-PREVIEW) - #460

Merged
rynfar merged 1 commit into
nativefrom
feat/native-browser-preview-defaults
Nov 20, 2026
Merged

rynfar merged 1 commit into
nativefrom
feat/native-browser-preview-defaults

Conversation

@rynfar

@rynfar rynfar commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Part of #99
Part of #249

Summary

Wires real ST-BROWSER settings controls for server-streamed preview defaults and profiles, verifies live PN-PREVIEW consumption across new tabs, closed-tab fallbacks, and the device toolbar, and flips ST-BROWSER and PN-PREVIEW to done in apps/native/parity/LEDGER.md.

Changes

  1. Core settings & preview viewport helpers (crates/core/src/{client_settings.rs, preview.rs, preview/viewport.rs, settings/search.rs}):
    • Added ClientSettingChange variants, validation/sanitization, getters, and round-trip JSON persistence for browserDefaultViewport, browserDefaultZoomFactor, browserDefaultAppearance, browserProfiles (max 24, persistent-forced, built-in/duplicate/control-char filtered), and browserDefaultProfileId (incognito rejected back to "default"), matching packages/contracts/src/{settings.ts, preview.ts, browserProfile.ts} and BrowserDefaults.
    • Added method::REPORT_PROFILES (preview.reportProfiles), normalize_zoom_level, zoom_label, viewport_select_value, next_unique_profile_name, and report_profiles_payload.
    • Added unit tests in client_settings/tests.rs, preview/viewport.rs, and settings/search.rs.
  2. Interactive ST-BROWSER settings UI (crates/app/src/settings/diffs_browser.rs):
    • Replaced unavailable(...) stubs under Browser Settings for Browser profiles (list persistent profiles, add blank profile up to 24, inline rename, set default + reset, preview.clearProfile clear cookies/cache and remove), Default browser viewport (Fill panel, Responsive, 17 Chrome DevTools presets, custom width × height inputs with bounds validation, rotate button, reset), Default browser zoom (17 zoom steps + reset), and Default browser appearance (System / Light / Dark + reset), all with localized crate::i18n::t(cx, ...) / t_fmt(cx, ...) labels.
    • Kept Electron-only controls (desktop browser cookie import, auto-show floating preview, WebView recordings) clearly marked as Electron-only N/A.
  3. Live PN-PREVIEW consumption & i18n (crates/app/src/preview/{mod.rs, pane.rs, tests.rs}):
    • Wired Previews::report_profiles_if_needed (deduplicated per connection on server-browser readiness, grant changes, and Settings profile edits).
    • Localized remaining preview empty-state / More menu / profile badge strings via crate::i18n::t(cx, ...).
    • Added offscreen GPUI tests proving Settings updates flow live into Previews::browser_defaults(cx), preview.open payloads, AppState::reopen_closed_view closed-tab fallbacks, PreviewPane::toggle_device_toolbar, and deduplicated preview.reportProfiles calls, plus a SettingsView Browser page GPUI render test.
  4. Ledger (apps/native/parity/LEDGER.md):
    • Updated PN-PREVIEW (partial | #249 -> done |) and ST-BROWSER (partial | #99 -> done |) only, documenting Electron-only N/A items honestly.

Verification

  • CARGO_INCREMENTAL=0 cargo clippy --manifest-path apps/native/Cargo.toml --workspace --all-targets -- -D warnings: pass (0 warnings)
  • CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-core: 1,858 unit + 8 conformance passed, 0 failed
  • CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-client -- --test-threads=4: 163 passed, 0 failed
  • CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-native -- --test-threads=1 (isolated T3_NATIVE_HOME): 209 passed, 0 failed
  • CARGO_INCREMENTAL=0 cargo test --manifest-path apps/native/Cargo.toml -p t3-native --features snapshot -- --test-threads=1 preview::tests diffs_browser settings::general::tests (isolated T3_NATIVE_HOME): 19 passed, 0 failed
  • CARGO_INCREMENTAL=0 cargo build --manifest-path apps/native/Cargo.toml -p t3-native: pass
  • vp fmt --check apps/native/parity/LEDGER.md: pass
  • node apps/native/scripts/gen-theme.ts --check: pass
  • node apps/native/conformance/generate.ts --check: pass
  • node --test apps/native/parity/sync.test.ts: 47 passed, 0 failed

Generated by Antigravity (h1-browser-preview).

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