Skip to content

feat(native): settings Secrets, Maintenance and Diagnostics pages - #67

Merged
rynfar merged 2 commits into
nativefrom
nw/65-settings
Nov 2, 2026
Merged

rynfar merged 2 commits into
nativefrom
nw/65-settings

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Problem

The native client had no Settings → Secrets, Maintenance or Diagnostics pages, so secret providers, provider update checks, restart continuation, background activity, artifact and log retention, manual storage cleanup, process signals, trace diagnostics and OTLP export could only be managed on the web. Closes #65 (ledger rows ST-SECRETS, ST-MAINT, ST-DIAG).

Approach

Ported SecretsSettings.tsx with SecretProviderDialog.tsx/.logic.ts, MaintenanceSettingsPanel (SettingsPanels.tsx) with BackgroundActivitySettings.tsx and StorageCleanupSections/DatabaseStorageNotice (StorageSettings.tsx), and DiagnosticsSettings.tsx with TelemetryExportSettings.tsx.

  • Core (pure, tested):
    • settings/secrets.rs: secretProviders decode (bad ids and envelopes dropped), classifySecretProvider, secretProviderIdFromName, secretProviderFromDraft with the web's messages in its order, add/replace/remove payloads, the page states (disconnected, update required, editable only with providers:manage), and redactedPlaceholder bit for bit.
    • settings/maintenance.rs: update and retention payloads, resolveBackgroundActivityProfileOption, backgroundActivitySharedPolicySettings, backgroundActivityOverrideSettings, the reset rule, the advanced dialog's interval fields (normalizeIntervalSeconds), hasRules (including custom project rules), the cleanup report decode and its row names, sizes and last-run copy, the database compaction notice, formatBytes and a toFixed that rounds exact ties like JS.
    • settings/diagnostics.rs: process, resource history and trace decode (Effect Options), visibleProcessTree, process names and types, chart bars and depths, formatDuration/formatCpuTime, last-checked and relative labels, signal replies → toasts, and the telemetry form's overrides, endpoint status, running line and save payload.
    • storageCleanup now decodes artifact and log retention beside the worktree rules; ServerConfig reads observability and secretProviderSettings; capabilities read databaseStorage and otlpEndpointCheck.
    • Settings search gains the pages' rows in the web's order; Secrets and its rows show only with T3CODE_FEATURE_SECRETS set, as on the web; Diagnostics is a detail page whose nav highlights Maintenance.
  • App (dumb views):
    • settings/secrets.rs: list with the 1Password mark and the account redacted until clicked, Add provider / Edit dialog (errors after the first submit, Enter submits), Remove with the web's confirmation.
    • settings/maintenance.rs: Updates, Background activity (select + advanced dialog), Database notice, Artifacts and logs, Cleanup (Delete now, last run folded with its results, virtualized past 20), and the link to Diagnostics. Rows this connection cannot write are inert and say why.
    • settings/diagnostics.rs: Live Processes (virtualized tree, collapse, INT, KILL after confirmation), Resource History (window toggle, chart, virtualized table), Trace Diagnostics (open logs folder), Latest Failures, Most Common Failures, Slowest Spans (copy trace ID), Span Logs, Top Span Names, and OpenTelemetry export (Test, Save, Discard).
    • controls.rs: Row::unavailable/title_icon/title_tooltip/description_content, InlineButton, and a shared settings dialog frame.
    • Toasts now paint over the settings modal (web layer 100), so cleanup and signal toasts are visible.
  • Entry points: the settings nav (Maintenance; Secrets behind its flag), settings search and the command palette's settings results, and Maintenance → View diagnostics. The web has no keybindings for these.

Not ported

  • ST-DIAG is partial: the resource monitor (ResourceTelemetryDiagnostics.tsx: resource monitor, host and collection, resource timeline, live process tree, instrumented I/O).
  • The database notice's Dismiss lasts for the app session. On the web it is stored in browser storage.
  • Scope axes ("Mixed across selected machines", project scope notices) don't apply. Native holds one environment.

Ledger

ST-SECRETS → done, ST-MAINT → done, ST-DIAG → partial, Native = crates/{app,core}/src/settings/{secrets,maintenance,diagnostics}.rs, Issue #65. Web sources now also list SecretProviderDialog*, StorageSettings.tsx, BackgroundActivitySettings.tsx, DatabaseStorageNotice.tsx, ResourceTelemetryDiagnostics.tsx and ProcessSignalActions.tsx, so upstream changes to them are triaged.

Evidence

  • Tests: settings::secrets::tests::* (8), settings::maintenance::tests::* (12), settings::diagnostics::tests::* (10), including draft_validation_matches_the_web, redacted_placeholder_matches_the_web, shared_policy_keeps_custom_intervals_and_drops_preset_ones, an_override_pins_every_resolved_value, has_rules_counts_retention_worktree_rules_and_custom_projects, format_bytes_matches_the_web, durations_match_the_web, collapsing_a_process_hides_its_subtree_only and telemetry_status_follows_overrides_and_checks. New secrets_shows_only_behind_its_feature_flag; updated nav_keeps_the_web_order_and_drops_unported_sections and the worktree decode test.
  • Smoke server writes, all undone: cargo run -p t3-client --example maintenance_probe -- --allow-write --secrets --maintenance --run-cleanup --telemetry. It adds, renames and removes a 1Password provider; flips provider update checks; picks Battery saver, then custom intervals; sets log retention to its 3650-day maximum and runs Delete now (0 removed); tests an unreachable OTLP endpoint and saves then clears it. Each step is checked restored. Transcript: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw65/probe-transcript.txt. Read-only decode: -- --read.
  • Screenshots (snapshot renderer, dark, smoke server), in /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw65/: maint.png, background-dialog.png, secrets.png, secrets-list.png, secrets-dialog.png, secrets-errors.png, diag.png, diag-tables.png (trace tables, errors clamped to three lines), telemetry.png.
  • Snapshot: --settings also takes a settings search id (telemetry-export) and lands on that row; test-t3-native documents it.
  • Gates: cargo clippy --workspace --all-targets -- -D warnings ✓ (and -p t3-native --features snapshot), cargo test --workspace ✓, node scripts/gen-theme.ts --check ✓, node --test parity/sync.test.ts ✓, node ../../apps/native/conformance/generate.ts --check ✓, node apps/native/scripts/vendor-icons.ts --check ✓.

@rynfar

rynfar commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner Author

Review round 1: all four findings were real and are fixed in 8b2cfe5 on top of fork/native.

  1. Background activity edits are now ServerSettingChange::BackgroundActivity(BackgroundEdit), built when the save queue sends them from the settings earlier saves left (crates/core/src/settings/mod.rs, maintenance.rs BackgroundEdit). Switches, interval fields and the shared policy all use it. Test: queued_background_edits_build_on_the_previous_save.
  2. An edit dialog closes once its provider is gone (Target::is_open_in), checked on render and on Save, so Save can't write a removed provider back. Test: an_edit_closes_once_its_provider_is_removed_elsewhere.
  3. Diagnostics queries now use core Query<T>, whose request number only grows (reset bumps it), so a reply from an earlier visit is dropped. Test: a_reset_query_drops_replies_from_before_it.
  4. Telemetry save refuses fields that aren't empty or an absolute http(s) URL (the field's type="url" + pattern), shows the field's hint under them, and sends values trimmed. Test: telemetry_save_refuses_endpoints_that_are_not_http_urls.

Gates rerun: clippy (workspace, and app with snapshot), cargo test --workspace, gen-theme, sync, conformance, vendor-icons. Smoke-server round trips rerun and restored: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw65/probe-transcript-2.txt.

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