Skip to content

Desktop notifications on Windows and Linux, and a Needs You count on the app icon - #999

Merged
yansfil merged 7 commits into
mainfrom
feat/notify-cross-os-badge
Oct 12, 2026
Merged

yansfil merged 7 commits into
mainfrom
feat/notify-cross-os-badge

Conversation

@yansfil

@yansfil yansfil commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #975 (first-run onboarding의 데스크톱 알림)

Summary

#975의 데스크톱 알림은 macOS 기준으로만 만들어져, Windows와 Linux에서 실제 OS 알림이 어떻게 동작하는지 아무도 본 적이 없었습니다.
Electron 44.4.5 소스를 대조해 찾은 빈틈을 메우고, 알림과 같은 스위치 아래에 앱 아이콘 배지를 더했습니다.

  • Windows 첫 토스트 경합: 시작할 때 Electron의 알림 presenter를 미리 만들어, Start Menu 바로가기와 toast activator를 만드는 작업이 첫 토스트보다 먼저 돕니다(기다리지는 않습니다). macOS는 presenter를 만들면 권한을 묻기 때문에 하지 않습니다(D-02).
  • Windows, 종료 뒤 클릭: 토스트 XML을 직접 써서 launch에 알림 id를 담습니다. Action Center에서 Hide가 꺼진 뒤 누른 클릭은 Notification.handleActivation으로 들어오고, 셸이 live snapshot을 가진 뒤 그 에이전트를 엽니다.
  • Linux 알림 서비스 없음: failed를 처리합니다. Linux에서 알림이 실패하면 다음 알림이 뜰 때까지 permission이 no_service가 되어 마법사와 Settings가 This desktop has no notification service...를 보여 줍니다. 알림은 계속 시도합니다. 모든 실패는 내용 없이 notify.failed로 로그에 남습니다.
  • 앱 아이콘 배지: 모든 기기의 Needs You 그룹에 있는 루트 에이전트 수를 보여 줍니다(Done 제외, 0이면 없음). macOS Dock, Linux launcher, Windows는 작업 표시줄 overlay 점이고 개수는 접근성 설명으로 들어갑니다. 셸이 live가 아니면(연결 중, 실패, 데몬 잃음) 지웁니다.

화면 변경은 Settings > General 알림 그룹의 안내 한 줄뿐입니다: Sent only while no Hide window is in front; the app icon marks agents that need you. (en/ko/zh-CN/ja).

Review

  • 판단해 주세요: 배지가 알림 스위치(Notify me when an agent needs me)를 따릅니다. 끄면 배지도 없어져 Hide가 완전히 조용해집니다. 따로 끄는 행은 만들지 않고 기존 안내에 한 구절만 더했습니다.
  • 판단해 주세요: Windows 배지는 숫자 대신 고정된 amber 점(dark --warning)이고 개수는 설명으로 들어갑니다. VS Code처럼 renderer에서 숫자를 그리려면 bridge가 이미지를 받아야 해서 택하지 않았습니다.
  • 판단해 주세요: 배지 수와 Overview 버튼 점의 수는 다릅니다. 배지는 모든 기기의 raised needs_you(루트, 미해결, Factory worker 포함)를 더하고, Overview는 선택한 기기의 overview_needs_you(위임 자식 포함, Factory worker 제외)입니다. 같은 수로 맞출지 정해 주세요.
  • 판단해 주세요: Linux no_service는 다음 알림이 뜨면 풀립니다. 스위치가 꺼져 있고 Factory 알림도 없으면 재시작 전까지 다시 시도할 알림이 없어 그대로 남습니다.
  • 판단해 주세요: Windows failed는 로그에만 남깁니다. Windows에는 항상 알림 서비스가 있고 실패 원인은 운영자의 Windows 설정이나 집중 지원이라서, no_service라고 하면 틀린 말이 됩니다(설계 원칙 13).
  • 조심해서 볼 파일: desktop/src/main/host.ts - 클릭을 여는 경로가 이제 셸의 배지 보고(reportBadge)를 "셸이 live snapshot을 가졌다"는 신호로 씁니다(ClickGate). 상태가 attached를 벗어나면(enter) 배지를 지우고 클릭은 다음 보고까지 보류됩니다(마지막 클릭만).
  • 조심해서 볼 파일: desktop/src/main/notify.ts toastXml - Electron의 기본 토스트(제목/본문 두 줄, ToastGeneric)를 그대로 따라 썼고 launch만 더했습니다. 근거는 windows_toast_notification.cc GetToastXml에 launch가 없다는 점입니다.
  • 조심해서 볼 파일: web/src/agentNotices.ts needsYouCount - 기기별 scope의 raised needs_you(미해결, 위임 아님, 그 기기가 그리는 pane)를 더합니다. navigator 전체 scope에는 이 그룹이 없고, 사이드바는 한 번에 한 기기만 보여 주기 때문입니다.
  • 비용 검토: 셸은 개수가 바뀔 때만 IPC 한 번을 보내고, host는 같은 값이면 아무것도 하지 않습니다. 알림 권한 읽기는 답이 바뀔 수 있는 macOS와 Linux에서만 화면이 열려 있는 동안 2초마다 반복합니다. Linux는 subprocess 없는 즉답입니다.

Evidence

  • 확인한 것: bash scripts/verify-web.sh 통과(web 158 파일, desktop 18 파일 unit, typecheck, lint, build). node scripts/check-design-contract.mjs 통과.
  • 확인한 것: unit - badgeRequest, toastXml/launchedId 왕복, 이스케이프와 XML이 거부하는 제어 문자 제거, overlayDot, ClickGate(live 전 클릭은 마지막 것만 보류, 셸이 사라지면 다시 보류), Linux 실패 뒤 no_service와 다음 성공에서 해제(Windows는 그대로), needsYouCount 기기 합산, 배지는 live 전에는 보내지 않고 바뀔 때만 보내며 스위치를 끄면 0을 보냅니다.
  • 확인한 것: Windows 이름과 아이콘은 코드 변경이 필요 없습니다. @electron/packager 20.3 win32.js가 exe의 ProductName을 opts.name(hide)으로, 아이콘을 resources/hide.ico로 쓰고, Electron은 바로가기 이름을 이 ProductName에서 가져옵니다(application_info_win.cc:36, windows_toast_activator.cc:244).
  • 확인한 것: 실행 직후 Start Menu 바로가기. 처음 세 번의 CI에서 hide.lnk가 생기지 않았고, 진단으로 원인을 찾았습니다. activator의 CLSID 레지스트리 키는 써졌으니 작업은 돌았지만, Electron이 SHGetKnownFolderPath(FOLDERID_Programs, 0)로 폴더를 찾고 이 호출은 폴더가 없으면 실패해 CreateDirectory 전에 돌아갑니다(windows_toast_activator.cc:239-247). fixture의 격리된 AppData에는 Start Menu가 없었습니다. 실제 Windows 프로필에는 늘 있으므로 fixture가 이 폴더를 만든 뒤, 알림 없이 실행만으로 hide.lnk가 생기는지 단언합니다.
  • 확인하지 못한 것: host 상태 전이(데몬을 잃을 때 배지 지움, failed 연결)의 자동 테스트. ClickGate만 unit으로 떼어 냈고 나머지는 host가 Electron에 묶여 있어 테스트하지 않았습니다.
  • 확인하지 못한 것: 로컬 desktop e2e. 이 Mac의 디스크가 거의 차서(작업 중 150 MiB까지 떨어짐) debug hided 빌드를 하지 않았고, macOS desktop e2e와 windows desktop은 CI에서 확인합니다.
  • 확인하지 못한 것: 실제 기기가 필요한 것들입니다. Windows 10/11의 첫 토스트, 종료 뒤 Action Center 클릭, 폴더를 옮긴 뒤의 클릭, 작업 표시줄 overlay 모양, 데몬 없는 Linux 데스크톱, 서명된 macOS 빌드의 Dock 배지와 알림 전달.
  • 알려진 Electron 동작: 폴더를 지우면 Start Menu 바로가기가 남고, 폴더를 옮기면 Electron이 다음 실행에서 바로가기를 다시 씁니다(ExistingShortcutValid).
  • 알려진 Electron 동작: macOS [Bug]: Notification 'click' never emitted on macOS for banners presented while the app is frontmost electron/electron#51885 때문에 Hide가 앞에 있을 때 뜬 배너를 누르면 click이 오지 않습니다. 에이전트 알림은 Hide 창이 키보드를 갖지 않을 때만 뜨므로 거의 영향이 없습니다. Factory 알림과 테스트 알림은 Hide가 앞에 있어도 뜨므로, 그 클릭은 아무것도 열지 않을 수 있습니다.
  • 알려진 Electron 동작: Windows가 실행 중인 앱에도 COM activation과 in-process click을 둘 다 보내면 같은 에이전트를 두 번 엽니다. 결과는 같은 pane focus입니다.

…You on the app icon

Windows: build the notification presenter at launch so the Start Menu
shortcut and toast activator exist before the first toast, and write each
toast's XML with a launch that names the notification, so a click in Action
Center after Hide quit opens what it named once the shell is live.

Linux: a notification that fails to show turns the permission to no_service
for the rest of the run, which the wizard and Settings show; every failure
is logged as notify.failed without its words.

The app icon counts the root agents in every device's Needs You group under
the notifications switch: the Dock badge on macOS, launcher counts on Linux
and a taskbar overlay dot with the count as its description on Windows.
…lves, and log whether launch built the notification presenter
…ication that shows lift no_service

Every host state change goes through one place, so the daemon lost clears
the icon as connecting and failed do, and a click waits for the shell's next
report there too (ClickGate, now unit tested). A Linux no_service answer
lasts until a notification shows again rather than for the run, and every
notification is still tried. The Settings note says the icon marks agents,
true of the Windows dot too; the permission is read again only where it can
change; control characters XML refuses are left out of a toast; a failed
notification is no longer also logged as shown.
… the shortcut right after launch

Electron's EnsureShortcut asks SHGetKnownFolderPath(FOLDERID_Programs, 0)
for the folder, which fails when it is missing, and returns before it would
create it (windows_toast_activator.cc:239-247). The fixture's redirected
AppData had no Start Menu, so the task ran (its activator CLSID key was
written) but no shortcut could land; a real profile always has one.
@yansfil
yansfil merged commit e0db8d6 into main Oct 12, 2026
22 checks passed
@yansfil
yansfil deleted the feat/notify-cross-os-badge branch October 12, 2026 11:38
yansfil added a commit that referenced this pull request Oct 12, 2026
…y system as the bar (#1007)

## Summary

OS마다 다른 기능이 여러 문서에 흩어져 있었고, `docs/INSTALL.md`의 시스템별 표와 설치 문장 일부는 낡아
있었습니다.
이 PR은 "모든 에이전트와 기능은 macOS, Windows, Linux 모두에서 동작한다"를 기준으로 적고,
INSTALL.md의 "What each system supports" 표를 시스템별 상태의 유일한 기록으로 만듭니다.
지원하지 않는 칸은 이유와 무엇이 바뀌면 닫히는지를 적고, 동작을 바꾸는 PR이 같은 변경에서 그 칸을 고치도록
`AGENTS.md`에 규칙을 넣었습니다.
문서만 바뀝니다.

## Review

- **판단해 주세요**: 표에 새로 드러난 공백 두 가지: 다른 머신으로 core 옮기기는 macOS만(로그인 항목이
launchd 전용), Windows는 device node가 안 됨.
- **판단해 주세요**: Linux의 앱 아이콘 개수는 폴더 패키지가 `.desktop` 항목을 설치하지 않아
"unverified"로 적었습니다.
- **조심해서 볼 파일**: `AGENTS.md` - 모든 에이전트가 읽는 규칙. 새 절 하나만 추가했고, 기존 문구를 확인하는
`snapshot_delta.rs` 검사는 그대로입니다.

## Evidence

- **확인한 것**: 고친 문장마다 코드와 대조했습니다.
- Herdr 소켓 기본값의 Windows `%APPDATA%\herdr`:
`hide_platform::host::herdr_config_dir_from`.
- core 로그인 항목은 macOS 전용:
`hide_platform::user_agents::UserAgents::current`.
- 첫 실행 보류는 기본으로 켜지는 Claude Code와 Codex에만 걸림:
`hide-kit/src/agent_kit.rs`.
- Windows의 시작 메뉴 항목과 CLSID 키: #999 `desktop/src/main/host.ts` 및 Windows
패키지 검사의 `hide.lnk` 확인.
- `herdr integration uninstall`: 번들 Herdr 0.9.3의 `herdr integration
--help`.
- **확인한 것**: `check-no-workstation-identity.sh`,
`check-no-attribution.py`, `test_harness_namespace.py` 통과.
- **확인하지 못한 것**: 링크 앵커는 GitHub 렌더 규칙으로 맞췄지만 렌더된 페이지에서 눌러 보지는 않았습니다.
yansfil added a commit that referenced this pull request Oct 12, 2026
Related: PRD `agents/prd/settings-left-nav/prd.md` (local); sibling run
sidebar-titlebar-refresh shares `diagnosticsText` in
`web/src/settings.ts`

## Summary

- Today Settings is a 720 px dialog with six tabs in a row, each page
carrying a description sentence. Notifications are split between General
and Mobile, and GitHub and About sit below General.
- Settings is now an 880 px dialog, opened with the same ⌘, and the same
entry points. A left list groups the pages into `App` (General,
Notifications, Devices, Shortcuts) and `This Mac` (Agents, Hide AI,
Mobile, GitHub), with About pinned at the bottom.
- Notifications is a new page: this machine's notification rows (desktop
only) and the Phone push choice moved there from Mobile. GitHub and
About moved out of General into their own pages. The row content and
behavior did not change.
- Each page shows only its title. The page descriptions and the
`settings.connections`/`settings.about` group titles were removed from
all four locales.
- The list is a Radix vertical Tabs: Up/Down/Home/End move through it
and show each page. On a short window the page scrolls on its own and
the list does not move.

![왼쪽이 지금, 오른쪽이 바뀐 Settings: 가로 탭과 탭 설명이 왼쪽 목록(App / This Mac, 맨 아래
About)으로, 알림은 Notifications 한
페이지로](https://github.com/yansfil/pr-assets/blob/main/hide/settings-left-nav/5a01624/before-after.png?raw=true)
![Electron 데스크톱 e2e(dark)에서 연 Settings > Notifications: 이 기계 알림과 Phone
푸시가 한
페이지](https://github.com/yansfil/pr-assets/blob/main/hide/settings-left-nav/5a01624/desktop-notifications-crop.png?raw=true)

## Review

- **판단해 주세요**: in the first image, whether the 200 px list width and the
Notifications page with the machine group title (This Mac) above the
Phone group read well.
- **판단해 주세요**: the machine group label follows the browser's guess (This
Mac / This PC / This computer), the same as the existing machine label;
it is not the core's machine name (PRD D-07).
- **조심해서 볼 파일**: `web/src/SettingsSheet.tsx` - focus order and scroll
ownership (the page panel scrolls, the list stays still); a regression
shows up as keyboard focus trapped or the list scrolling away.
- **조심해서 볼 파일**: `web/src/settings/NotificationsTab.tsx` - the push
choice moved from Mobile; it sends the same `set_push_mode` event as
before.
- **조심해서 볼 파일**: `scripts/pen-screens-settings.mjs` - one sheet builder
now draws Settings for the Settings, onboarding, Mobile and core-move
boards; `design/hide-screens.pen` is its output.

## Evidence

- **확인한 것**: web Playwright e2e, 54 passed across 19 spec files before
merging main, and the 12 Settings-related specs (26 tests) again after
it. They cover the list groups and order, keyboard movement, the 720x480
window (page scrolls, list does not move, About visible, list overflow 0
px), push via Notifications, and language switching.
- **확인한 것**: desktop Electron e2e: first-run, overview-modal and
tab-names passed (5 tests), before and after merging main; first-run
opens Settings > Notifications in the real Electron window and captures
it (second image).
- **확인한 것**: `sasu implement verify` (`verify-cargo.sh test` and
`lint`), `verify-web.sh` (web 1465 + desktop 177 unit tests, typecheck,
builds) and `check-design-contract.mjs` passed after merging main.
- **확인한 것**: gallery captures (light, dark, Korean at 17 pt, 720x480)
and Pen exports of the settings boards were compared by eye against the
approved mock.
- **확인하지 못한 것**: no manual check on a packaged `hide.app`;
`/Applications/hide.app` and the operator's Herdr were left untouched.
The desktop `local-kit` spec was skipped because it needs
`HIDE_E2E_APP`.
- **확인하지 못한 것**: Pen does not render SVG icon marks, so the list icons
are empty in `hide-screens.pen`; the web shell draws them.
- **확인하지 못한 것**: the first `verify-cargo.sh test` run failed once in
`node_session_activity::serve_preserves_kit_protocol_alongside_activity`
with EAGAIN (os error 35) on spawn under parallel load. It passed 3/3 in
isolation and in the two full runs after it. This PR changes only doc
comments in Rust.
- **생성물**: `design/hide-screens.pen` (about 25 MB to 27 MB) is
regenerated by `node scripts/gen-screens.mjs`. If
sidebar-titlebar-refresh lands first, regenerate it rather than
hand-merge it.

<details><summary>Verification record</summary>

- PRD: `agents/prd/settings-left-nav/prd.md` (sha256
5fbb32ea903bf3ebaf9aec0707c9bace5e3dc5786675b45475870a600c0b4c14)
- Base 5993a59 → head fea62d3, verified 2026-10-12T12:34:55.689Z: PASS
- Verification report:
`agents/runs/settings-left-nav/verification-report.json` and
`agents/runs/settings-left-nav/verification-report.md`; source
fingerprint
4b9e554f1fd391575fb05d1131db7218d3d25cbeb252d698bcff694a87eba31b
- Suites:
  - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0)
  - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0)
- Reviews:
- Fidelity (first pass, before 3c6482e): Fix now 2, both fixed in
3c6482e: the Hide AI spec measured an element that does not scroll
(the page panel is now the scroller and the spec measures
`[data-settings-page]` at 720 px); the Pen sheet showed This Mac on
Windows/Linux states (a machine parameter was added).
- Code (first pass, before 3c6482e): Fix now: stale comments that
still named the old General/Connections/About layout, fixed in
3c6482e.
- Fidelity + Code follow-up on e350221: no Fix now. Follow-up:
UI_BEHAVIOR said "Tab enters the page", fixed in 5a01624.
- Fidelity + Code follow-up on 5a01624 (doc-only diff): no Fix now; it
checked the new Tab-order sentence against the DOM order in
`SettingsSheet.tsx`.
- Fidelity + Code follow-up on e47768b (merge of main with #999 and
#1001): no Fix now; confirmed #999's Linux no-service condition and new
note survive on the Notifications page and nothing #999 put in the old
group is missing. Its one follow-up, a stale catalog comment in
`firstRun.ts`, is fixed in eac3ef0 (comment only).
- Merge fea62d3 (main with #995): one conflicting line in
`docs/DESIGN_WORKFLOW.md` (this branch's onboarding `scale`/`page` query
with main's Memory `start_failed` state), resolved by keeping both; no
Settings, design or i18n file overlapped, so no separate review ran on
it.
- Follow-up improvements (not in this PR): ARIA roles for the group
labels inside the tablist; the `hided-ws.schema.json` description still
names the old Settings place (the PRD freezes that contract); there is
no e2e assertion of the full Tab order (list, chip, Close, panel); the
code comment at `SettingsSheet.tsx:81` is less precise than the doc; the
D-07 This Mac label versus the core's machine name.
- Evidence: 11 registered (9 screenshot, 2 log); paths are local to the
run directory
  - agents/runs/settings-left-nav/capture/before-after.png
  - agents/runs/settings-left-nav/capture/general-light.png
  - agents/runs/settings-left-nav/capture/notif-light.png
  - agents/runs/settings-left-nav/capture/agents-dark.png
  - agents/runs/settings-left-nav/capture/hideai-ko-large.png
  - agents/runs/settings-left-nav/capture/notif-small.png
-
agents/runs/settings-left-nav/capture/desktop/first-run-settings-notifications.png
- agents/runs/settings-left-nav/design/export2/screen-settings-light.png
- agents/runs/settings-left-nav/design/export2/screen-settings-dark.png
  - agents/runs/settings-left-nav/notes/e2e-2.log
  - agents/runs/settings-left-nav/notes/desktop-e2e.log
- Changed paths: 40 (see Files changed)
- Delivery: mode pr, branch `gen-prd/settings-left-nav`, base `main`

</details>
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