rouse-context/docs/notifications/index.html
Jason Monk ad628ae545
Fix #347: Client-subject notification copy + deep-link taps + Manage action (#362)
* Fix #347: Client-subject notification copy + deep-link taps + Manage action

Rewrite per-tool-call and session-summary notification copy per the locked
#342 design, wire up notification tap deep-links, and add a Manage action
button.

Per-tool-call notifications now read "${clientLabel} used ${humanized(toolName)}"
with the integration display name as body and the call timestamp rendered
natively via setWhen(). Session-summary notifications partition by client
label and emit one notification per client titled "${clientLabel} used
${count} ${tool|tools}" with up to 3 unique humanized tool names in the
body (Oxford comma, "and N more" past the cap).

Tap deep-links route to the audit-history screen — scrolled to the
specific call (per-tool-call) or filtered to the session time window
(summary) — and a single Manage action button points at the integration
manage page (or home, when a summary's calls span multiple integrations).

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* Update integration tests for per-client summary notification ids

#347 changed SessionSummaryNotifier from a single-id summary to one
notification per client, keyed by the clientLabel hash. The existing
:app:integrationTest fixtures still asserted against the legacy
SessionSummaryNotifier.NOTIFICATION_ID constant, so they failed in CI.

Updated each affected test to compute the expected id via
SessionSummaryNotifier.idForClient(<clientLabel>) and dropped the
now-unused NOTIFICATION_ID companion constant. The InMemoryTokenStore
resolves clientName=null to the clientId, so for tests that pass
clientName=null the expected label is their clientId string (e.g.
"race-test", "multi-test", "runtime-mode-switch"). ToolCallHappyPathTest
passes clientName = "Test Client" explicitly.

Also retargeted the MultiToolSessionTest title-string assertion from the
old "{count} calls across {N} integrations" copy to the new
"{clientLabel} used {count} tools" title shape.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

* Move summary notification id bucket below per-call range

The previous summary id bucket (6000..15999) overlapped with
PerToolCallNotifier.BASE_ID = 7000, so any clientLabel whose hash
.mod(10000) landed in 1000..9999 produced an id that collided with
per-call notifications. RuntimeNotificationModeSwitchTest failed in CI
because its clientLabel "runtime-mode-switch" hashes to
idForClient(...) = 7465, which the test's "id >= PerToolCallNotifier.BASE_ID"
probe flagged as a per-call notification during phase 1 (SUMMARY mode).

Narrow the bucket to 4000..4999 so summary ids stay clear of the per-call
range. Collisions inside the 1000-entry bucket remain acceptable for the
expected <100-clients-on-a-device cardinality.

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-22 03:11:08 -04:00

605 lines
20 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rouse Context &mdash; Notification Catalog</title>
<style>
:root {
--bg: #f0f0f0;
--card-bg: #ffffff;
--card-border: rgba(0,0,0,0.08);
--text-primary: #1a1a1a;
--text-secondary: #5f6368;
--text-tertiary: #80868b;
--accent: #1a73e8;
--divider: rgba(0,0,0,0.08);
--code-bg: rgba(0,0,0,0.05);
}
body.dark {
--bg: #1a1a1a;
--card-bg: #2d2d2d;
--card-border: rgba(255,255,255,0.08);
--text-primary: #e8eaed;
--text-secondary: #9aa0a6;
--text-tertiary: #80868b;
--accent: #8ab4f8;
--divider: rgba(255,255,255,0.08);
--code-bg: rgba(255,255,255,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: "Roboto", "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: var(--bg);
color: var(--text-primary);
transition: background 0.2s, color 0.2s;
}
header {
background: var(--card-bg);
border-bottom: 1px solid var(--divider);
padding: 24px 32px;
display: flex;
align-items: center;
justify-content: space-between;
position: sticky;
top: 0;
z-index: 100;
}
header h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.2px; }
header h1 span { color: var(--text-secondary); font-weight: 400; }
.theme-toggle {
background: var(--code-bg);
border: 1px solid var(--divider);
color: var(--text-secondary);
padding: 8px 16px;
border-radius: 20px;
cursor: pointer;
font-size: 14px;
font-family: inherit;
}
.theme-toggle:hover { background: var(--divider); }
.container { max-width: 920px; margin: 0 auto; padding: 24px 16px 64px; }
.generated-note {
font-size: 13px;
color: var(--text-secondary);
background: var(--code-bg);
border: 1px solid var(--divider);
border-radius: 8px;
padding: 10px 14px;
margin-bottom: 24px;
line-height: 1.5;
}
.generated-note code {
font-family: "Roboto Mono", "SF Mono", Consolas, monospace;
font-size: 12px;
}
.notifier-section { margin-bottom: 40px; }
.notifier-section h2 {
font-size: 16px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.8px;
color: var(--text-tertiary);
margin-bottom: 12px;
padding: 0 4px;
}
.variant {
background: var(--card-bg);
border: 1px solid var(--card-border);
border-radius: 12px;
padding: 16px;
margin-bottom: 12px;
}
.variant h3 {
font-size: 15px;
font-weight: 600;
color: var(--text-primary);
margin-bottom: 10px;
}
.fields {
display: grid;
grid-template-columns: max-content 1fr;
column-gap: 10px;
row-gap: 4px;
margin-bottom: 12px;
font-size: 13px;
}
.fields dt {
color: var(--text-tertiary);
font-weight: 500;
}
.fields dd code {
font-family: "Roboto Mono", "SF Mono", Consolas, monospace;
font-size: 12px;
background: var(--code-bg);
padding: 1px 6px;
border-radius: 4px;
color: var(--text-primary);
word-break: break-word;
}
.screenshot-pair {
display: flex;
gap: 16px;
flex-wrap: wrap;
}
.screenshot-pair figure {
display: flex;
flex-direction: column;
align-items: center;
}
.screenshot-pair img {
border-radius: 10px;
border: 1px solid var(--card-border);
max-width: 240px;
height: auto;
display: block;
}
.screenshot-pair figcaption {
font-size: 11px;
color: var(--text-tertiary);
margin-top: 4px;
text-transform: uppercase;
letter-spacing: 0.6px;
}
</style>
</head>
<body>
<header>
<h1>Rouse Context <span>Notification Catalog</span></h1>
<button class="theme-toggle" onclick="toggleTheme()">Dark Mode</button>
</header>
<div class="container">
<p class="generated-note">Generated by <code>NotificationScreenshotTest</code>. All titles, body text, sub-text, and channel IDs below are read directly from the <code>Notification</code> objects posted by production notifiers during the test run.</p>
<section class="notifier-section">
<h2>ForegroundNotifier</h2>
<article class="variant">
<h3>Connecting</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Rouse Context</code></dd>
<dt>Body</dt>
<dd><code>Connecting</code></dd>
<dt>Channel</dt>
<dd><code>rouse_foreground</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/01_foreground_connecting_light.png" alt="Connecting light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/01_foreground_connecting_dark.png" alt="Connecting dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Connected</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Rouse Context</code></dd>
<dt>Body</dt>
<dd><code>Connected</code></dd>
<dt>Channel</dt>
<dd><code>rouse_foreground</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/02_foreground_connected_light.png" alt="Connected light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/02_foreground_connected_dark.png" alt="Connected dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Active session</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Rouse Context</code></dd>
<dt>Body</dt>
<dd><code>Connected • 2 active streams</code></dd>
<dt>Channel</dt>
<dd><code>rouse_foreground</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/03_foreground_active_session_light.png" alt="Active session light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/03_foreground_active_session_dark.png" alt="Active session dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Disconnecting</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Rouse Context</code></dd>
<dt>Body</dt>
<dd><code>Disconnecting</code></dd>
<dt>Channel</dt>
<dd><code>rouse_foreground</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/04_foreground_disconnecting_light.png" alt="Disconnecting light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/04_foreground_disconnecting_dark.png" alt="Disconnecting dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Disconnected</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Rouse Context</code></dd>
<dt>Body</dt>
<dd><code>Disconnected</code></dd>
<dt>Channel</dt>
<dd><code>rouse_foreground</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/05_foreground_disconnected_light.png" alt="Disconnected light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/05_foreground_disconnected_dark.png" alt="Disconnected dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
</section>
<section class="notifier-section">
<h2>AuthRequestNotifier</h2>
<article class="variant">
<h3>New auth request</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Approval Required</code></dd>
<dt>Body</dt>
<dd><code>Code: AB3X-9K2F - Tap to approve or deny</code></dd>
<dt>Sub-text</dt>
<dd><code>health-connect</code></dd>
<dt>Channel</dt>
<dd><code>rouse_auth_request</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/06_auth_request_light.png" alt="New auth request light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/06_auth_request_dark.png" alt="New auth request dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
</section>
<section class="notifier-section">
<h2>PerToolCallNotifier</h2>
<article class="variant">
<h3>Each usage</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Unknown used Get Steps</code></dd>
<dt>Body</dt>
<dd><code>Health Connect</code></dd>
<dt>Channel</dt>
<dd><code>rouse_session_summary</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/07_per_tool_call_light.png" alt="Each usage light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/07_per_tool_call_dark.png" alt="Each usage dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Long tool name</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Unknown used Query Heart Rate Variability Rolling Window Statistics</code></dd>
<dt>Body</dt>
<dd><code>Health Connect</code></dd>
<dt>Channel</dt>
<dd><code>rouse_session_summary</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/07a_per_tool_call_long_name_light.png" alt="Long tool name light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/07a_per_tool_call_long_name_dark.png" alt="Long tool name dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Other integration (display-name substitution)</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Unknown used Dismiss</code></dd>
<dt>Body</dt>
<dd><code>Notifications</code></dd>
<dt>Channel</dt>
<dd><code>rouse_session_summary</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/07b_per_tool_call_other_integration_light.png" alt="Other integration (display-name substitution) light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/07b_per_tool_call_other_integration_dark.png" alt="Other integration (display-name substitution) dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
</section>
<section class="notifier-section">
<h2>SessionSummaryNotifier</h2>
<article class="variant">
<h3>Multi-integration (N calls across M integrations)</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Unknown used 3 tools</code></dd>
<dt>Body</dt>
<dd><code>Get Heart Rate, Get Steps, and Send Notification</code></dd>
<dt>Channel</dt>
<dd><code>rouse_session_summary</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/08_session_summary_light.png" alt="Multi-integration (N calls across M integrations) light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/08_session_summary_dark.png" alt="Multi-integration (N calls across M integrations) dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Single call, single integration (&quot;1 tool call&quot;)</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Unknown used 1 tool</code></dd>
<dt>Body</dt>
<dd><code>Get Steps</code></dd>
<dt>Channel</dt>
<dd><code>rouse_session_summary</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/08a_session_summary_single_call_light.png" alt="Single call, single integration (&quot;1 tool call&quot;) light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/08a_session_summary_single_call_dark.png" alt="Single call, single integration (&quot;1 tool call&quot;) dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Many calls, single integration (&quot;3 tool calls&quot;, no &quot;across&quot;)</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Unknown used 3 tools</code></dd>
<dt>Body</dt>
<dd><code>Get Heart Rate, Get Sleep, and Get Steps</code></dd>
<dt>Channel</dt>
<dd><code>rouse_session_summary</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/08b_session_summary_single_integration_light.png" alt="Many calls, single integration (&quot;3 tool calls&quot;, no &quot;across&quot;) light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/08b_session_summary_single_integration_dark.png" alt="Many calls, single integration (&quot;3 tool calls&quot;, no &quot;across&quot;) dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
</section>
<section class="notifier-section">
<h2>LaunchRequestNotifier</h2>
<article class="variant">
<h3>Launch app</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Claude wants to open com.android.chrome</code></dd>
<dt>Body</dt>
<dd><code>com.android.chrome</code></dd>
<dt>Channel</dt>
<dd><code>rouse_outreach_launch</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/09_launch_app_light.png" alt="Launch app light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/09_launch_app_dark.png" alt="Launch app dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Open link</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Claude wants to open a webpage</code></dd>
<dt>Body</dt>
<dd><code>https://rousecontext.com/reports/2026-04-17</code></dd>
<dt>Channel</dt>
<dd><code>rouse_outreach_launch</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/10_launch_open_link_light.png" alt="Open link light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/10_launch_open_link_dark.png" alt="Open link dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>Open link (long title + long URL)</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Claude via Outreach Integration wants to open a webpage</code></dd>
<dt>Body</dt>
<dd><code>https://rousecontext.com/reports/2026-04-17/workouts/weekly-summary?window=7d&amp;include=heart_rate,sleep,steps,stand_hours</code></dd>
<dt>Channel</dt>
<dd><code>rouse_outreach_launch</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/10a_launch_open_link_long_light.png" alt="Open link (long title + long URL) light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/10a_launch_open_link_long_dark.png" alt="Open link (long title + long URL) dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
</section>
<section class="notifier-section">
<h2>FgsLimitNotifier</h2>
<article class="variant">
<h3>6hr FGS limit</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Rouse Context paused</code></dd>
<dt>Body</dt>
<dd><code>Rouse Context hit Android&#39;s 6-hour daily service limit. Wake requests won&#39;t be served until the limit resets. This usually means something is waking the app too often.</code></dd>
<dt>Channel</dt>
<dd><code>rouse_fgs_limit</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/11_fgs_limit_light.png" alt="6hr FGS limit light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/11_fgs_limit_dark.png" alt="6hr FGS limit dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
</section>
<section class="notifier-section">
<h2>AndroidSecurityCheckNotifier</h2>
<article class="variant">
<h3>Self-cert alert</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Security Alert</code></dd>
<dt>Body</dt>
<dd><code>Self-cert verification: Fingerprint mismatch on stored certificate</code></dd>
<dt>Channel</dt>
<dd><code>rouse_alert</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/12_security_self_cert_light.png" alt="Self-cert alert light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/12_security_self_cert_dark.png" alt="Self-cert alert dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>CT log alert</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Security Alert</code></dd>
<dt>Body</dt>
<dd><code>CT log check: Unauthorized certificate issued for device subdomain</code></dd>
<dt>Channel</dt>
<dd><code>rouse_alert</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/13_security_ct_log_light.png" alt="CT log alert light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/13_security_ct_log_dark.png" alt="CT log alert dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>CT log alert (multiple unexpected issuers)</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Security Alert</code></dd>
<dt>Body</dt>
<dd><code>CT log check: Unexpected certificate issuer(s) for abc123.rousecontext.com: [DigiCert Inc, GlobalSign nv-sa, Sectigo Limited]</code></dd>
<dt>Channel</dt>
<dd><code>rouse_alert</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/13a_security_ct_log_multi_issuer_light.png" alt="CT log alert (multiple unexpected issuers) light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/13a_security_ct_log_multi_issuer_dark.png" alt="CT log alert (multiple unexpected issuers) dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
<article class="variant">
<h3>CT log warning (postInfo after 3-run debounce)</h3>
<dl class="fields">
<dt>Title</dt>
<dd><code>Security Check</code></dd>
<dt>Body</dt>
<dd><code>CT log check: Could not reach CT log service: connection reset by peer</code></dd>
<dt>Channel</dt>
<dd><code>rouse_session</code></dd>
</dl>
<div class="screenshot-pair">
<figure>
<img src="../../notifications/screenshots/13b_security_ct_log_warning_light.png" alt="CT log warning (postInfo after 3-run debounce) light">
<figcaption>Light</figcaption>
</figure>
<figure>
<img src="../../notifications/screenshots/13b_security_ct_log_warning_dark.png" alt="CT log warning (postInfo after 3-run debounce) dark">
<figcaption>Dark</figcaption>
</figure>
</div>
</article>
</section>
</div>
<script>
function toggleTheme() {
document.body.classList.toggle("dark");
const btn = document.querySelector(".theme-toggle");
btn.textContent = document.body.classList.contains("dark") ? "Light Mode" : "Dark Mode";
}
</script>
</body>
</html>