* feat: event-driven live tab titles and favicons via SSE
Switch tab titles and favicons from polling to real-time SSE updates:
- Extend useSessionEvents to expose sseAttentionLevels map from SSE
snapshots (server-computed, includes full PR state)
- Refactor DynamicFavicon to use SSE attention levels instead of
recomputing from the full sessions array (which has stale PR data
between refreshes)
- Add useSSESessionActivity hook for session detail page to update
document.title emoji immediately on activity change
- Add live dashboard title showing count of sessions needing attention
- Update PullRequestsPage to use new DynamicFavicon API
Closes#115
* fix: seed initial attention levels to avoid stale favicon/title on first render
Accept initialAttentionLevels parameter in useSessionEvents so callers
can seed the attention map from initialSessions via getAttentionLevel().
This prevents the favicon and dashboard title from briefly showing
"all clear" before the first SSE snapshot arrives.
* fix: add EventSource mock to session page test for SSE hook compatibility
* fix: reset stale activity state when sessionId changes in useSSESessionActivity
Add sessionId to the effect dependency array and reset state to null at
the start of each effect run so callers that reuse the hook with a
different sessionId don't see the previous session's activity.
* fix: reset sseAttentionLevels on initialSessions change to prevent stale data on project switch
The reset action now accepts an optional sseAttentionLevels field. When
initialSessions changes (e.g., project switch via sidebar), the dispatch
passes the current initialAttentionLevels via ref so the favicon and
dashboard title reflect the new project immediately rather than showing
stale attention data until the first SSE snapshot.
* feat: add CI failure detail notifications in lifecycle manager
When CI fails on a PR, the lifecycle manager now fetches individual check
details (names, statuses, URLs) and sends them to the worker session.
This complements the existing static reaction message with actionable
debugging information.
Flow:
- On first transition to ci_failed: static reaction message fires (existing)
- On next poll: detailed CI failure info with check names and URLs dispatched
- Fingerprinting prevents re-sending the same failure set
- New/changed failures trigger fresh detailed notifications
- Tracking metadata cleared when PR is merged/closed or CI passes
Follows the same deduplication pattern as maybeDispatchReviewBacklog().
* fix: send CI details directly to avoid consuming reaction retry budget
The detailed CI failure dispatch now uses sessionManager.send() directly
instead of executeReaction(), so it doesn't increment the ci-failed
reaction tracker. This prevents low retries/escalateAfter settings from
causing premature escalation before the agent receives failure details.
The transition reaction still owns escalation; the detailed dispatch is
purely informational follow-up delivery.
* feat: add merge conflict notifications in lifecycle manager
Adds maybeDispatchMergeConflicts() that detects merge conflicts from
the PR enrichment cache or getMergeability() and notifies the worker
session. Conflicts are dispatched independently of session status since
they can coexist with ci_failed, changes_requested, etc.
- Uses the existing merge-conflicts reaction config
- Dispatches once per conflict occurrence (tracks lastMergeConflictDispatched)
- Clears tracking when conflicts resolve, allowing re-dispatch if they recur
- Sends directly via sessionManager.send() (same pattern as CI details)
* fix: use CICheck type instead of inline type declaration
Replace inline Array<{ name, status, url, conclusion }> with the
existing CICheck type from ./types.js for formatCIFailureMessage and
the checks variable in maybeDispatchCIFailureDetails.
* fix: resolve no-useless-assignment lint error in merge conflict check
Declare hasConflicts without initial value since both branches of the
if/else assign to it before it's read.
* feat: show agent notification state in session page blockers
The blockers section on both SessionDetail (IssuesList) and SessionCard
(alert pills) now shows whether the agent has been notified about each
blocker. Reads lifecycle manager dispatch metadata:
- lastCIFailureDispatchHash for CI failures
- lastMergeConflictDispatched for merge conflicts
- lastPendingReviewDispatchHash for review comments
Displays "agent notified" indicator next to blockers where the lifecycle
manager has already forwarded the issue to the worker session.
* fix: use lifecycle status as fallback for blockers when PR data is stale
The blockers section now uses the lifecycle manager's session status
metadata as a source of truth when PR enrichment data hasn't caught up.
PR enrichment uses a 5-min cache and can timeout or be rate-limited,
causing blockers to show stale/incorrect state.
Changes:
- IssuesList and getAlerts now check metadata["status"] (lifecycle
manager state) alongside PR enrichment data
- CI failing: shown when pr.ciStatus is "failing" OR lifecycle status
is "ci_failed"
- Changes requested: shown when pr.reviewDecision matches OR lifecycle
status is "changes_requested"
- Merge conflicts: shown when pr.mergeability.noConflicts is false OR
lifecycle dispatch metadata indicates conflicts were detected
* fix: fall back to getMergeability when cached hasConflicts is undefined
When PREnrichmentData has hasConflicts as undefined (the field is typed
as boolean | undefined), the previous check treated it as no conflicts.
Now falls through to the getMergeability() call instead.
* test: add coverage for CI/conflict notify action and recovery paths
- Test CI tracking clears when CI recovers to passing
- Test notify action for CI failure details (human notification path)
- Test notify action for merge conflicts (human notification path)
These cover the previously uncovered notify action branches and the
CI recovery cleanup path in the lifecycle manager.
* fix: resolve typecheck error in CI recovery test
writeMetadata requires SessionMetadata type which doesn't include
custom keys like lastCIFailureFingerprint. Rewrote the test to use
setupCheck and let the lifecycle manager set tracking metadata
naturally through the CI failure flow, then verify cleanup on recovery.
* fix: don't use dispatch metadata for conflict detection in UI
lastMergeConflictDispatched lingers after conflicts resolve until the
lifecycle manager's next poll clears it. Using it as a conflict signal
caused stale "merge conflict" alerts. Now only pr.mergeability.noConflicts
drives conflict detection; the metadata is only used for the "agent
notified" badge.
* fix: use Promise.allSettled for dispatch functions to avoid orphaned rejections
Promise.all rejects immediately on first failure, leaving in-flight
promises unmonitored. Promise.allSettled waits for all to complete.
- centralize project existence check via validateConfiguredProject
(Object.hasOwn) and apply to spawn, issues, verify, orchestrators routes
- add AbortController (1.5s) to runtime terminal config fetch in DirectTerminal
- add runtimeFetchDone flag to prevent repeated fetches on reconnect
- restore resolveDashboardProjectFilter fallback to getPrimaryProjectId()
- expand runtime terminal endpoint tests (defaults, invalid ports, proxy path)
- add validation.test.ts covering prototype-chain bypass cases
- add undefined case test for resolveDashboardProjectFilter
- update changeset with full list of changes for npm publish
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Light mode --color-status-ready: #5B7EF8 → #5e6ad2 (DESIGN.md specifies darker shade for light backgrounds)
- Light mode --color-tint-red: rgba(207,34,46,...) → rgba(220,38,38,...) to match new #dc2626
- Dark mode --color-tint-red: rgba(255,123,114,...) → rgba(239,68,68,...) to match new #ef4444
- ActivityDot.tsx: update hardcoded bg tints — active gets green rgba(34,197,94,0.1), ready gets blue rgba(91,126,248,0.1)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Exposes connectionStatus ("connected" | "reconnecting" | "disconnected")
from useSessionEvents via onopen/onerror EventSource handlers, and renders
a fixed ConnectionBar at the top of the viewport that shows a pulsing amber
bar while reconnecting and a red 32px "Offline · tap to retry" bar when
disconnected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ToastProvider now clears its setTimeout in a useEffect cleanup to prevent
memory leaks when the component unmounts while a toast is still pending.
- BottomSheet adds a focus trap on the sheet element so keyboard users cannot
Tab out of the dialog; focus is also set to the first focusable element
(Cancel button) when the sheet opens.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On mobile (<=767px), session cards with attention level "respond" now
show an inline quick-reply panel with the agent's last message summary
(2-line clamp), Continue/Abort/Skip preset buttons, and an expandable
textarea. Enter submits; all touch targets are >=44px. Hidden on
desktop via CSS-only media query.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract onPillTap as handlePillTap useCallback with prefers-reduced-motion support
- Replace role="navigation" with role="group" aria-label="Session priorities" on pill strip
- Add role="status" to all-clear fallback so screen readers announce state changes
- Add :focus-visible outline to .mobile-action-pill for keyboard accessibility
- Add scroll-margin-top: 56px to .accordion-board to prevent sticky header occlusion
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
On mobile (<=767px), replace the 4 stat cards with a single-row
MobileActionStrip showing non-zero urgency pills (respond/merge/review)
with colored dots. Tapping a pill calls setExpandedLevel and scrolls to
the accordion board via id="mobile-board". Hides stat cards, dashboard
subtitle, and board-section-head on mobile to target ~92px hero height.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix Critical 1: change onToggle to (level: AttentionLevel) => void and
create stable handleAccordionToggle with useCallback, eliminating the
inline arrow that defeated memo on every render
- Fix Critical 2: remove grouped from useEffect deps so user accordion
selection is not reset on every SSE update; seed only on isMobile change
- Fix Important 3: move accordion CSS block inside @media (max-width: 767px)
so it is scoped to mobile only, consistent with rest of file
- Fix Important 4: add Safari 16+ compatibility comment on
grid-template-rows transition
- Fix Suggestion 5: replace ▶/▼ character swap with single ▶ rotated via
CSS transform so the declared transition: transform actually animates
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace vertical kanban stacking on mobile (<=767px) with a single-open
accordion ordered Respond > Merge > Review > Pending > Working.
Auto-expands the most urgent non-empty section on load; empty sections
render as header-only rows (no dashed placeholder). Desktop layout is
unchanged. Added window.matchMedia stub to the Vitest setup file so
Dashboard unit tests pass in jsdom.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Increase .project-sidebar--mobile-open specificity to (0,2,0) so it
overrides .project-sidebar.project-sidebar--collapsed transform
- Make "Hide sidebar" and "Show project sidebar" buttons also call
onMobileClose to dismiss the mobile drawer when toggling collapse
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add web app manifest (manifest.ts) with dynamic project name, standalone display
- Add service worker (sw.js) with network-first strategy and offline fallback page
- Add PWA icons: apple-touch-icon (180x180), 192x192, 512x512 via shared renderer
- Add viewport meta with viewport-fit=cover for safe-area-inset support
- Add Apple Web App meta tags for iOS home screen installation
- Add theme-color meta for browser chrome coloring
- Extract shared icon-renderer.tsx to deduplicate icon generation logic
- Add ServiceWorkerRegistrar client component for SW registration
- Configure next.config.js with no-cache headers for service worker
- Add dvh fallbacks for 100vh usage (body, kanban-board, Terminal, DirectTerminal)
- Add safe-area-inset padding for mobile sidebar and dashboard main
- Add iOS auto-zoom prevention (16px font on inputs)
- Add -webkit-tap-highlight-color: transparent and text-size-adjust
- Add PWA standalone mode body padding for safe areas
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The collapsed sidebar early-return path was missing the backdrop overlay
and close mechanism that the expanded branch had, making it impossible
to dismiss the mobile drawer by tapping outside.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Switches from theme to resolvedTheme so the toggle shows the correct
icon and toggles correctly even when theme is set to "system".
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
hasAnySessions now checks kanban-visible levels instead of all
displaySessions, so the board doesn't render empty columns when
every session is in the "done" state.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove unused `ActivityDot` import and `humanizeStatus` function from
SessionDetail.tsx that caused lint, typecheck, and onboarding CI failures.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename "Merge Ready" kanban column to "Ready"
- Refine card design system and globals.css theme tokens
- Fix terminal scrollbar and theme handling in DirectTerminal
- Update SessionDetail layout
- Update tests to match component changes
- Add .gstack/ to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove SkeletonBlock, ErrorState, DashboardSkeleton, and
SessionDetailSkeleton — none are imported anywhere in the codebase.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes React Rules of Hooks violation where useMemo ran after a
conditional early return, causing inconsistent hook call counts.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>