Skip to content

fix(ui): show a clickable primary action on every palette step - #511

Merged
nixuuu merged 1 commit into
devfrom
fix/palette-step-actions
Nov 10, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/palette-step-actions

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 10, 2026

Copy link
Copy Markdown
Member

The URL and choice steps in Add project and Add workspace exposed their primary actions only as keyboard hints. Every step now renders a clickable primary button in the shared StepHeader, with its action label and ↵ at the right of the input row.

Invalid input disables the button and exposes the reason to mouse, keyboard and touch through the existing kit tooltip wrapper. Busy actions replace ↵ with a spinner in a reserved slot; the label and button width stay fixed. Back and Close remain clickable, with Close now visible on desktop as well. Phone and coarse-pointer controls reserve at least 44 px, and long inputs shrink before the buttons.

The copy flow moves its existing action buttons into that same header, including review, confirmation, retry and completion. File selection and copy transport are unchanged. Mobile already had explicit primary buttons for its equivalent forms; its Add project label now distinguishes Add project, Create project and Clone project. Only JS/TypeScript mobile code changed.

Flows checked

Surface Coverage
Add project Worker and source selection; existing directory; new project / Git init; Git URL and GitHub owner/repo; clone destination. Clicked through successful existing-directory addition, Git init and a local Git clone using real workers.
Add workspace Worker selection including Already added; sources; existing-directory destination; clone URL and destination; copy destination, file list, secret confirmation, progress and Done. Completed a real workspace copy between two private workers.
Shared-step scope ChoiceStep, UrlStep, BrowseStep and CopyWorkspaceStep are all callers of StepHeader; both add flows use them. Copy changes are confined to header/action wiring and removal of the old action buttons.
Other pickers inspected in code Command palette, workspace/worktree picker, Git ref picker and workspace-directory dialog. They use their own selectable rows or explicit submit buttons rather than StepHeader; no change needed.
Mobile inspected in code Add project: directory/init/clone/GitHub; Add workspace: directory/clone; WorkspaceCopy: destination, file selection, secret confirmation, progress and completion. Existing buttons and sheet close/back affordances cover the same actions.

Verification

  • Passed bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, git diff --check, and bun run --filter @canopy/web build.
  • Real-browser checks used a private gateway/BFF/Postgres and two real workers on ports 15437–15439. All add-flow steps above were viewed in light/dark at 1280, 720 and 375 px, with long URLs/paths; also checked no-results/disabled tooltip at 320 px. Back, Close, disabled reasons and mouse actions work. The clone button measured exactly 128.5 × 44 px before and during its busy state. No UI test suite was added or run.
  • EAS CLI 27.4.1, fingerprint:generate --platform <ios|android> --build-profile production --json --non-interactive: before/after hashes match. iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17; Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9. Native-device rendering was not exercised. The full integration check:tmp run was not performed; this task authorized the listed checks and browser verification.

Screenshots are outside the repository: /var/tmp/canopy-palette-actions/ (105 PNGs), with every exact path in /var/tmp/canopy-palette-actions/screenshots.txt. Representative files:

  • /var/tmp/canopy-palette-actions/project-clone-url-long-desktop-light.png
  • /var/tmp/canopy-palette-actions/project-url-invalid-tooltip-phone-dark.png
  • /var/tmp/canopy-palette-actions/workspace-clone-path-phone-light.png
  • /var/tmp/canopy-palette-actions/workspace-copy-confirm-phone-dark.png
  • /var/tmp/canopy-palette-actions/workspace-copy-done-desktop-dark.png

Copy audit — docs/copy.md §8

Before → after Reason
Keyboard-only Continue/Select → visible Continue ↵ Makes the existing next-step action discoverable to mouse and touch users.
Per-step action slot and changing busy label → shared action label with reserved ↵/spinner slot Keeps one primary action and avoids width changes while busy. Existing Add directory, Create project, Clone project, Add workspace, Clone workspace and Choose files labels remain scoped to their action.
Disabled without an accessible reason → existing URL/path validation plus Choose an available option / Choose files to copy Explains the required input. Reasons are available on hover, keyboard focus and tap.
Secret confirmation checkbox only → unchanged checkbox plus Confirm that you want to copy these files tooltip Keeps the explicit consent requirement and describes how to enable the action.
Mobile Add project for every source → Add project / Create project / Clone project Names the actual operation.

New/changed text uses sentence case, imperative verbs, existing glossary terms and short instructions. Existing service errors, empty-state text and secret warnings retain their wording. No new terminology, repeated descriptive copy or humour. Labels remain textual and meaningful without colour or the ↵ glyph. Checked short, typical and long inputs across desktop and phone layouts. Polish documentation now describes the shared primary action, disabled reasons and touch targets.

Fixes: #155

Related: #500

@nixuuu
nixuuu merged commit 26f61cc into dev Nov 10, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/palette-step-actions branch November 10, 2026 15:58
nixuuu added a commit that referenced this pull request Nov 10, 2026
PR #503 allowed selecting individual repository files, which could
produce a partial checkout. Copy the whole repository state instead: Git
metadata, tracked files and nonignored untracked work are mandatory,
enforced by the source worker before any reads. Web and mobile show a
fixed repository summary and offer only ignored local files.

Ignored dependency, build and cache directories are pruned before
walking their contents and listed in a disclosure. Secret-like and local
configuration files retain explicit confirmation; large ignored groups
start collapsed. Old presets apply only to available ignored files and
are narrowed on their next save. Limits, chunk transfer, integrity
checks and cleanup remain in place.

The copy dialog has its own persistent footer alongside the shared
palette header action, including Enter handling and disabled/busy
states. Its full-width primary action stays visible while the preview
scrolls, explains disabled states and shows progress with a cancel
action. Scroll containers, including the file tree, use `scroll-stable`.
Both clients use a three-line repository summary, a truncated monospace
branch with access to its full name, animated kit disclosures, file lock
icons with contextual help and muted folder counts. The root keeps its
indeterminate checkbox without repeating a secrets warning.

Contracts are additive, generated code is included, and legacy
full-selection fields are deprecated. The new `workspace_copy_scope_v2`
capability requires updated workers and linked gateways. Polish
documentation is updated.

Fixes: #503

## Validation

Rebased onto `dev` at `26f61cce`, retaining the shared palette actions
from #511, scrollbar gutters from #512 and linked-bot fixes from #509.
Re-ran generation, typecheck, lint, format check, both focused
workspace-copy test files separately (14 tests, 98 assertions, no
temporary files left), and the web build; all passed. Browser
screenshots and mobile fingerprint evidence below were collected before
this rebase.

- Passed: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun
run lint`, `bun run format:check`, and the web build. The final layout
adjustment also passed web typecheck and build.
- Focused gRPC tests ran one file at a time through `check:tmp`:
workspace-copy (12 tests, 90 assertions) and workspace-copy-durability
(2 tests, 8 assertions). Coverage includes mandatory tracked and
nonignored untracked files, direct worker rejection of partial
selections, dependency requests, ignored choices, old presets, linked
transfers, integrity and recovery. Both left no temporary files. The
full repository test suite was not run.
- Real browser: light/dark at 1280, 760 and 390 px, with long names,
`.env` files, local configuration, over 100,000 dependency entries,
`target`, and a 205-file unusual ignored data directory. Replaced all
six screenshots after checking the visible, clickable footer before and
after scrolling, animated disclosure, branch/file tooltips, fixed row
heights and disabled confirmation with a reason. A real 64 MB browser
transfer exercised the busy state and completed successfully; the copied
tracked file matched byte-for-byte and Git retained the tracked
modification and nonignored untracked file. Screenshot artifacts stay
outside the repository; the before image is the maintainer-supplied
screenshot.
- Mobile: changed-file ESLint, Expo Doctor (20/20) and iOS/Android JS
exports passed. Production fingerprints generated before/after with
`[email protected]` are unchanged: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. No native device runtime
validation.

## Copy audit

1. Selectable “Repository files” / “Git metadata” → compact fixed
summary: “Repository · …”, a separate monospace branch and a line of
unpushed commits/changes. Describes what is copied without implying a
choice or producing a paragraph on phones.
2. “Ignored build files start excluded” → “Skipped: node_modules, target
and … (dependencies and build output)” with disclosure. Explains that
these directories are omitted; a separate hint asks users to check
unusually large ignored groups.
3. “Secrets?” / repeated row warnings → a small lock icon with “May
contain secrets: …” contextual help for files and “N may contain
secrets” for folders. The synthetic root omits the repeated warning.
Desktop tooltips and native help preserve the meaning without adding a
second line; explicit confirmation and verb-led actions remain.
4. “Your selection is remembered” → “Ignored file choices are remembered
for this project”. Accurately scopes the preset. Empty state: “No
ignored local files to choose”. Repository errors state the problem and
recovery action.
5. Added “Confirm the files above to continue.” to explain a disabled
action; loading/copying actions show busy states. Checked sentence case,
glossary, punctuation, one idea per sentence, empty/error states,
confirmation wording and absence of decorative humour. Checked short,
typical and long names at desktop, narrow and phone widths in light/dark
themes; warnings have accessible text and contextual help.
nixuuu added a commit that referenced this pull request Nov 10, 2026
Cloning a project or workspace now shows Git's live phase, percentage,
transfer size and rate, with a collapsible log and Cancel. Failures
preserve the log beside the error and Retry. The log has a fixed height,
automatic scrolling and a reserved scrollbar gutter on web/desktop;
mobile shares the same lifecycle and status formatting.

The worker runs `git clone --progress`, parses CR/LF stderr records and
sends bounded, sanitized snapshots at most four times per second over
the existing WorkerLink. `git_clone_progress_v1` gates
progress/cancellation and the linked-computer route. Older workers keep
the indeterminate unary flow. Proto additions are additive, WorkerLink
stays at protocol 1, and frozen update contracts are unchanged.

Clone deadlines are now 2 minutes without changed progress and 60
minutes overall, with matching gateway/client waits. Cancellation kills
the owned process group, removes queued work immediately and cleans only
the directory created by that clone. URL validation, protocol
restrictions, owner scoping and linked project-sharing checks remain
enforced. Polish protocol, routing and process-governor docs describe
the behavior. Copy workspace has no remote-clone path.

### Validation

- Passed `bun install`, `bun run gen:check`, `bun run typecheck`, `bun
run lint`, `bun run format:check` and `bun run --filter @canopy/web
build`.
- Ran `TMPDIR=/var/tmp bun run check:tmp <file>` serially for
`clone-progress`, `clone-progress-linked`, `process-governor`,
`add-project`, `project-workspaces` and `linked-projects`: 33 tests
passed, with clean temporary directories. Coverage includes
ordering/throttling, redaction and bounds, stalled/queued/running
cancellation, descendants, cleanup, retry, old workers, ownership and
the two-gateway route. No real network repositories or UI tests.
- Inspected the browser on private ports at desktop, narrow and phone
widths in light/dark: project/workspace cloning, scrolling/gutter,
authentication and bad-URL failures, cancellation/cleanup, and
successful registration. Used a local bare repository with 39 MiB of Git
data and controlled Git diagnostics to keep progress/failure states
visible. Screenshots remain outside the repository.
- EAS CLI 27.4.1 production fingerprints are unchanged: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. Mobile changes are JS only.
Native device rendering and the Electron shell were not separately
exercised; desktop uses the shared web UI. The full repository test
suite was not run; the focused files above ran individually as
requested.

### Copy audit (§8)

“Cloning on {worker}… This stops after 5 minutes.” → live Git
phase/percentage/transfer status: removes the obsolete deadline and
shows current activity. Added “Cancel”, “Show Git log”/“Hide Git log”
and “Retry”: explicit, sentence-case actions. Failure, stall, timeout
and cancellation messages state the outcome and the next action;
transport details stay out of the surface text. Git's original
diagnostics stay inside the optional log. Checked sentence limits,
glossary, punctuation, repeated facts, accessible labels/status, and
short/typical/long text at desktop and phone widths. No new glossary
term, empty state or expressive copy.

Related: #500, #511, #512
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