Commit Graph

89 Commits

Author SHA1 Message Date
Nicolas Varrot
5a4c5ba457 feat: add service worker for PWA support (offline caching, installability)
- Add sw.js with stale-while-revalidate caching for static assets
- Network-first for HTML navigation, skip API/WS requests
- Register service worker in main.tsx on page load
- Enhanced manifest.json with orientation, categories, and all icon sizes
- App is now installable as a standalone PWA on mobile and desktop
2026-02-13 05:11:39 +00:00
Nicolas Varrot
5f3f73e4c9 fix: add loading skeleton and error fallback for images
- Show a pulsing placeholder while images load
- Display a graceful error state with ImageOff icon when images fail to load
- Prevents broken image icons from cluttering the chat
2026-02-13 04:56:47 +00:00
Nicolas Varrot
dfbfc375da fix: open external links in new tab with rel=noopener noreferrer
Markdown links pointing to external URLs (http/https) now open in a
new tab with target=_blank and rel='noopener noreferrer' for security.
Internal/relative links are unaffected.
2026-02-13 04:42:39 +00:00
Nicolas Varrot
2157d7ebd5 feat: add System theme option that follows OS color scheme
Adds a 'System' option to the theme switcher that automatically uses
light or dark theme based on the OS prefers-color-scheme setting.
Dynamically updates when the OS preference changes (e.g. scheduled
dark mode). i18n labels added for EN/FR.
2026-02-13 04:13:01 +00:00
Nicolas Varrot
1770e95d0a fix: resolve all ESLint warnings (setState in useEffect)
Suppress 3 react-hooks/set-state-in-effect warnings with targeted
eslint-disable comments. These are intentional patterns:
- ChatInput: restore draft text on session switch
- MessageSearch: reset active index on query change
- ToolCall: sync open state with global collapse/expand toggle

Lint now passes with 0 errors and 0 warnings.
2026-02-13 03:41:39 +00:00
Nicolas Varrot
f09482e6cb feat: multi-tab split view for 2 sessions side by side
- Add split view button (columns icon) in sidebar session actions
- Click to open any session in a secondary pane alongside the primary
- Resizable divider between panes (drag to resize, persisted in localStorage)
- Secondary pane supports full chat: history, streaming, send, abort
- Close split view via X button or clicking the split icon again
- Each pane has independent scroll, search, and tool collapse
- Keyboard shortcut and i18n support (EN/FR)
2026-02-13 02:44:33 +00:00
Nicolas Varrot
b0492434d0 feat: syntax highlighting in chat input textarea
Real-time markdown syntax coloring while typing using a transparent
textarea overlay approach. Highlights: code blocks, inline code,
bold, italic, headings, and links. Toggle button (highlighter icon)
to enable/disable, persisted in localStorage.
2026-02-13 02:26:15 +00:00
Nicolas Varrot
35652eaeb5 feat: drag & drop session reordering in sidebar
- Drag sessions to reorder within pinned/unpinned groups
- Custom order persists in localStorage
- Visual feedback: dragged item fades, drop target highlights
- Disabled during search filtering
- Works alongside existing pin feature (pinned group stays on top)
2026-02-13 02:10:53 +00:00
Nicolas Varrot
4dfaaff2b5 feat: live markdown preview toggle in chat input
- Eye icon button next to file picker toggles preview on/off
- Shows rendered markdown above textarea in real-time
- Lazy-loads ReactMarkdown (no bundle impact when off)
- Preference persisted in localStorage
- i18n: EN/FR labels for show/hide preview
2026-02-13 01:56:13 +00:00
Nicolas Varrot
82d2e37a27 feat: raw JSON viewer toggle on each message
Add a {⁠} button (visible on hover) that toggles a collapsible panel
showing the full raw gateway JSON payload for any message.
Includes copy-to-clipboard, word-wrap, and i18n (EN/FR).
Useful for debugging and understanding the gateway protocol.

Closes feedback #52
2026-02-13 01:41:04 +00:00
Nicolas Varrot
c7cd47b09a feat: strip webhook/hook scaffolding from user messages
Messages from /hooks/agent containing SECURITY NOTICE blocks and
<<<EXTERNAL_UNTRUSTED_CONTENT>>> delimiters are now cleaned up.
Only the actual user content is displayed, with a small webhook
badge indicator showing the message originated from a webhook.

Closes feedback #54
2026-02-13 01:12:04 +00:00
Nicolas Varrot
6c19c26b84 feat: message search with Ctrl+F — filter and navigate matches in conversation 2026-02-13 00:57:19 +00:00
Nicolas Varrot
664fc0e109 feat: display thinking/reasoning content during streaming
Extract thinking blocks from delta events and render them inline
using the existing ThinkingBlock component. Previously, thinking
content was only visible after the stream finished (via history
reload). Now it appears in real-time as the agent reasons.

Closes feedback #57.
2026-02-13 00:41:23 +00:00
Nicolas Varrot
b60c0ce3c4 fix: migrate all components to theme-aware CSS variables
Replace ~150 hardcoded Tailwind color classes (bg-zinc-*, text-zinc-*,
border-white/*, text-cyan-*, bg-cyan-*) with CSS custom properties
(--pc-*) across all 17 components.

Add @theme block in index.css for Tailwind v4 theme-aware utility
classes (bg-pc-elevated, text-pc-text, border-pc-border, etc.).

Add --pc-hover, --pc-hover-strong, --pc-separator variables per theme
(white/alpha for dark/OLED, black/alpha for light).

Theme switcher (dark/light/OLED) now actually works — all UI elements
respond to theme changes in real-time.

Fixes #55
2026-02-13 00:29:50 +00:00
Nicolas Varrot
73a46f3ba7 fix: resolve all ESLint errors blocking CI releases
- Extract ThemeContext and ToolCollapseContext definitions into separate
  files to satisfy react-refresh/only-export-components rule
- Move useTheme and useToolCollapse hooks to dedicated hook files
- Fix empty catch block in ThemeContext (add comment)
- Replace Date.now() ref in ThinkingIndicator with useState initializer
- Update all imports across components

Closes feedback #58
2026-02-13 00:13:12 +00:00
Nicolas Varrot
b20bf41bf4 feat: theme switcher — dark, light, OLED modes with configurable accent colors
- Add ThemeContext with CSS custom properties for all base colors
- Three theme modes: Dark (default), Light, OLED Black
- Six accent colors: Cyan, Violet, Emerald, Amber, Rose, Blue
- Theme switcher dropdown in header (palette icon)
- Persisted in localStorage
- CSS variables replace hardcoded hex colors in index.css and components
- i18n support (EN/FR) for theme labels
2026-02-12 23:51:01 +00:00
Nicolas Varrot
bd446aa2e6 feat: word-wrap toggle on tool call content blocks
Add a wrap/nowrap toggle button on tool call parameters and results.
Default: word-wrap enabled (pre-wrap + break-words) so content fits
without horizontal scrolling. Click the toggle to switch to nowrap
mode for raw formatting with horizontal scroll.

Closes feedback #41
2026-02-12 23:46:55 +00:00
Nicolas Varrot
25e63f8d18 feat: improved thinking/reasoning indicator with elapsed time counter
When the agent is reasoning with hidden thinking (thinking=low), show a
pulsing 'Reasoning...' indicator with elapsed time instead of generic
bouncing dots. Once text content starts streaming, falls back to the
regular streaming dots.

Closes feedback #40
2026-02-12 23:42:39 +00:00
Nicolas Varrot
da2e4862dd feat: display agent avatar from OpenClaw identity config
Fetch agent identity via agent.identity.get WS method after connect.
Display avatar in message bubbles (replacing Bot icon) and in the
header (replacing the PinchChat logo when an avatar is configured).
Falls back to default icons when no avatar is set.
2026-02-12 23:29:32 +00:00
Nicolas Varrot
9f67c9e5dc fix: metadata viewer popup clipped by overflow-hidden parent
The MetadataViewer popup was rendered inside the message bubble which has
overflow-hidden, causing the popup to be invisible. Fix by using
createPortal to render the popup directly on document.body with fixed
positioning. Also adds click-outside-to-close behavior.

Closes feedback #46
2026-02-12 23:22:05 +00:00
Nicolas Varrot
b4813f091a feat: add message metadata viewer on hover
Small info button appears on hover of each message bubble.
Click to expand a panel showing raw message metadata (id, role,
timestamp, channel, sender info, etc.) from the gateway.
Useful for debugging and understanding message routing.
Collapsed by default, doesn't clutter the UI.

Closes feedback item #39
2026-02-12 23:17:27 +00:00
Nicolas Varrot
53a8655bb1 docs: release v1.14.2 — textarea scrollbar fix 2026-02-12 23:12:04 +00:00
Nicolas Varrot
73881396d1 fix: hide textarea scrollbar when content doesn't overflow
Set overflow-y: auto on textarea so the vertical scrollbar only
appears when content exceeds max-height. Fixes #43.
2026-02-12 23:11:25 +00:00
Nicolas Varrot
3ca76ebe26 style: rework user message styling from violet to cyan theme
Replace violet tint with cyan/teal tones to match the existing cyan accent
theme. User messages now use from-cyan-900/20 background gradient and
cyan-400/15 border, with cyan-200 user icon. Subtler and more cohesive
with the dark theme while remaining clearly distinct from assistant messages.

Fixes feedback #44
2026-02-12 23:10:03 +00:00
Nicolas Varrot
792a34bfb9 style: visually differentiate user vs assistant message bubbles
User messages now have a subtle violet tint (border + gradient) to
distinguish them from assistant messages, similar to WhatsApp/Telegram
style. Keeps the dark theme and soft palette.
2026-02-12 22:26:18 +00:00
Nicolas Varrot
d9e1b88a70 fix: persist deleted sessions via localStorage blacklist
Deleted sessions would reappear after page refresh because the
gateway sessions.list response still included them. Now maintains
a localStorage blacklist of deleted session keys that filters them
out on every load, regardless of gateway-side deletion support.
2026-02-12 21:40:07 +00:00
Nicolas Varrot
2b1ca2d0c8 feat: add collapse/expand all tool calls toggle button
Adds a floating button in the chat area that lets users collapse or expand
all tool call details at once. Useful for long conversations with many tool
calls where scrolling through expanded results is tedious.

- New ToolCollapseContext provides global collapse/expand state
- ToolCall components react to global state changes via version tracking
- Toggle button appears only when conversation has tool calls
- Supports EN/FR i18n
2026-02-12 19:36:53 +00:00
Nicolas Varrot
1fc63b4e92 feat: add Alt+↑/↓ keyboard shortcuts to navigate between sessions 2026-02-12 19:08:00 +00:00
Nicolas Varrot
8d4b606482 feat: export conversation as Markdown file
Add a download button in the header that exports the current session's
messages as a well-formatted Markdown file. Includes:
- User/assistant/system event labels with timestamps
- Thinking blocks as collapsible <details>
- Tool calls with JSON parameters
- Tool results as collapsible sections
- Image placeholders
- Session label and export date in header

i18n: EN + FR translations for the export tooltip.
2026-02-12 18:38:54 +00:00
Nicolas Varrot
ad7d149f88 fix: hide horizontal scrollbar on textarea for Windows compatibility
Add overflow-x: hidden and word-break styles to textarea to prevent
ugly horizontal scrollbar on Windows. Also hide the horizontal webkit
scrollbar track entirely.
2026-02-12 18:15:08 +00:00
Nicolas Varrot
cecfa3e010 style: custom webkit scrollbar styling for macOS/Chrome
Add ::-webkit-scrollbar rules matching the dark theme. Textarea gets
an even thinner 4px scrollbar. Fixes ugly default scrollbar on macOS.

Closes feedback #36.
2026-02-12 18:05:15 +00:00
Nicolas Varrot
53d619c357 feat: relative timestamps, message preview, and recency sort in sidebar
- Show relative time (2m, 3h, 1d) next to each session name
- Display last message preview below session name (truncated to 80 chars)
- Sort sessions by most recently updated (within pinned/unpinned groups)
- Map updatedAt and lastMessagePreview from gateway sessions.list response
2026-02-12 17:59:16 +00:00
Nicolas Varrot
17ff52aaaf feat: display agent name badge in header next to session label
Shows the agentId (e.g. 'main') with a bot icon in the header subtitle,
making it clear which agent is handling the current conversation.
Useful for multi-agent setups.
2026-02-12 17:45:38 +00:00
Nicolas Varrot
52a1a7f270 feat: human-friendly session titles in header and sidebar
Replace raw session keys/UUIDs with readable names derived from
session metadata (label, kind, channel). Priority: label > kind-based
name (Main, Cron, Task) with channel suffix > cleaned key fallback.

New utility: src/lib/sessionName.ts used by both Header and Sidebar.
2026-02-12 17:35:53 +00:00
Nicolas Varrot
4c8faf07e3 fix: prevent autoFormatText from wrapping markdown prose in code fences
The looksLikeCode/isCodeLine heuristics were too aggressive:
- Pattern /^\s*(\/\/|#|\/\*|\*)/ matched markdown bold (**text**) and
  headings (# title) as code comments, causing entire sections to be
  wrapped in code fences and rendered as raw text
- Pattern /^\s*(\/\/|#)/ in isCodeLine caught markdown headers
- Added early bail-out when text contains markdown indicators (**bold**,
  headings, bullet lists) to prevent false positives
- Narrowed comment detection to actual code comments only

Fixes: raw **bold** shown in long assistant messages (reported by Josh)
2026-02-12 17:26:32 +00:00
Nicolas Varrot
03eb9e6de2 feat: per-session input drafts preserved on session switch 2026-02-12 17:15:26 +00:00
Nicolas Varrot
e94325b38a feat: delete session from sidebar with confirmation dialog 2026-02-12 16:57:18 +00:00
Nicolas Varrot
581675d00c feat: distinguish system events from user messages
System events (heartbeats, cron triggers, webhooks, channel events)
now render as subtle inline notifications instead of full user bubbles.
Detection based on content patterns ([EVENT], [cron:], [HEARTBEAT], etc.).
2026-02-12 16:49:16 +00:00
Nicolas Varrot
fa9b10ac97 feat: resizable sidebar with drag handle and persisted width 2026-02-12 15:46:39 +00:00
Nicolas Varrot
8ef1b428a3 fix: mobile viewport overflow — prevent horizontal clipping on iPhone
- Add overflow-x: hidden on html/body and max-width: 100vw
- Add overflow-x: hidden on root app container
- Add overflow-x: hidden on chat scroll container
- Make markdown tables scrollable with display: block + overflow-x: auto
- Add overflow-hidden + min-w-0 on expanded tool call content
- Fix tool result summary max-width from max-w-md to max-w-full

Fixes #26
2026-02-12 12:42:20 +00:00
Nicolas Varrot
1465ae1887 style: move model badge from header to token progress bar area 2026-02-12 12:25:17 +00:00
Nicolas Varrot
e24378aa75 feat: add session pinning to sidebar
- Pin icon appears on hover for each session, filled when pinned
- Pinned sessions sort to top of list (preserved across page reloads via localStorage)
- Subtle divider separates pinned from unpinned sessions
- i18n support for pin/unpin labels (EN + FR)
2026-02-12 12:19:18 +00:00
Nicolas Varrot
96f28836cd feat: display model name badge in header for active session
Shows the model (e.g. claude-opus-4-6) as a subtle chip next to the
session label in the header. Hovering reveals agent ID if available.
Model and agentId are now extracted from sessions.list response.
2026-02-12 12:06:12 +00:00
Nicolas Varrot
c0d27a7754 feat: add unread message indicators on sidebar sessions
Show a cyan dot on sessions that received new messages while
viewing a different session. The dot clears when switching to
that session.
2026-02-12 11:36:31 +00:00
Nicolas Varrot
6734b54389 fix: resolve CI lint errors in Sidebar, TypingIndicator, and useGateway
- Sidebar: replace useEffect setState with callback pattern for filter reset
- TypingIndicator: initialize useRef with 0 instead of impure Date.now()
- TypingIndicator: remove redundant setElapsed(0) from mount effect
- useGateway: remove unused eslint-disable directive
2026-02-12 11:27:42 +00:00
Nicolas Varrot
908dbb4a60 feat: add copy buttons to expanded tool call parameters and results 2026-02-12 11:16:34 +00:00
Nicolas Varrot
ae3f6839bc feat: show language label on fenced code blocks
Display a header bar above code blocks with the detected language
name (e.g. TypeScript, Python, Shell). Pretty-prints common language
identifiers. The copy button remains in the top-right corner.
2026-02-12 10:46:18 +00:00
Nicolas Varrot
0c95150635 feat: add elapsed time counter to thinking indicator
Shows how long the agent has been thinking (e.g. '5s', '1m 23s').
Timer appears after 2 seconds to avoid flicker on fast responses.
Helps users gauge if a request is still processing or stuck.
2026-02-12 10:37:07 +00:00
Nicolas Varrot
f2038a2022 feat: auto-focus chat input on session switch and connection 2026-02-12 10:17:05 +00:00
Nicolas Varrot
f55a24cb06 feat: add keyboard navigation for session list in sidebar
Arrow Up/Down to navigate sessions, Enter to select, Escape to close.
Sessions use role='option' with aria-selected for screen reader support.
Mouse hover syncs with keyboard focus index for smooth interaction.
2026-02-12 09:56:13 +00:00