Commit Graph

135 Commits

Author SHA1 Message Date
suraj_markup f73aebe634
Merge pull request #761 from suraj-markup/fix-runtime-terminal-projectid-hardening
fix(web): runtime terminal port resolution + project-id hardening
2026-03-29 14:50:25 +05:30
suraj-markup f82e4e6ad9 fix(test): replace dynamic delete with Reflect.deleteProperty in withEnv
Fixes @typescript-eslint/no-dynamic-delete lint error in api-routes.test.ts
which was breaking Lint, Typecheck, and the onboarding build check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 03:58:38 +05:30
suraj-markup 717253cf8e fix(web): harden project validation, fetch timeout, and test coverage
- 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>
2026-03-29 03:17:42 +05:30
Ashish Huddar 8d16049222 fix: correct mismatched status colors after light/dark token swap
- 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>
2026-03-29 00:42:34 +05:30
Ashish Huddar f4ba0fb64d implement design system: Geist Sans, new accent tokens, GPU-composited dot pulse
- Replace IBM Plex Sans/Mono with Geist Sans (keep JetBrains Mono)
- Update accent: #5e6ad2 → #5B7EF8 (blue), add amber respond/cyan review status tokens
- Update status colors: working=green #22c55e, ready=blue #5B7EF8, error=red #ef4444
- Add --radius-base: 2px; apply 2px border-radius to session cards and orchestrator buttons
- Replace box-shadow activity-pulse with GPU-composited dot-ring pseudo-element (.dot-pulse)
- Remove ready-rail-breathe and ready-sheen keyframes (decorative anxiety, high perf cost)
- Update card entrance: slide-up uses 8px translateY and spring easing cubic-bezier(0.16,1,0.3,1)
- Cap nav backdrop-filter at blur(12px)
- Add contain: layout style paint to session cards
- Pulse animation min-opacity 0.4→0.6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 00:10:28 +05:30
suraj-markup 5315e4e0ab fix(web): runtime terminal port resolution + project-id hardening 2026-03-28 19:23:15 +05:30
Ashish Huddar c32fb6a03c Fix session polling and BottomSheet freshness 2026-03-27 01:38:54 +05:30
Ashish Huddar 8ce7366b82 Import useRef for session detail page 2026-03-27 01:34:13 +05:30
Ashish Huddar ada469556a Fix session detail project polling and orchestrator response 2026-03-27 01:27:38 +05:30
Ashish Huddar c008c3c4c2 Refresh bottom sheet session data and update tests 2026-03-27 00:32:52 +05:30
Ashish Huddar 24a293d811 Handle send errors and stabilize script tests 2026-03-27 00:25:10 +05:30
Ashish Huddar 5b1f3625a5 Reset mobile view-all state and surface send errors 2026-03-26 23:37:51 +05:30
Ashish Huddar 4a842d4742 Fix ao launcher linking and mobile toast offset 2026-03-26 22:47:25 +05:30
Ashish Huddar e1867d0bef Preserve orchestrator ID when session project changes 2026-03-26 22:38:30 +05:30
Ashish Huddar 128c9101c8 Handle dashboard send failures and optimize session polling 2026-03-26 22:28:31 +05:30
Ashish Huddar b69cb9aac2 Guard alert action sends and reset on failure 2026-03-26 11:34:13 +05:30
Ashish Huddar 16c2bf23d1 Fix quick reply success state on send failures 2026-03-26 11:22:50 +05:30
Ashish Huddar 82a93a0a2b Fix metadata loading and refresh orchestrator session links 2026-03-26 11:12:55 +05:30
Ashish Huddar 5de48bb3f0 Restore desktop confirm flow and rename session PR card 2026-03-26 10:57:51 +05:30
Ashish Huddar 618448e620 Fix mobile session row grid for 44px open button 2026-03-26 09:07:08 +05:30
Ashish Huddar fa37074a3f Show desktop quick replies and stabilize session polling 2026-03-26 08:30:22 +05:30
Ashish Huddar c38a282f29 Improve mobile nav and reduce session detail polling 2026-03-26 02:03:50 +05:30
Ashish Huddar 771453e088 Prevent stale sheet state and duplicate quick replies 2026-03-26 01:47:14 +05:30
Ashish Huddar 05ede816ca Preserve collapsed mobile accordion state across updates 2026-03-25 18:28:33 +05:30
Ashish Huddar fd742b595a Keep pull request stat cards visible on mobile 2026-03-25 14:55:09 +05:30
Ashish Huddar 1fb01f99fc Normalize dashboard project filtering and align session layout 2026-03-25 14:34:55 +05:30
Ashish Huddar da543960b7 Fix web imports for service worker and project utils 2026-03-25 14:08:54 +05:30
Ashish Huddar d743a196d3 Polish mobile dashboard UX and harden PWA behavior 2026-03-25 13:57:40 +05:30
Ashish Huddar 740933e0a0 Fix mobile dashboard seeding and remove unsafe assertions 2026-03-25 11:45:12 +05:30
Ashish Huddar b8eab07d28 Fix mobile dashboard navigation and connection state handling 2026-03-25 11:41:36 +05:30
Ashish Huddar fc9edb8afb feat(web): add real-time SSE connection status indicator
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>
2026-03-24 23:04:42 +05:30
Ashish Huddar ed5e6ee294 fix(web): clean up toast timer on unmount and add focus trap to BottomSheet
- 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>
2026-03-24 23:01:38 +05:30
Ashish Huddar c361392672 feat(web): add Toast/Snackbar system and BottomSheet for destructive confirmations
- Create Toast.tsx with ToastProvider + useToast hook (3s auto-dismiss, success/error/info variants, fade+slide animation)
- Create BottomSheet.tsx replacing confirm() for kill actions (swipe-to-dismiss, keyboard Escape, session context display)
- Wire ToastProvider + BottomSheet into Dashboard.tsx; replace confirm() calls; add showToast on merge/kill/restore success and error
- Add toast and bottom-sheet CSS to globals.css (no new z-index vars needed — --z-modal/--z-toast already existed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 22:59:18 +05:30
Ashish Huddar f4518398b1 fix(web): add aria-label to quick-reply textarea and use consistent border token
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 22:55:03 +05:30
Ashish Huddar 602635fac8 fix(web): move .quick-reply styles from 480px to 767px media query
Quick-reply UI was invisible on mobile viewports 480–767px wide because
its styles were scoped to @media (max-width: 480px). Moved all
.quick-reply* rules into the @media (max-width: 767px) block so the
component renders correctly across the full mobile range.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 22:53:31 +05:30
Ashish Huddar 3e678f7f43 feat(web): add quick-reply section on respond cards (mobile)
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>
2026-03-24 22:45:57 +05:30
Ashish Huddar 6672d09a50 fix(web): action strip a11y fixes and callback stability
- 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>
2026-03-24 22:41:11 +05:30
Ashish Huddar 3845bd582f feat(web): mobile action strip — tappable urgency pills replace stat cards
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>
2026-03-24 18:46:48 +05:30
Ashish Huddar 0d2804fcf9 fix(web): resolve accordion memo regression and CSS scoping
- 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>
2026-03-24 18:44:08 +05:30
Ashish Huddar ffef8d4a79 feat(web): mobile accordion layout — urgency-first kanban on mobile
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>
2026-03-24 18:37:53 +05:30
Ashish Huddar 049ca42d85 fix(web): fix useMediaQuery hydration and add tests
Replace the lazy useState initializer that read window.matchMedia on
first render (causing SSR/client hydration mismatch) with a plain
false default; the existing useEffect already syncs the correct value
after mount. Adds a full vitest test suite covering all six specified
cases (SSR-safe default, match/no-match, number-to-query conversion,
change-event reactivity, and listener cleanup on unmount).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:33:57 +05:30
Ashish Huddar b74a212016 feat(web): add useMediaQuery hook for mobile detection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 18:29:40 +05:30
Ashish Huddar 402dc1f861 fix(web): fix mobile sidebar specificity and toggle close behavior
- 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>
2026-03-24 08:04:47 +05:30
Ashish Huddar 4622be19cd feat(web): add PWA support and mobile flawlessness fixes
- 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>
2026-03-24 07:53:34 +05:30
Ashish Huddar a4a86594c7 fix(web): add mobile backdrop to collapsed sidebar branch
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>
2026-03-24 01:00:17 +05:30
Ashish Huddar 8fc778cf30 chore(web): add mobile-responsive layout for dashboard and session views
Add proper mobile breakpoints (768px, 480px) with structural layout changes:

- Sidebar: auto-hide on mobile with hamburger toggle and overlay drawer
- Dashboard hero: stack stats cards and controls vertically on mobile
- Kanban board: stack columns vertically instead of horizontal scroll
- Session cards: flexible height with 44px minimum touch targets
- Session detail: responsive header metadata and full-width terminal
- Global: phone-specific breakpoint (480px) for single-column layouts

Desktop layout remains completely unchanged.

Closes #633

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 00:55:37 +05:30
Ashish Huddar 254d64de8f fix(web): use flat color for dark mode --card-merge-bg
The variable was a linear-gradient (an <image>), but it's used inside
color-mix() which only accepts <color> values. This made the entire
background declaration invalid, rendering merge-ready cards transparent
in dark mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 17:15:07 +05:30
Ashish Huddar 8e34695eec fix(web): use resolvedTheme in ThemeToggle for system theme support
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>
2026-03-23 17:03:38 +05:30
Ashish Huddar 0fe6340594 fix(web): show EmptyState when only done sessions exist
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>
2026-03-23 16:49:46 +05:30
Ashish Huddar f781be04b1 fix(web): remove unused imports to fix CI lint errors
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>
2026-03-23 15:54:11 +05:30