Repository navigation
feat(alerts): choose alerts by kind and by PC - #2870
Conversation
Settings > Alerts gains Needs permission (split from Needs input, for agents that report they wait for a permission), Stopped on an error (OmO/GJC failed turns, off by default) and, with two PCs or more, which PCs alert this device. The choices ride with the push subscription, so the server leaves out what a device does not want for web push and the phone app alike, and every push names its kind. Defaults keep today's alerts.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
… of a pane still working
Adversarial review (Codex, Terra 6.1 fast, xhigh) and how each finding was handledNo HIGH. Eight MEDIUM; this PR's one fix round took the two that send a push against the device's choice:
Left as is (not reproduced end to end, or outside this PR's contract), for a follow-up if users hit them:
|
omo review at 37c1b1e: BLOCK on one reproduced MEDIUM, no HIGH
Changed tests pass at this head (106 in the reviewer's run); |
|
Merge note: Settings > Alerts gains Needs permission, Stopped on an error (off by default) and per-PC switches; server filters per push subscription; defaults unchanged. Screenshots approved by the lead (owner delegated). omo CLEAR at 37c1b1e; remaining MEDIUM (PC keyed by name) tracked in #2876 per the one-round rule; required checks green. |
## What Since #2870, `src/lib/i18n/settings.{ko,ja,zh}.ts` are 401 lines, so `src/lib/i18n.test.ts` "keeps each part file at 400 lines or fewer" fails on main and on every PR's Fast checks. ## How Move-only: the Settings > Phone & devices > Access rows move from `settings.*.ts` into new `settings-access.*.ts` files (39 lines each; `settings.*.ts` drop to 367). Each language's loader spreads both into the same `settings` part (`settings: { ...SETTINGS_KO, ...SETTINGS_ACCESS_KO }`), so the part-placement rules and `PART_FILES` are unchanged. No wording changes; CONTRIBUTING.md names the new files. ## Validation - `bun test src/lib/i18n.test.ts`: 22 pass (on origin/main: 1 fail, the 400-line cap). - Merged origin/main after #2869 (agent groups); no part file is over the cap (`settings.*.ts` 371 lines, the rest lower), so no further split was needed. - `bun run check fast` at 7d66c66 (heavy runner): all green (workflow syntax, generated files, typecheck, build, unit 11609 pass / 0 fail).
…ser tabs (#2885) ## What After a phone gets into Ovis in a mobile browser tab (not the home-screen app), one dismissible line under the header says how to add Ovis to the home screen, where alerts reach it: - **iPhone / iPad Safari:** "Add to Home Screen for alerts: [share glyph] Share → Add to Home Screen". iOS has no install prompt, so the line names the steps with Safari's share glyph. - **Android Chrome:** a one-tap **Install** button once Chrome fires `beforeinstallprompt` (it reuses `useInstallPrompt` from `lib/install.ts`). Before that, or in a browser that never fires it, the line reads "Install the app for alerts: Menu → Install app". It is hidden for good (`localStorage` `ovis:install-hint-dismissed`) once dismissed, or once this browser sees the app installed (`appinstalled`, display mode, or `getInstalledRelatedApps`). It never shows on desktop browsers, in the desktop app, in the iOS/Android apps (Capacitor), in the iPhone home-screen app (`navigator.standalone`), or over plain http, where an installed page gets no push alerts either. Design reference: the install banners in the Claude and ChatGPT mobile web apps: a single dismissible line, not a dialog or a sheet. It reuses the `.update-notice` layout shared by the other lines over the pane. ## Files - `src/lib/installHint.ts`: the show/hide rules (`installHintKind`) and the remembered dismissal. - `src/components/InstallHint.tsx` + `.css`: the line, placed with the other notices in `App.tsx`. - i18n: three keys in the devices part (en/ko/ja/zh). The share glyph goes in at a `{glyph}` placeholder that every translation keeps. - `scripts/install-hint-demo-regression.ts`: browser regression on the demo fixtures, added to `scripts/ci-browser.sh` and `docs/development.md`. ## Screenshots (390 px, before → after) Each image: before on the left, after on the right. iPhone Safari, light / dark: <img src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-light-ios.png" width="640"> <img src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-dark-ios.png" width="640"> Android Chrome, light (before Chrome's prompt: menu step) / dark (prompt offered: one-tap Install): <img src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-light-android-menu.png" width="640"> <img src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/compare-390-dark-android-install.png" width="640"> Korean, iPhone / Android with Install (full screens): <img src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/install-hint-390-light-ko-ios.png" width="300"> <img src="https://raw.githubusercontent.com/devswha/ovis/91abe427c14b0b14ee5b2bb66abc81e24d01152f/install-hint-390-light-ko-android-install.png" width="300"> ## Earlier Install button An earlier always-visible "Install app" sidebar button was removed because it never went away. This line is different: it appears only in phone browser tabs, one tap closes it for good, and it also leaves for good once the app is installed. ## Validation - `bun test src/lib/installHint.test.ts` failed before the module existed (`Cannot find module './installHint.ts'`) and passes now. It covers iPhone/iPad/Android/desktop/desktop app, installed, phone apps, dismissed, plain http and a storage write refusal. - `bun test src/lib/installHint.test.ts src/lib/i18n.test.ts src/conventions.test.ts src/lib/install.test.ts`: 60 pass. - `bun scripts/install-hint-demo-regression.ts`: PASS for light en, dark en and light ko. iPhone steps and share glyph, dismissal kept after reload, none in the home-screen app, Android menu step then Install calling `prompt()`, `appinstalled` remembered after reload, none on desktop even with a prompt, finger-sized targets, no sideways scroll at 390. - `bun run check fast`: on the merged head (17b409d): workflow syntax, generated types/themes, typecheck and build ok; unit tests 11580 pass, 1 fail. The failure is `src/lib/i18n.test.ts` "keeps each part file at 400 lines or fewer" on `src/lib/i18n/settings.{ko,ja,zh}.ts`. Those files are unchanged here and identical to main, so the failure comes from main since #2870. Run with `TMPDIR` on disk: this host's tmpfs is out of inodes, which otherwise fails `server/session-history.test.ts` and `server/claude-subagents.test.ts` with ENOSPC. - Not run: the full suite (CI runs it). Not tried on a real iPhone or Android device: Chrome device emulation only. Note: at 390 px the iPhone line wraps to two lines with the requested wording. The Android lines fit on one.
What
Finer alert choices per device in Settings → Alerts (part of #1490):
agent_kind,server/herdr-core/snapshot.ts reportedFacts) alerts under it; one that does not say what it waits for (herdr's TUI runtime today) still alerts as Needs input. Nothing is guessed from the screen.OmoRestfailed,server/completion.ts), off by default. Like a question, it waitsshortand the pane's next change calls it off.kind(input|permission|done|ended|error), and the permission body reads "waiting for your permission".Defaults keep today's alerts: an unset
permissionfollowsinput(so a device that had turned Needs input off does not start getting permission alerts),erroris off, and no PC is off.How
AlertPrefsgains optionalpermission,error,pcs_off;parseAlertskeeps only known values). The server filters per subscription inserver/push.ts, not the device's service worker: a web push the worker receives has to be shown (iOS takes the subscription away from a page that shows none), and the phone app's relay forwards whatever the PC sends. One filter covers web push, the iOS app and the Android app.paneGetthat already fetched the fresh title, nowlookupPane), so a device that wants only permissions waits in theshortgroup and is dropped at send time if the pane turns out to ask a question.local, and the phone app subscribes to each PC separately, so an id would silence every PC's own panes at once. The local name ishostname(), asserver/machines.tsnames it in the roster.alertsAllow/alertPcAllowedwith the pane'sagent_kindfrom the roster.ovis:alert-filters(src/lib/alertFilters.ts), likeovis:hidden-pcs, so an older tab rewritingovis:settingswhole cannot erase them. Not structural per docs/development.md. An older server ignores the extraalertsfields and keeps today's behaviour.Screenshots
Settings → Alerts, before and after, at 390 and 1280, light and dark, with a second demo PC (
laptop, switched off in the "end" shots). Lead has the images.Not covered
errorstate:agentStatusOfmaps it tounknowntoday, so it is not told. Only OmO/GJC failed turns are.Validation
bun run typecheck: clean.server/push.test.ts,server/push-health.contract.test.ts,src/lib/{alertFilters,droplet,notifications,settings,push,useNotifications}.test.ts,src/components/PushHealthNotice.test.tsx, the i18n and conventions tests: 313 pass. The three new server tests fail onorigin/main(checked by running them against the oldserver/push.ts).bun run check fastthrough the heavy runner (it ran on this PC once load allowed): exit 0.bun run check fulland the browser regressions (CI's Integration and browser job runs them).