Skip to content

feat(projects): add projects on any linked computer - #155

Merged
nixuuu merged 1 commit into
feat/add-project-anywhere-1from
feat/add-project-anywhere-2
Nov 5, 2026
Merged

nixuuu merged 1 commit into
feat/add-project-anywhere-1from
feat/add-project-anywhere-2

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 5, 2026

Copy link
Copy Markdown
Member

Stage 2 of 2 (UI).

  • Settings → Projects: lists the union of projects from all linked computers, with a quiet line saying where each has workspaces. "Add project" opens the shared flow; the old quick name form is gone.
  • Command palette: "Add project" (the binding id is kept).
  • Keyboard-first flow:
    1. Choose the worker on any computer. Offline workers are disabled with a reason.

    2. Choose a source:

      • New project (git init),
      • Existing directory,
      • Git URL,
      • GitHub repository (owner/repo).
    3. Directory browser:

      • typing a path filters the list live;
      • / descends into a directory, .. goes up;
      • Enter opens a directory, ⌘/Ctrl+Enter adds the current path;
      • Backspace goes back.

      Clone and new-project targets pick their parent directory the same way.

    4. A toast confirms the result: added, or attached to an existing project as a new workspace.

Checked every step with two linked fixture gateways: typing paths, filtering, .., long names and an offline worker, on phone and desktop, in light and dark.

Copy audit (docs/copy.md §8):

  • "New project" in the palette is now "Add project" (one name for the flow).
  • "Local folder" is now "Existing directory" (glossary: directory).
  • The semicolon in "No projects yet" is split into two sentences.
  • The "This computer" badge is now a quiet location line.
  • New strings use sentence case and verbs on actions, and errors say what to do.

Settings → Projects lists the projects of every linked computer, merged
by git origin, with the computers that have their workspaces. Rows
without a record on this computer do not open per-computer settings.

Add project is a keyboard-first dialog in the look of the command
palette, opened by the palette command and by Settings → Projects.
Choose a worker on any computer (offline ones disabled with the
reason), a source (new project, existing directory, Git URL, GitHub
repository) and a directory in a browser driven by the typed path:
the prefix filters, / descends, .. goes up, arrows pick, Enter opens
or adds and Mod+Enter adds the typed path.

The palette rows, styles and key legend are shared between both
dialogs.
@nixuuu
nixuuu added this pull request to stack #156 November 5, 2026 09:07
@nixuuu
nixuuu marked this pull request as ready for review November 5, 2026 09:11
@nixuuu
nixuuu merged commit 51caf30 into dev Nov 5, 2026
9 checks passed
@nixuuu
nixuuu deleted the feat/add-project-anywhere-2 branch November 5, 2026 09:11
nixuuu added a commit that referenced this pull request Nov 7, 2026
Resolve every directory segment on the worker, keep exact-name precedence, and reject ambiguous matches with the candidate names. Track requested and resolved paths separately in the picker and persist canonical workspace paths.

Fixes: #155
nixuuu added a commit that referenced this pull request Nov 7, 2026
Resolve every directory segment on the worker, keep exact-name precedence, and reject ambiguous matches with the candidate names. Track requested and resolved paths separately in the picker and persist canonical workspace paths.

Fixes: #155
nixuuu added a commit that referenced this pull request Nov 7, 2026
Typing `~/git/` on a worker with only `~/GIT` now opens `~/GIT/` and
updates the path field before Add directory submits it. The worker
resolves every path segment, prioritizes exact names, and accepts a
case-insensitive match only when it is unique. With both `Git` and
`GIT`, the picker names the candidates and asks for exact spelling.
Missing paths stop loading with an actionable error and leave Add
directory disabled.

Directory listings retain the existing worker validation and
owner-scoped gateway routing. Add project and workspace create/update
store the resolved path. Linked-computer coverage verifies that
resolution and project creation happen on the destination worker. The
picker associates responses with their requested path, so canonical
paths and symlink targets can render without persistent skeletons.

Fixes: #155

### Verification

- Passed: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun
run lint`, `bun run format:check`, and `bun run --filter @canopy/web
build`.
- Full `bun run check:tmp`: 1748 passed, 161 skipped, 0 failed across
310 files; temporary directory clean.
- Real gRPC regression coverage: exact matches, one case-insensitive
match, multiple wrong-case segments, ambiguous siblings, missing
directories, files, linked computers, and persisted workspace paths.
- T3 browser verification against an isolated gateway, real worker,
PostgreSQL, and scratch home: `~/git/` → `~/GIT/`, nested correction,
Add directory saves the real path, exact `Git`/`GIT` choices, ambiguous
and missing paths disable adding, and relative paths show guidance.
Light/dark at 1280×800 and 390×844; short, typical, and long names
render cleanly. Ambiguity messages with 128-character names wrap without
horizontal overflow on a phone. Preview tabs and owned stack/container
cleaned up.
- Runtime verification used Linux. Windows separators and
filesystem-native path equivalences are retained; macOS and Windows were
not run locally.

### Copy audit — docs/copy.md §8

| Before → after | Reason |
| --- | --- |
| Raw missing-path error → “No such directory. Check the path or choose
a directory.” | States the problem and recovery without internal codes.
|
| Raw filesystem exception → “Could not open this directory. Check the
path and its permissions.” | Gives an actionable fallback for
inaccessible paths. |
| Raw non-directory error → “This path is not a directory. Choose a
directory.” | Identifies the incorrect target and next action. |
| No ambiguity guidance → `Several directories match “git”: “GIT”,
“Git”. Type an exact name.` | Names the candidates without choosing one.
|
| Skeletons for relative input → “Enter a directory path”, alongside the
existing “Start the path with ~/ or /.” hint | Gives the idle state a
title without repeating the recovery hint. |

All changed text uses sentence case, plain English, short sentences, and
the existing directory/worker glossary. Existing action labels keep
their verbs. Errors end with recovery instructions; there are no new
terms, jokes, repeated visible facts, or icon/colour-only meanings.
Error status is announced accessibly. Desktop/phone and long-name checks
passed.
nixuuu added a commit that referenced this pull request Nov 10, 2026
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
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