Commit Graph

8 Commits

Author SHA1 Message Date
Aaddrick
5c8191e82f feat(linux): hybrid titlebar mode for clickable in-app topbar (#538)
* feat(linux): hybrid titlebar mode for clickable in-app topbar

Default `CLAUDE_TITLEBAR_STYLE` is now `hybrid`: native OS frame
plus a BrowserView preload shim that convinces claude.ai's bundle
to render its in-app topbar (hamburger / sidebar / search / nav /
Cowork ghost). Stacked layout instead of Windows's combined bar,
but every button is clickable.

Why not the upstream `frame:false` + WCO config: investigation
(see docs/learnings/linux-topbar-shim.md) ruled out
`titleBarOverlay`, `titleBarStyle:'hidden'`, and the `.draggable`
CSS class as the source of the topbar click-eating drag region.
The remaining cause is a Chromium-level implicit drag region for
`frame:false` windows that exists on both X11 and Wayland and has
no Electron-API knob. With `frame:true` the OS handles dragging
and Chromium pushes no drag-region map, so the buttons receive
mouse events normally.

Modes:
- `hybrid` (default) — system frame + shim, topbar visible and
  clickable
- `native` — system frame, no shim, no in-app topbar
- `hidden` — frameless + WCO config, matches Windows/macOS
  upstream; topbar visible but not clickable on Linux. Kept for
  Wayland comparison and future investigation

Tests: tests/launcher-common.bats grew 16 cases covering
`_resolve_titlebar_style`, `build_electron_args` flag selection
per mode, and `setup_electron_env` env-var wiring per mode.
`claude-desktop --doctor` now reports the resolved mode and
warns when `hidden` is set.

Co-Authored-By: Claude <claude@anthropic.com>

* docs(learnings): add hybrid-mode screenshot

Visual reference of the stacked layout: DE-drawn titlebar on top
with native window controls, claude.ai's in-app topbar
(hamburger / search / back-forward) immediately below it.

Co-Authored-By: Claude <claude@anthropic.com>

* docs(learnings): fix codespell hit (Pre-emptive → Preemptive)

Codespell flags hyphenated "Pre-emptive" as a misspelling of
"Preemptive". Drops the hyphen to clear the spellcheck CI gate
on PR #538.

Co-Authored-By: Claude <claude@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>
2026-05-01 02:47:16 -04:00
CyPack
b5339d0f0b fix(doctor): warn on unknown COWORK_VM_BACKEND, document Cowork backend (#324)
Adds:

- `*)` case + valid-values warning on both `COWORK_VM_BACKEND` switches in `scripts/doctor.sh`, factored through a shared `_warn_unknown_backend` helper. Switch A explicitly matches the empty and `bwrap` cases as no-ops alongside `kvm|host` so only truly-unknown values trigger the warn. Switch B (user-facing summary) reports cowork_backend as `auto-detect (invalid override '...' — see warning above)` so the doctor is honest about what the daemon actually does (#442 tracks the daemon-side fix).
- `COWORK_VM_BACKEND` env var row + new Cowork Backend section in `docs/CONFIGURATION.md`, placed before Cowork Sandbox Mounts.
- VM connection timeout / virtiofsd PATH / Fedora tmpfs (EXDEV) sections in `docs/TROUBLESHOOTING.md`.
- README acknowledgment for @CyPack.

Closes #293

Co-Authored-By: aaddrick <aaddrick@gmail.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 23:09:41 -04:00
Charles Bonnissent
8ac73e6ba9 feat(bwrap): support {src, dst} mount form in coworkBwrapMounts (#531)
* feat(bwrap): support {src, dst} mount form for distinct host/sandbox paths

Extends coworkBwrapMounts (#339) so additionalROBinds and additionalBinds
accept entries of the form { src, dst } in addition to the existing string
form. This unlocks the persistent /tmp use case: the default --tmpfs /tmp
gets wiped between Bash tool calls because of --die-with-parent, and the
old string-only API (--bind p p) had no way to map a host directory under
$HOME onto /tmp inside the sandbox without exposing the host /tmp itself.

Validation:
- src: same checks as the string form (absolute, not in
  FORBIDDEN_MOUNT_PATHS, $HOME constraint when RW)
- dst: absolute and non-forbidden only — the $HOME constraint is
  intentionally skipped since the whole point of the form is to map
  outside $HOME (e.g. /tmp)
- malformed objects are filtered out with a warning, matching the
  existing string-validation behavior

Doctor (--doctor) renders the object form as "src -> dst" in both the
Python and Node parser branches.

100% backwards compatible: the string form is preserved unchanged. The 36
existing tests pass; 13 new tests cover accept/reject paths, mixed
string+object configs, the persistent-/tmp recipe end-to-end, and the
doctor rendering (58/58 total).

Closes #530

---
Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <claude@anthropic.com>

* docs(configuration): document {src, dst} mount form

Refs #530

---
Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <claude@anthropic.com>

* chore(bwrap): address PR #531 review feedback

- doctor: warn when an additional mount's dst lands on a default RO
  mount (/usr, /etc, /bin, /sbin, /lib, /lib64, or subpaths). bwrap
  honors the later mount, so the user's bind silently replaces the
  default — a config footgun, not an escape, but worth surfacing
  (RayCharlizard issue 1)
- docs(configuration): note the shadowing implication under
  "Distinct host/sandbox paths" (RayCharlizard issue 2)
- test(bwrap-config): pin the reject contract for dst under a
  forbidden path (e.g. /proc/self), beyond the existing exact-match
  case (RayCharlizard issue 3)
- bwrap-config: harmonize the rejected-mount warning text — the
  string-form path now reads "rejected mount" like the object-form
  variants (RayCharlizard issue 4)

Tests: 61/61 passing (3 new: 1 reject-subpath + 2 doctor shadow
positive/negative).

Refs #530

---
Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <claude@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>
2026-04-30 09:34:20 -05:00
Charles Bonnissent
e82975c789 feat: configurable bwrap mount points via claude_desktop_linux_config.json (#339)
Allow users to add/remove BubbleWrap sandbox mount points through a
dedicated Linux config file (~/.config/Claude/claude_desktop_linux_config.json),
separate from the official Claude Desktop config.

- Add validateMountPath(), loadBwrapMountsConfig(), mergeBwrapArgs()
  to cowork-vm-service.js
- Integrate config loading in BwrapBackend constructor
- Add _doctor_check_bwrap_mounts() to --doctor diagnostics
- Document coworkBwrapMounts in CONFIGURATION.md
- 33 new tests in cowork-bwrap-config.bats

Security: forbidden paths (/,/proc,/dev,/sys) always rejected,
RW mounts restricted to $HOME, critical mounts non-disableable.
Daemon restart required for config changes.

Fixes #339

Co-Authored-By: Claude <claude@anthropic.com>
2026-03-29 18:37:12 +02:00
aaddrick
9b4ac63323 fix: clean up CLAUDE_MENU_BAR boolean alias implementation
Follow-up to PR #299:
- Log original env var value instead of lowercased in alias resolution
- Use single quotes for literal string per style guide
- Document yes/no aliases in CONFIGURATION.md table
- Update noctuum's contributor entry for boolean alias work

Co-Authored-By: Claude <claude@anthropic.com>
2026-03-19 07:43:20 -04:00
noctuum
e1dbbc2c07 fix: accept boolean aliases for CLAUDE_MENU_BAR env var
CLAUDE_MENU_BAR=0 was silently ignored after 07c1388 added strict
validation. Since CLAUDE_USE_WAYLAND=1 establishes a boolean env var
convention, users naturally try 0/1 for other vars too.

Add alias resolution: 0/false/no/off -> hidden, 1/true/yes/on -> visible.
Named values (auto/visible/hidden) continue to work as before.
Invalid values still fall back to auto with a warning.

Fixes #298

Co-Authored-By: Claude <claude@anthropic.com>
2026-03-19 15:13:10 +07:00
aaddrick
07c1388a6b fix: add CLAUDE_MENU_BAR input validation, docs, and --doctor integration
Follow-up to #251: validate unrecognized CLAUDE_MENU_BAR values with a
warning and fallback to 'auto', document the env var in CONFIGURATION.md,
and report the setting in --doctor diagnostics.

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-28 16:10:18 -05:00
aaddrick
6a74c4fafe docs: restructure README into focused docs
Move build instructions, configuration, troubleshooting, and
uninstall guides to dedicated files under docs/. Replace hosted
screenshot URLs with repo-local images.

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-16 19:45:40 -05:00