Skip to content

fix(threads): open folders only on this computer, in a visible window - #513

Merged
M-Zajace merged 2 commits into
devfrom
fix/reveal-folder
Nov 10, 2026
Merged

M-Zajace merged 2 commits into
devfrom
fix/reveal-folder

Conversation

@M-Zajace

@M-Zajace M-Zajace commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

"Open folder" (#494) had two problems:

  1. Nothing visible on Windows/macOS. The opener ran through the process governor's runProcess capture, which spawns with windowsHide: true, so Explorer opened the folder in a hidden window; on macOS open -R only selected the folder in its parent. The opener now starts with spawn (reserved through governNodeSpawn), detached, stdio: "ignore", with a visible window; macOS uses open <folder>. Windows counts a started Explorer as success (it exits with 1 after opening); macOS/Linux use the opener's exit code. Worktree "Reveal on computer" shares the function.
  2. It opened on another machine. Clicking a linked Mac's thread on Windows opened Finder on the Mac. The action now shows only when the folder is on the computer showing it: the desktop app runs its own gateway (GatewayCapabilities.ownGateway), the thread has no nodeId, and its worker is the app's bundled worker — new ui.Worker.desktop_bundled (field 861, from the existing desktop_bundled capability). RevealThreadDirectory is removed from the RPCs served to linked computers.

docs/worktrees.md updated.

Fixes: #494

Verification

  • Windows: the new opener showed an Explorer window with the folder (confirmed by the owner).
  • Typecheck (gateway, web, worker) and lint clean; gen:check clean on LF checkout.
  • macOS not verified on hardware in this session.

Copy audit (docs/copy.md §8)

No UI text changed (the existing "Open folder" items are only hidden where they would open elsewhere).

Open folder ran the opener through the process governor's capture, whose
windowsHide started Explorer in a hidden window, and on macOS `open -R`
only selected the folder in its parent. The opener now starts detached
with a visible window, and macOS opens the folder itself.

Fixes: #494
Open folder ran on the thread's worker, so a linked Mac's thread opened
Finder on the Mac when clicked on Windows. The action now shows only in
the desktop app with its own gateway, for threads of its bundled worker
(new Worker.desktop_bundled), and linked computers no longer receive
RevealThreadDirectory.

Fixes: #494
@M-Zajace M-Zajace changed the title fix(worker): show the opened folder on windows and macos fix(threads): open folders only on this computer, in a visible window Nov 10, 2026
@M-Zajace
M-Zajace merged commit 521dd8c into dev Nov 10, 2026
10 checks passed
@M-Zajace
M-Zajace deleted the fix/reveal-folder branch November 10, 2026 16:26
nixuuu added a commit that referenced this pull request Nov 11, 2026
## Change

**Rebase update (2026-11-11):** the complete stack was rebased bottom-up
onto `origin/dev` `48cd5e9c3ce07b7a46873ac40d92819ca847f85a`, preserving
#522, #526 and #527. This layer's current CI is green; implementation
layers passed typecheck, lint and formatting after conflict resolution.
The migration maximum at this layer is **0116**; this supersedes
historical numbering below. Proto generation was repeated in each
affected layer (worker git-context fields use 227, preserving dev's file
API fields). Final cross-stack security, parity, performance and
verification evidence is in #534. Earlier results below describe the
pre-rebase implementation. All layers remain draft; native device UI
remains unverified.

Stage 4 enables Summary, Timeline and Code on web/desktop and mobile.
PRs now have paginated timeline/review threads and replies, checks/jobs
with lazy in-app redacted logs, and a paginated file list with commit
filtering and lazy unified/split diffs. Binary, renamed, truncated and
stale-SHA files have explicit fallback states. Viewed remains hidden
until stage 5; this stage makes no GitHub mutations.

Visible PRs share a watch producer and durable fetch leases; hidden
clients stop their streams, reconnect gaps invalidate pages, and active
background threads fetch bounded header batches. Linked homes retain
verified offline snapshots without mirroring logs. Cache retention,
owner quotas and fixed-label metrics cover the new resources. Composer
actions prepare bounded, quoted, untrusted attachments through the
existing attachment/harness path and never send a message automatically.

The release catalog stays CDN-first and can use an administrator's own
connected GitHub account for its authenticated API fallback. The visible
setting defaults on; missing, expired, disconnected or disabled accounts
retain the public update path. Credentials stay in the gateway and are
stripped from storage/CDN redirects.

Individual check/review states use Tabler outline glyphs with tooltips
and accessible labels, including mobile accessibility labels. The PR's
primary state stays readable as a compact icon-and-text badge. Aggregate
check counts remain text. Thread PR links use quiet source captions and
panel rows. Summary/Timeline/Code, checks, logs and the file-list
scrollport follow #512's `scroll-stable` helper and balanced padding.

The design pass gives Code one compact toolbar for commit filtering,
file count, layout, wrap, whitespace and tree view. File rows expand
their diff directly below a sticky file header; paths truncate in the
middle, renames retain both paths, and binary/large patches have inline
recovery actions. Timeline uses a compact event menu and sort toggle, an
avatar rail, grouped commits with short SHAs, relative timestamps with
absolute-time tooltips, markdown cards and inline review threads with
indented replies. Checks and review replies use progressive loading.
Shared activity/file presentation and focused components keep
web/desktop and mobile aligned; existing thread diff controls retain
their defaults.

## Stack and migrations

Rebased #485 → #487 → #501 → #508 with `gh stack` onto `origin/dev` at
`26f61cce`, including #486's static release index and #512's scrollbar
helper. Resolved conflicts, regenerated contracts where needed, checked
typecheck/lint/format at each layer, and force-pushed the rewritten
layers with explicit leases. All PRs remain drafts and their bases still
chain. Dev subsequently advanced with #510, #513 and #515; those changes
are outside this completed prerequisite rebase.

Renumbered the stack migrations above dev's 0112 in layer order: 0113
accounts, 0114 manual links, 0115 detection, then 0116 full read.
Updated the expected schema list and migration registration. Frozen
`update/v1` is unchanged; generated additive contracts are committed. No
material design deviations.

## Verification

- Passed `bun install`, `bun run gen:check`, root `bun run typecheck`,
`bun run lint`, `bun run format:check`, and the web build, including
final typecheck/build after the sticky-padding correction and mobile
typecheck/lint/format after the final mobile reset correction. The build
reports the existing chunk-size advisory. Final head
`429c46af353546c433e87293dd128910e524c04e`: CI is green. All five layers
#485/#487/#501/#508/#518 have SUCCESS check rollups, remain draft, and
retain the correct chained bases. No GitHub reviews have been submitted
for this stage.
- Sequential local fixture files passed: full-read pagination (5 tests),
security/composer (5), lifecycle/retention (4), release fallback (4),
linked-home offline/cache scope (3), and paired mobile transport (1).
Coverage includes >100 timeline/check/thread/reply/job items,
304/429/403, GraphQL partial errors, independent-client single-flight,
stream gaps/restart, 300 files/SHA races, log
SSRF/redaction/download/page limits, concurrent owner log quota,
retention, and authenticated/public release paths. Composer attachments
reached the scripted worker blob path. No live tests or anonymous
production API calls were used.
- Fresh-process full `bun run check:tmp` after the design pass: **2242
passed, 165 skipped, 0 failed**, **25397 assertions**, 2407 tests across
413 files, **1120.32 seconds**; exit 0 and **no Canopy temp entries
remained**. Harness-owned runtime entries were listed separately by the
runner and removed with its private directory. This rerun includes the
earlier cache-eviction correction and linked-home regression coverage.
The historical run was 2236 passed / 165 skipped / 6 failed; it is
superseded by this clean full run, not relabelled as passing. The final
two-file mobile state-reset correction additionally passed focused
ESLint, mobile typecheck, root lint/format and native JS exports.
- Browser fixture QA: light/dark, desktop 1440×1000, narrow 768×1000,
phone 390×844, with 18 new screenshots. Verified grouped commits, inline
review threads/replies (3→50→100), event filter/sort, relative-time
accessible labels containing absolute dates, folder collapse, long
paths, binary notices, long inline diffs and global
layout/wrap/whitespace controls. Checks progress 5→50→100→137 using one
control. Sticky toolbar/file-header bounds remain flush while scrolling;
phone panel has no horizontal overflow. Prior stage-4 fixture QA also
covered failing-job logs, huge/truncated/renamed patches, commit
filtering and all three composer attachments, including preserving an
existing draft when adding a second context.
- Mobile JS only: `bunx [email protected] fingerprint:generate --platform
ios --build-profile production --json --non-interactive` and the Android
equivalent passed. Fingerprints unchanged from stage 3: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. Expo Doctor passed 20/20;
prebuild passed in a scratch checkout with no package changes; iOS and
Android Hermes exports passed, both limited to one bundler worker.
Additional mobile ESLint found existing app-wide findings; two findings
in the new reset effects were corrected and focused ESLint on those
files now passes. Mobile typecheck, canonical repository lint and format
checks passed again after that correction. App-wide mobile ESLint still
reports 40 errors / 5 warnings in unchanged code and is not claimed
green.

Native simulator visual QA is unverified: device tools returned “Device
list failed: Could not communicate with device support. Try refreshing
devices.” Refreshing once produced the same error; no alternate device
control was used. Mobile RPC parity is covered over the real pinned,
paired and revocable mobile transport. Live GitHub tests remain
optional.

### Performance

Real gRPC/Postgres fixture benchmark, same scripted GitHub 503 load,
stage-3 baseline versus stage 4. 10 warmups and 80 samples per read/ACK
operation, 40 dispatch samples. ACK measures committed ACK enqueue, not
network round trip.

| Existing operation | Baseline p95 ms | Stage 4 p95 ms |
| --- | ---: | ---: |
| GetOverview | 3.705 | 3.453 |
| GetThread | 1.094 | 0.893 |
| Send → worker input | 13.466 | 8.095 |
| Ingest → ACK enqueue | 2.294 | 2.309 |

No material regression observed; ACK's +0.015 ms (+0.6%) is within
shared-machine noise. This is a local sample comparison, not a
confidence-interval study. Candidate measurements precede the final
cache-write byte-accounting and access-error eviction corrections; those
change cache misses and GitHub access-error paths, not the measured
existing operations or warm-read paths. Warm-read p95: PR 3.091,
Timeline 5.392, Checks 4.412, Files 15.145, Diff 14.059, Log 6.460 ms,
all below the 50 ms target. Browser/native rendering p95, cold upstream
latency and an unavailable-partner performance comparison were not
measured; the offline partner behavior has integration coverage.

### Copy audit (§8)

Reviewed new/changed labels, settings, errors and empty states against
`docs/copy.md`: sentence case, active verbs, glossary, actionable
recovery, no decorative prose or duplicate facts. Long check names,
branches and paths were inspected at desktop and phone widths.

| Before → after | Reason |
| --- | --- |
| Author login input and separate review section → compact activity
menu, inline threads and relative times | Reduce filter weight and
preserve chronological context |
| Per-file display controls → one shared icon toolbar | Keep file rows
focused on paths and changes |
| “Show 45 more checks” plus “Next page” → progressive “Show more
checks” | One paging pattern transparently loads further pages |
| Bare SHA → “on aaaaaaa”; primary state glyph → icon plus
“Open”/“Merged”/“Draft”/“Closed” | Clarify the revision and keep the
PR's primary fact readable |
| Individual “Failed”/“Requested” status text → labelled glyphs and
tooltips | More room for names; state remains available to assistive
technology |
| “Auto”/“Manual” chips → quiet source captions | Reduce visual weight
without hiding provenance |
| Bordered “Link pull request”/“Show less” → “+ Link pull request” and
quiet “Show N more”/“Show less” rows | Match panel row actions |
| Generic missing patch → “Binary file”, “File renamed with no text
changes”, or explicit size-limit guidance | Explain the actual
limitation and recovery |

No new glossary term or “soul” sentence. Empty/error text keeps the
necessary status words; aggregate counts remain readable text. Icons
have distinct shapes and labels rather than relying on colour.

### Screenshot evidence (uncommitted)

New design matrix under `/var/tmp/canopy-github-4/`:
`{desktop,narrow,phone}-{summary,timeline,code}-{light,dark}.png` (18
files), plus `desktop-code-sticky-dark.png`. Desktop is 1440×1000,
narrow 768×1000 and phone 390×844. Phone Code light shows stacked and
dark shows split. Existing logs/composer screenshots remain in the same
uncommitted directory.

Related: #485, #486, #487, #501, #503, #508, #512.
M-Zajace added a commit that referenced this pull request Nov 16, 2026
## Summary

In the desktop app (local mode), "Open folder" never appeared in the
thread menu or in Thread details, and "Open in default app" never
appeared for files opened from the Files panel.

- **Gateway:** the worker list query left `desktopBundled` out of the
capabilities it selects, so every worker reached the UI as not bundled
and `onThisComputer()` was always false. The query now selects it.
`updates-bundled.test.ts` asserts the overview marks the app's own
worker and not an external one.
- **Finder on macOS:** the action reads "Open in Finder" when the
thread's worker runs on macOS; Windows and Linux keep "Open folder".
- **Files panel:** a file tab now asks its thread whether it is on this
computer instead of relying on a flag that only message file links set,
so files from the Files panel and restored tabs offer "Open in default
app".

Fixes: #513

## Verification

- Dev desktop app on Windows: "Open folder" in the thread menu and the
Thread details directory menu opens File Explorer; "Open in default app"
on a file from the Files panel opens it (200).
- Dev desktop app on macOS: "Open in Finder" in both menus opens Finder;
"Open in default app" works for Files panel files.
- `updates-bundled.test.ts` on macOS with Docker: 2 pass; without the
SQL fix the new assertion fails.
- Locally: lint and format on edited files, `@canopy/gateway` and
`@canopy/web` typecheck, integration tests typecheck. The full gate is
left to CI.

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

Changed text: "Open folder" → "Open in Finder" on macOS (Finder is the
name people know the macOS file manager by).

1. One idea, sentence case, short: pass.
2. Glossary: no banned synonyms; "Finder" is a product name of the OS,
not a new term: pass.
3. Menu item starts with a verb ("Open"): pass.
4. Errors: none added or changed: n/a.
5. Empty states: none: n/a.
6. No repeated fact: pass.
7. External gaps: n/a.
8. No "soul" sentences: n/a.
9. Short label, fits menus at desktop and phone width: pass.
10. Text carries the meaning without the icon: pass.
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