11 Commits

Author SHA1 Message Date
can1357 c35b41ed41 feat(coding-agent): added mouse-driven /settings overlay navigation across tabs and sections
- Added mouse hover, wheel, and click routing for `/settings` rows and tabs.
- Changed `/settings` to open as a fullscreen alternate-screen overlay.
- Added hover, hit-testing, and wheel APIs across TabBar, SelectList, and SettingsList.
- Added SGR mouse parsing plus `routeMouse` dispatch and exported it from the `tui` entrypoint.
2026-06-12 03:27:50 +02:00
Brit 0160d0dbf2 session accent: derive from theme mode with collision avoidance
- Dark themes: warm hues (0-120), Light themes: cool hues (180-300)
- Collision check against 17 major theme colors with 10° threshold,
  clamped to the hue band so it never drifts into an unrelated range
- Hex values stored at construction instead of round-tripping through
  ANSI escape parsing (removes #ansiToHex)
- WCAG AA contrast bisection on light surfaces
- Per-session uniqueness via name hash within the hue band
2026-06-10 14:12:07 +02:00
can1357 9d457f73d9 test: migrated test imports to package subpath exports
- Replaced relative `../src` imports with `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-agent-core` subpaths.
2026-06-08 19:03:55 +02:00
can1357 1379772628 refactor(utils): consolidate color utilities into pi-utils
Move the color math added for the session-accent fix into the shared
@oh-my-pi/pi-utils color module instead of a coding-agent-local file:

- colorLuma, relativeLuminance, and hslToHex now live in
  packages/utils/src/color.ts (hslToHex lifted out of session-color.ts).
- Drop the duplicate hex parser: toRgb reuses the existing hexToRgb and
  paletteToRgb returns the shared RGB type, so hex parsing lives once.
- Delete packages/coding-agent/src/utils/color.ts; theme.ts and
  session-color.ts import from @oh-my-pi/pi-utils.
- Move the color unit test into the utils package; repoint session-color
  test imports.

No behavior change to accent luminance capping.
2026-06-04 05:27:11 +02:00
Paweł J. Wal 34e8a79994 Opus: fix(tui): use WCAG relative luminance for accent contrast caps
Per review on #1715: the cap fed gamma-encoded luma into the WCAG contrast formula, so the >=3:1 target wasn't real (light-poimandres #340df2 was ~2.5:1 actual). Split the color helpers into colorLuma (perceptual, for light/dark classification — unchanged behavior) and relativeLuminance (WCAG-linearized sRGB, for contrast ratios). Session accents are now sized, and tests asserted, against relativeLuminance, so >=3:1 holds against the actual surface. Theme keeps luma for isLight/isLightTheme and exposes the WCAG status-line luminance for the cap.
2026-06-02 17:07:05 +02:00
Paweł J. Wal 1c78f19c93 Opus: fix(tui): size session accent by status-line contrast, not a fixed cap
Per review on #1715: the light-theme cap was a fixed absolute luminance (0.2) tuned for near-white backgrounds. On a mid-light shipped theme like light-poimandres (statusLineBg #7390aa, luminance ~0.55) that still left accents at only ~1.8-2.4:1. Theme now exposes statusLineLuminance + accentSurfaceLuminance; getSessionAccentHex takes the surface luminance and caps the accent to guarantee >=3:1 (WCAG AA large) against the actual surface, so near-white and mid-light light themes are both legible. Tests assert contrast across light + mid-light surfaces.
2026-06-02 16:53:01 +02:00
Paweł J. Wal 06eb1d709f Opus: fix(tui): cap session accent luminance on light themes
The status line session_name (plus editor border / gap fill) colors itself with a per-session accent hashed from the name via hslToHex(hue, 0.9, 0.72). The fixed lightness is tuned for dark backgrounds; on light themes high-luminance hues (yellow/lime/cyan) render near-invisible (~1.3:1 contrast). statusLine.sessionAccent (#918) only gates the border/gap fill, not the segment text, so there was no way to make the title legible on a light theme.

Add Theme.isLight (from userMessageBg luminance) and make getSessionAccentHex bisect lightness to cap perceived luminance on light themes, keeping the per-session hue while staying readable. Pass theme.isLight at all four accent call sites; add a unit test.

Refs #918, #680.
2026-06-02 15:09:02 +02:00
can1357 975941aba4 chore: remove garbage tests 2026-05-12 04:09:33 +02:00
can1357 7467add484 refactor(coding-agent): unified session title and accent handling around session names
- Removed title-source aware branching from session terminal-title and accent helpers, and updated callers to use session name plus cwd only.
- Dropped UUID-based recent-session naming by preferring explicit header titles or first user prompts and generating an "Untitled · <time>" fallback.
- Adjusted welcome session-row rendering for width-aware name truncation and disabled reasoning in title generation requests to keep terminal titles concise.
2026-05-02 01:42:06 +02:00
can1357 11b7ba7846 fix(coding-agent): respected session title source when formatting terminal titles
- Propagated session title source through terminal-title update calls so auto and user names are handled consistently across controllers.
- Suppressed auto-generated names in status-line segments and completion messages by falling back to cwd-based titles.
- Updated title formatter tests to verify auto-generated and user-specified session titles produce different terminal labels.
2026-04-13 06:22:37 +02:00
can1357 d2202d0b0b fix(coding-agent): ignore auto titles for session accent 2026-04-13 00:42:24 +02:00