Repository navigation
Browser displays in View areas, drawn by the desktop app - #164
Merged
Merged
Conversation
The browser moves into View areas as a desktop-drawn display, so the Herdr plugin pane that screencast a chromux profile goes: the `plugins/browser` host, the core's per-pane content and `status.chromux`, the Swift browser canvas, CDP session, pane controller and opener, the Explorer's Open in Browser Pane item, and the bundling of the host into the app. Reopen no longer prunes browser leaves from a closed tab. The operator's installed `hide.browser` plugin is left as it is.
A View area display gains a third kind, `browser`: a page with an address, a title and a runtime-only load stamp, and no document or tab, so the reconcile never binds or removes one and a restart shows it again at the address it last reported. - `browser_open` opens a page in the Workspace the payload names, else the one the pane `pane_id` works in, else the one in front, in its area in use; the same address again shows that page loaded again. A request that names itself gets a bounded receipt in `status.browser_opens`. - `view_layout` navigate loads a typed address; `browser_state` records where a page went and its title without loading anything. - The core holds only http, https, file and about:blank addresses, and refuses a file address in a Workspace on another device. - hided checks a `file:` address like any path: it decodes it, requires it under a registered checkout root, and forwards the URL of the checked path, or answers `path_refused`. - `hide browser open <url-or-path> [--pane <id>]` attaches to the running daemon (never starts one), sends one `browser_open` over the WebSocket, and prints the receipt or the refusal as one JSON line. The pane comes from `--pane` or `HERDR_PANE_ID`.
The desktop main process owns one WebContentsView per browser display the shell has shown, in a persistent `persist:hide-browser` session with a sandboxed renderer, context isolation, no Node and no preload. The shell reports where each display of the front Workspace sits through the `hideHost.browser` bridge; a page is created when first shown, hidden but kept alive while off screen (a move between areas never loads it again), closed with its display, which ends its renderer, and evicted past twelve live pages while hidden. - The bridge is bounded on both sides: every sync, capture and command is checked for shape, and only the top frame of the daemon-served shell may send one. - A shell overlay that meets a page (the palette, a menu, a dialog, a popover, a tab drag) cannot draw over a native view, so the page is captured, its still drawn in its place, and the page hidden until the overlay goes. - The display has a toolbar with Back, Forward, Reload or Stop and an address field; a failed load says so with Reload; a page's new window opens another browser display. - The Explorer offers Open in Browser on an HTML file of this Mac. - In a plain browser tab a browser display is a quiet notice with the address and, for the web, Open in browser.
The Browser chrome sheet loses the pane header a Herdr browser pane carried: the address toolbar is now a View area display's own strip, tab-strip high on the background with a bottom hairline, holding Back, Forward, Reload and the address field. The sheet adds its Loading (Reload turns to Stop), Load failed and Plain browser tab states.
The address field drops a web address's scheme until it is edited, so an area a third of the window wide still shows the host and port; focusing it selects the whole address. The browser e2e opens a window large enough for two View areas, closes a display through its menu's `close_view`, and launches with `--disable-backgrounding-occluded-windows`: the test window sits behind the operator's windows, and Chromium stops painting an occluded window, so a capture by window id showed a stale frame.
docs/BROWSER_PANES.md becomes docs/BROWSER_DISPLAYS.md: who owns a page (the core, hided, the web shell, the desktop app), the ways to open one, the `file:` address boundary, the page's session, permissions and lifetime, the overlay freeze, the states, and the e2e that verifies it. ARCHITECTURE gains the browser display kind in the View areas section, the `navigate` action, the receipts, the older-build compatibility of the layout file, and the `file:` URL check in the checkout boundary; the desktop host's bridge now names `browser`. UI_BEHAVIOR describes the view as the operator sees it, and loses the Browser plugin surfaces the chromux path had.
With the browser pane gone, no pane carries a content consequence, so the pane prompt's special case, the tab and workspace prompts' appended sentences, and the test built on a hosted viewer go with it.
check-no-workstation-identity.sh allows /Users/example only.
The web kept what each page said, and the last report it sent, for every display id it had seen; both now drop a front Workspace's display once the layout no longer holds it, which is when the desktop app closes its page. A `browser_state` for a display that is gone, a page's last report racing its close, leaves a `browser.state_stale` diagnostic instead of nothing. The browser e2e also drives a page's `window.open`: it becomes another browser display of the Workspace, and the app keeps one window.
Focusing the address field swaps the shown host for the whole address, and replacing an input's value drops its selection; the select ran a frame later, so a key typed within that frame, or a select-then-focus fill, landed after the old address instead of replacing it. The field now selects in the layout effect of the commit that swaps the value.
The spec sized its window to the screen, so a runner's 1024-point screen gave the View areas too little room beside the Agents area and the Explorer, and Split right was disabled. The window is now a fixed 1024x640, asserted after it is set; the split and resize steps run in Views only with the Explorer hidden, and the Explorer shows only for its own step. Each wait for a page to sit on its slot now reads the slot on every poll: the expected bounds were read once, right after the resize and before the shell laid out again. The address step clicks the field and checks the whole address before typing, as a person does.
Brings in the ⌘K palette (#161), weekly usage (#162) and the desktop app's macOS pane chords (#160). The desktop bridge keeps both sides: `reportBindings` from #160 beside `browser`, the channels of both, and the e2e's bridge keys list all four. The bindings listener now uses the host's one shell-frame check, `fromShell`, which the browser channels already use. main's new shortcut import test no longer names the removed `chromux_enabled`. The contract carries both sides and web/src/generated/hided-ws.ts is the generator's output; the design library holds both parents' boards, the browser toolbars sheet from this branch and the weekly usage sheet from main.
yansfil
added a commit
that referenced
this pull request
Sep 26, 2026
…PATH (#166) Related: #149 (the desktop host) ## Summary Finder나 Dock에서 연 패키지 hide.app은 launchd의 PATH(`/usr/bin:/bin:/usr/sbin:/sbin`)로 시작합니다. 운영자 머신에서 5초 로그인 셸 조회가 실제 zsh rc(웜 2.4초, 콜드는 더 김)에 타임아웃됐고, 창이 "hide CLI not found"에 머물렀습니다. 이제 CLI 탐색 순서는 `HIDE_CLI_PATH` -> (비패키지) 워크트리 빌드 -> PATH -> 마지막으로 붙은 CLI -> 로그인 셸 PATH(패키지만, 10초) -> `~/.local/bin`, `/opt/homebrew/bin`, `/usr/local/bin`입니다. 붙은 CLI는 프로필의 `cli-path.json`에 기억되어, 두 번째 실행부터는 느린 로그인 셸을 부르지 않습니다. 실패 화면은 그대로이고, 시도한 경로는 모두 한 번씩 로그에 남습니다. ## Review - **판단해 주세요**: 기억한 경로를 PATH 뒤, 로그인 셸 앞에 둔 순서. 로그인 셸이 운영자 의도의 권위지만 비싸서, 기억한 경로가 그 캐시 역할을 합니다 - **판단해 주세요**: 로그인 셸 타임아웃 10초(VS Code `shellEnvironmentResolutionTimeout` 기본값). 실패는 캐시하지 않아 Retry가 다시 묻습니다 - **조심해서 볼 파일**: `desktop/src/main/cli.ts` - `resolveCli`가 async가 됐고 로그인 셸은 앞 단계가 모두 빗나갈 때만 호출됩니다 - **조심해서 볼 파일**: `desktop/src/main/host.ts` - failure path: 로그인 셸 조회 중 quit/Retry, `hide connect` 성공 뒤에만 기억을 씁니다 - **조심해서 볼 파일**: `desktop/src/main/env.ts` - `HOME`을 레지스트리에 추가. Electron `app.getPath("home")`은 `HOME`을 무시해 격리 QA가 운영자 CLI를 찾았습니다 - **조심해서 볼 파일**: `desktop/e2e/fixture.ts` - 이미 떠 있는 데몬에 다시 붙는 relaunch는 `relaunch()`로 메인 프로세스에서 창을 읽습니다(아래 Evidence) - 로그인 셸은 shell-env처럼 `/usr/bin/env DISABLE_AUTO_UPDATE=true ZSH_TMUX_AUTOSTART*=...`로 감싸 Oh My Zsh 업데이트 프롬프트와 tmux 자동 시작을 막습니다 - 설치 디렉터리 목록은 Swift 앱 `RuntimeEnvironment.swift`의 fallback과 같습니다. `jsonFile.ts`는 `windowState.ts`의 원자적 쓰기를 뽑아낸 것입니다 ## Evidence - **확인한 것**: `pnpm --dir desktop typecheck`, `lint`, `test`(30개, 새 순서 테스트 6개와 기억 파일 파싱, 실제 `/bin/sh` 로그인 조회 포함) 통과 - **확인한 것**: `pnpm --dir desktop e2e` 8/8, 새 `discovery` 테스트: PATH를 launchd 값으로, `HIDE_CLI_PATH` 없이, 워크트리 밖으로 복사한 앱에서 `~/.local/bin`으로 붙고 `cli-path.json`을 쓴 뒤 재실행은 `remembered`로 붙음 - **확인한 것**: 패키지 앱(`pnpm --dir desktop package`)을 `env -i`로 launchd 같은 환경, 비공개 HOME/state/profile/socket으로 세 번 실행 - 3초 걸리는 가짜 로그인 셸 -> `login`으로 붙고 기억 (`cli.login_path` elapsed 3243ms) - 멈추는 셸 + 기억 있음 -> 셸을 부르지 않고 `remembered`로 0.1초 안에 붙음 - 멈추는 셸 + 기억 없음 -> 10004ms에 타임아웃, `~/.local/bin`에서 `well-known`으로 붙음. 사건 시나리오 그대로 - 각 실행 뒤 비공개 데몬을 `hide stop`, 남은 프로세스 없음. 운영자 hided와 상태 디렉터리는 건드리지 않음 - `python3 -m unittest discover -s scripts/tests`(39), `check-no-workstation-identity.sh`, `check-no-attribution.py` 통과 - **확인한 것**: #164 병합 뒤 CI의 `discovery` 실패는 relaunch 경합이었습니다. 로컬 반복에서 기존 `lifetime`도 같은 모양으로 실패했습니다 - 재실행이 수십 ms 만에 붙으면 Playwright가 status 페이지 -> 데몬 origin 렌더러 교체를 놓칩니다. page가 `file://`에 머물거나 window 이벤트가 안 옵니다 - 탐침 스펙으로 확인: 놓친 경우에도 창은 데몬 URL, 로딩 끝, 보임, 셸 DOM 있음. 제품 문제가 아니라 테스트 관측 문제입니다 - 그래서 두 relaunch는 메인 프로세스로 창을 읽고, cleanup의 `rmSync`는 ENOTEMPTY를 재시도합니다(main에서도 16회 중 1회 재현) - 고친 뒤 `lifetime`/`discovery` 반복 30회 통과(운영자 화면 때문에 중간에 멈춤). e2e 창은 여전히 화면에 뜨며, 숨김 실행은 이 PR에 넣지 않았습니다 - **확인하지 못한 것**: Finder/Dock에서 실제로 연 실행(launchd가 준 환경 그대로)과 운영자의 실제 zsh rc. 위 검증은 `env -i`와 가짜 셸로 흉내낸 것입니다 - **확인하지 못한 것**: Playwright는 앱을 비패키지로 띄우므로 e2e는 로그인 셸 단계를 지나지 않습니다. 그 자리는 단위 테스트와 위 패키지 수동 실행이 덮습니다 - **확인하지 못한 것**: Rust, Swift, web 레인은 이 diff가 건드리지 않아 로컬에서 돌리지 않았습니다. CI가 돌립니다
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #155
Summary
웹 페이지를 Herdr browser pane(chromux screencast) 대신 View area의 display로 엽니다.
core는
DisplayKind::Browser로 어떤 페이지가 어디 있는지를, desktop 앱 main process는 display마다 하나인WebContentsView로 페이지 자체를 소유합니다.여는 길은
hide browser open <url|path>, Explorer의 Open in Browser(HTML 파일), 페이지의 새 창, toolbar 주소창입니다.⌘K, 메뉴, dialog, 탭 드래그가 페이지를 덮으면 페이지를 캡처한 still로 바꿔 overlay가 위에 그려지고, 일반 브라우저 탭에서는 조용한 안내와 Open in browser만 보입니다.
chromux 경로(
plugins/browser, corechromux.rs/pane_content.rs, SwiftBrowser*.swift,BrowserPaneOpener)는 지웠습니다.Review
p0Do2, Browser file diff toolbars)는 사람 승인 없이 그렸습니다. 모양과 문구를 봐 주세요.browser.download만)입니다. 확인 창이나 위치 제한이 필요한지.file:페이지가 제 링크로 checkout 밖 파일로 이동하면 그 view에는 보이고, core 기록만 boundary에서 거절됩니다(재실행 시 마지막 허용 주소). 페이지 이동도 막을지.desktop/src/main/browser.ts,browserSync.ts- failure path와 수명: 페이지 생성/숨김/파괴, 12개 live cap, IPC 신뢰 검사.hided/src/server.rsbrowser_url,hided/src/file_url.rs- 경계:file:URL을 decode해 checkout root 검사 후 검사한 경로로 다시 씀.herdr-core/src/runtime/view_areas.rs- runtime mutex 안의 일: open/navigate/state 기록, receipt 8개 cap, I/O 없음.herdr-core/src/model.rs- snapshot wire: display의url/title/load,status.browser_opens,status.chromux삭제.hide browser open은 실패 시 JSON을 찍고 exit 2입니다(기존hideCLI 관례). agent가 쓰기에 이게 맞는지.Evidence
desktop/e2e/browser.spec.ts가 직접 띄운 desktop 앱과 private hided, 격리된 Herdr(HERDR_SOCKET_PATH)에서 한 흐름을 끝까지 돕니다.--pane으로 열기, native view bounds = slot bounds, 한글insertText, split과 창 resize에서 renderer pid와 페이지 마커 유지.window.open이 새 display(창 1개 유지).127.0.0.1:1실패 안내와 Reload, Explorer의리포트 1.html열기, checkout 밖 파일outside_checkout거절.3f6b1ee6에서 PR check 7개(verifyrun 36211315961의 job 6개와 Design contract)가 모두 통과했고, runner에서 desktop e2e 6개가 통과했습니다.e4cffeb3로 합쳤습니다. 충돌은 desktop bridge(reportBindings와browser를 함께 유지), channel, preload, e2e bridge 키, ARCHITECTURE 한 줄이었습니다.chromux_enabled를 쓰고 있어 고쳤습니다.hided-ws.ts는 generator 출력과 같고, 디자인 라이브러리는 두 부모의 보드(p0Do2, weekly usage)를 모두 가집니다.e4cffeb3에서 PR check 7개(verifyrun 36213739656의 job 6개와 Design contract)가 모두 통과했고, runner에서 web e2e 63개와 desktop e2e 8개가 통과했습니다.83321656)을 merge commit8a2ce77d로 다시 합쳤습니다(충돌 없음, desktop/core 변경 없음). 로컬 web typecheck, lint, unit 352개, e2e 63/63이 통과했습니다.8a2ce77d에서 PR check 7개(verifyrun 36215350833의 job 6개와 Design contract)가 모두 통과했고, runner에서 web e2e 63개와 desktop e2e 8개가 통과했습니다.insertText로만 확인했습니다.lifetime테스트가 재실행 중 한 번 firstWindow timeout으로 실패했고 재시도 3번은 통과했습니다(이 변경 전부터 있는 흐름).design/hide-ui.lib.pen의p0Do2시트 하나만 바뀌었습니다(Pen 헤드리스로 생성).Breaking change
workspace-views.json에 browser display를 저장한 뒤 이전 빌드로 되돌리면, 이전 빌드는 그 파일을 읽지 못해 옆으로 치우고 Main에서 시작합니다.AI tooling: 대부분 AI 도구. e2e 스크린샷, 리뷰 결과, 문서와 코드의 대응을 손으로 대조했습니다.