Skip to content

feat(native): settings Projects page with project actions - #63

Merged
rynfar merged 2 commits into
nativefrom
nw/60-projects
Nov 2, 2026
Merged

rynfar merged 2 commits into
nativefrom
nw/60-projects

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Problem

The native client had no Settings → Projects page. "Project settings" was hidden in the thread menu and missing from the project menu, so a project's name, pin, archive state, New threads overrides and actions could only be changed on the web. Closes #60 (ledger row ST-PROJECTS).

Approach

Ported ProjectsSettings.tsx, ProjectSettingsPanel.tsx and ProjectActionsSettings.tsx, along with what they render: ProjectActionsList, ProjectDefaultsSettings at project scope, and the projectScriptEditor dialog.

  • Core (pure, tested):
    • settings/projects.rs: the group list and its order; the row that follows the project after a regroup; icon decode, description and default; project.update and forced project.delete payloads; rename rules; the Danger copy; planProjectRemoval and ConfirmDialogHost's title/description split.
    • Project override writes (projectOverrideWrites / planScopedSettingsClear), which keep keys this client doesn't read.
    • Model and workspace resolution at project scope.
    • settings/project_actions.rs: the editor form rules, the id and role rules (buildProjectScript, releaseClaimedRoles, nextProjectScriptId), the keybindingValueForCommand round trip, and the useProjectScriptSettings write plan: the override write, then upsert, replace or remove, keeping a shortcut that another project still uses.
    • parseT3ProjectFile with lenient JSON, and the importable filter.
    • ProjectScript now round-trips every field (async, previewUrl, autoOpenPreview). Project overrides keep their raw entry. ProjectShell decodes faviconPath and projectIcon.
  • App:
    • settings/projects.rs: the list and the project picker ("Applying settings for …", the project half of SettingsScopeSentence). The page shows Name, Project icon (preview and reset), Pin, Archive, New threads (Model, Workspace), Checkouts and Danger. Removal confirms with the web's message and returns to the list.
    • settings/project_actions.rs: the Actions section, with import menu, list, reset to inherited value and mixed state, plus the invalid t3.json row and the editor dialog (icon picker, shortcut capture, delete confirmation).
    • Rows the connection cannot change are dimmed and inert and explain why.
  • Entry points: the settings nav (Code → Projects); settings search (project-overview, project-actions); the thread context menu (sidebar and chat header); the project menu; a gear button on each project-filter row; and the palette's "Project settings".

Not ported (row is partial)

  • The "Choose icon" (Lucide/emoji/monogram) and "Choose file" pickers. Native doesn't draw projectIcon overrides yet. The reset works, and a faviconPath shows through the server's favicon.
  • Draft-row and draft-header "Project settings" menus: native drafts have no menus.
  • The inheritance marker popover, and the web's environment and checkout scope axes. Native holds one environment.
  • The "keep this project picked on other pages" alert. Other native pages aren't scoped by project.

Ledger

ST-PROJECTS → partial, Native = crates/{app,core}/src/settings/{projects,project_actions}.rs, Issue #60.

Evidence

  • Tests: settings::projects::tests::* (9) and settings::project_actions::tests::* (10), including deleting_an_action_keeps_a_shortcut_another_project_still_uses, resetting_the_override_clears_it_and_drops_orphaned_shortcuts, override_writes_keep_unknown_keys_and_clear_to_null, the_project_model_skips_overrides_on_disabled_instances, removal_confirmations_follow_plan_project_removal and t3_json_parses_leniently_and_rejects_invalid_files. Updated tests: nav_keeps_the_web_order_and_drops_unported_sections and the project menu labels.
  • Smoke server writes, all undone: cargo run -p t3-client --example project_settings_probe -- --allow-write --dir <scratch>. It renames, pins and unpins, archives and unarchives, sets and resets the icon, sets and clears the workspace override, imports Lint from t3.json, adds Dev with mod+shift+9, rebinds it (replace), deletes it (shortcut removed), resets the override, checks the keybindings are unchanged, and removes the project. Transcript: /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw60/probe-transcript.txt
  • Screenshots (snapshot renderer, dark, smoke server):
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw60/projects-list.png: the project list
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw60/project-page.png and /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw60/project-page-full.png: the project page
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw60/add-action.png: the Add Action dialog
  • Gates: cargo clippy --workspace --all-targets -- -D warnings ✓ (and --features snapshot), cargo test --workspace ✓, node scripts/gen-theme.ts --check ✓, node --test parity/sync.test.ts ✓, node ../../apps/native/conformance/generate.ts --check ✓.

@rynfar rynfar mentioned this pull request Nov 2, 2026
Port Settings > Projects: the project list, each project's name, icon reset,
pin, archive, New threads overrides, actions (add, edit, delete, import from
t3.json, reset, shortcuts), checkouts and removal. Open it from the settings
nav and search, the thread and project menus, the project filter, and the
command palette.
Build project override writes when the settings queue sends them, so a
Model or Workspace change queued behind another keeps it, and send action
lists the same way. Offer only models every grouped checkout can run,
virtualize the project list with a linear shared-name check, and refetch a
project's favicon when its chosen image changes.
@rynfar

rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Review round 1, addressed in ab190c8 (rebased on fork/native):

  1. [P1] Stale override entries: fixed.
    • Project override writes are now ServerSettingChange::ProjectOverride { members, edit }. The settings queue builds them from the settings current when it sends them (projects::override_patch). A Workspace change queued behind a Model change keeps the model.
    • Action lists go through the same queue (OverrideEdit::Scripts(ScriptsEdit)), so they can't drop a queued Model or Workspace change either. Their shortcuts are sent once the list has saved (store::update_server_then).
    • Test: a_queued_override_keeps_the_change_saved_ahead_of_it. The smoke-server probe was re-run and every write was undone.
  2. [P2] Grouped availability: fixed. I ported useScopedModelDisabledReason as model_unavailable_reason.
    • The picker offers only models every member can run.
    • Saving refuses others with "Default model not saved".
    • A shown model some member can't run gets the web's status line.
    • Test: a_model_one_member_turned_off_is_unavailable_to_the_group.
  3. [P2] Explicit automatic (null) model: not a defect. At project scope the web also offers no way to store null. SettingsRow replaces the row's resetAction with the source-based "Reset to inherited value" whenever isProjectScope && scopedKeys.length > 0 (settingsLayout.tsx). The model reset that stores null runs only at environment scope, and native already has it on Threads.
  4. [P2] Icons: partly fixed.
    • Omitting path from assets.createUrl is correct. The contract says it is a "cache-key hint only; the project projection supplies the authoritative path", and the server reads faviconPath from the project (ws.ts).
    • The real gap was that native never refetched after faviconPath changed. Favicons are now requested per (project, faviconPath) and keyed by it, so a newly chosen image shows.
    • Emoji, monogram and Lucide overrides still aren't drawn anywhere in native. That is the noted gap, and the ledger row now says "custom icons not drawn".
  5. [P2] Project list: fixed. The list renders as a virtualized list() over the page, like Archive. The name-twin check is linear (shared_labels).

@rynfar

rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

On finding 3 (explicit automatic model at project scope), I checked again and I'm keeping my earlier answer.

  • ProjectDefaultsSettings.tsx:151-155 passes the setModel(null) reset to SettingsRow as resetAction.
  • SettingsRow renders resetAction only in the last branch of renderedReset (settingsLayout.tsx:392-404). Whenever isProjectScope && scopedKeys.length > 0, it renders the source-based "Reset to inherited value" button (clearOverrides) instead.
  • defaultModelSelection is in PROJECT_SCOPED_SERVER_SETTING_KEYS (contracts/src/settings.ts:1026). That makes scopedKeys non-empty, so at project or checkout scope the "default model" null reset is never rendered. No other web path writes a null model. setModel(null) at ProjectDefaultsSettings.tsx:153 is the only call.
  • The null-vs-remove rule in scopedSettings.ts:243-266 is real, and core already ports it (override_patch). A null defaultModelSelection is stored, and other keys are removed. override_writes_keep_unknown_keys_and_clear_to_null asserts this. A stored null from another client also reads as automatic (the_project_model_skips_overrides_on_disabled_instances, p3).

Adding an inline "automatic" reset at project scope would add a control the web doesn't show, so I haven't added one. If you have a web build where it appears at project scope, a capture would change my mind.

@rynfar
rynfar merged commit 02e9662 into native Nov 2, 2026
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