Commit Graph

391 Commits

Author SHA1 Message Date
MarlburroW
c2a4ddc5e7 Merge pull request #16 from yardobr/feat/new-session-command
feat: add /new slash command to create chat sessions
2026-02-28 22:00:29 +01:00
Yaro
4e66d7c4bd feat: add /new slash command to create chat sessions
Introduces a `/new` slash command that lets users create a fresh chat
session for the current agent without leaving the chat input.

- Add `createNewSession` to `useGateway` that calls `sessions.create`
  on the gateway (with a client-side fallback key when the RPC is
  unavailable).
- Register `/new` in the slash-command menu with i18n descriptions
  across all 8 supported languages.
- Wire `onNewSession` through `Chat` → `ChatInput` so typing `/new`
  triggers session creation.
- Add `extractAgentIdFromKey` and `formatAgentId` helpers to
  `sessionName.ts` to derive a human-readable agent name from the
  session key (e.g. `agent:my-cool-bot:…` → "My Cool Bot").
- Use the new helpers in `Header` and `App` to show per-session agent
  names, especially for sub-agent sessions where the gateway-level
  identity differs from the session agent.

Made-with: Cursor
2026-02-28 22:43:20 +02:00
Nicolas Varrot
a11cebdc55 a11y: add aria-labels to sidebar footer buttons 2026-02-28 09:02:52 +00:00
Nicolas Varrot
d852652390 chore: bump to v1.67.4 2026-02-27 21:02:18 +00:00
Nicolas Varrot
9ef1c8be0d perf: lazy-load highlight.js in ToolCall for better code-splitting
ToolCall.tsx previously imported highlight.js statically, pulling the
entire hljs bundle into the main Chat chunk and preventing Vite from
splitting it into the lazy markdown chunk.

Now hljs is dynamically imported and loaded on first use. This:
- Removes the Vite build warning about mixed static/dynamic imports
- Reduces the Chat chunk by ~1.6 KB
- Consolidates hljs into the lazy markdown chunk
- Renders unhighlighted text instantly, then re-renders with syntax
  highlighting once hljs loads (typically < 100ms)
2026-02-27 21:02:13 +00:00
Nicolas Varrot
e77a1c8dcb fix: display image attachments in user message bubbles
Images sent by the user were transmitted to the gateway correctly but
not shown in the chat UI, making it appear as if attachments were lost.

Now image blocks are included in the user message for immediate visual
feedback.

Closes #14
2026-02-27 13:31:39 +00:00
Nicolas Varrot
88c98f4a66 a11y: add role and keyboard dismiss to overlay backdrops in Sidebar 2026-02-27 09:02:19 +00:00
Nicolas Varrot
8279687898 chore: bump to v1.67.2 2026-02-25 21:02:33 +00:00
Nicolas Varrot
d49d118e26 a11y: add aria-labels and aria-pressed/expanded to LoginScreen buttons 2026-02-25 21:02:23 +00:00
Nicolas Varrot
a9fb646662 chore: bump to v1.67.1 2026-02-24 21:02:05 +00:00
Nicolas Varrot
59a4da1933 refactor: extract shared message parsing helpers into lib/messageExtract
- Move extractText and extractThinking from useGateway and useSecondarySession into shared lib
- Add comprehensive unit tests (13 tests) for both functions
- Eliminate code duplication between the two hooks
2026-02-23 21:02:45 +00:00
Nicolas Varrot
ecdff58dca chore: bump to v1.66.7 2026-02-23 14:46:27 +00:00
Nicolas Varrot
f685f716f8 test: add unit tests for usePwaInstall hook 2026-02-23 14:46:19 +00:00
Nicolas Varrot
e8fe3329f3 feat: add configurable client ID for WebSocket connect frame
Add a clientId option that can be set via:
- VITE_CLIENT_ID env var at build time
- Advanced section in the login screen at runtime
- Stored in localStorage with other credentials

Defaults to 'webchat' for backward compatibility. Users can set it
to 'openclaw-control-ui' to use OpenClaw's dangerouslyDisableDeviceAuth
bypass without post-install patching.

Closes #11
2026-02-23 14:41:15 +00:00
Nicolas Varrot
6ed6a4eadf chore: bump to v1.66.6 2026-02-23 09:05:01 +00:00
Nicolas Varrot
3b28de9f72 test: add unit tests for useNotifications hook and setBaseTitle 2026-02-23 09:04:32 +00:00
Nicolas Varrot
9faa5014a6 perf: wrap ToolCall, CodeBlock, ThinkingBlock, ImageBlock in React.memo
Prevents unnecessary re-renders of these frequently rendered child
components when parent message list updates but individual props
haven't changed.
2026-02-22 21:03:31 +00:00
Nicolas Varrot
4163124c6a test: add unit tests for useSwipeSidebar and useLocale hooks, exclude tests from build tsconfig 2026-02-22 09:03:17 +00:00
Nicolas Varrot
3c51e46cbb test: add unit tests for useSendShortcut hook and @testing-library/react 2026-02-21 21:03:55 +00:00
Nicolas Varrot
a9da9407d4 chore: bump to v1.66.3 2026-02-21 09:04:21 +00:00
Nicolas Varrot
2a23f089cb fix: add missing aria-labels to icon-only buttons for accessibility
- ChatInput: add aria-labels to remove file, send shortcut toggle, and stop buttons
- CodeBlock: add aria-labels to word wrap, line numbers, and collapse/expand buttons
- Header: add aria-labels to session info, copy, close, and compact buttons
2026-02-21 09:03:45 +00:00
Nicolas Varrot
d607da691d refactor: remove duplicate exportConversation module, consolidate into exportChat 2026-02-20 21:02:19 +00:00
Nicolas Varrot
3970e8a00c test: add unit tests for hooks (useBookmarks, useUpdateCheck)
- Export loadBookmarks/saveBookmarks and isNewer for testability
- Add 12 tests covering bookmark persistence and semver comparison
- Total: 165 tests passing
2026-02-20 09:04:38 +00:00
Nicolas Varrot
295ba7b3e5 test: add unit tests for notificationSound module 2026-02-19 21:02:49 +00:00
Nicolas Varrot
525075e1fe chore: bump to v1.66.0 2026-02-18 22:07:15 +00:00
Nicolas Varrot
5c47dd2aeb feat: add password authentication support (closes #7)
Add token/password auth mode toggle on the login screen.
When password mode is selected, sends { password } instead of
{ token } in the WebSocket connect handshake.

Also adds clipboard utility tests and fixes credential test
to include authMode field.
2026-02-18 22:07:06 +00:00
togotago
16db1cf811 feat: strip webchat envelope metadata from user messages (#10)
When OpenClaw's webchat relays user messages, it wraps them in metadata
(conversation info JSON block + UTC timestamp prefix). This strips the
envelope at render time so users see only their actual text.

- Add hasWebchatEnvelope() and stripWebchatEnvelope() to systemEvent.ts
- Chain webchat + webhook stripping via stripAll() helper in ChatMessage
- Fix 'webhook' label only appearing for actual webhook messages, not
  for envelope-stripped webchat messages

Co-authored-by: togotago <drewmfleury@gmail.com>
2026-02-18 23:00:55 +01:00
togotago
0740d55dde feat: make system event messages collapsible (#9)
System events now render as compact pills (label + chevron + timestamp)
that expand on click to reveal the full message content.

- Collapsed (default): rounded-full pill with Zap icon, label, ChevronDown,
  and timestamp. Clean single-line appearance.
- Expanded (on click): rounded-xl container with full message text shown
  below in whitespace-pre-wrap. Chevron rotates 180deg.
- Added cursor-pointer and hover:bg-pc-elevated/50 for discoverability.
- Removed always-visible truncated text from collapsed state for a cleaner
  default appearance.

Co-authored-by: togotago <drewmfleury@gmail.com>
2026-02-18 23:00:50 +01:00
togotago
6311461ca0 feat: add system event detection for OpenClaw subagent and gateway messages (#8)
Add detection patterns for OpenClaw-specific system messages so they
render as subtle inline notifications instead of full chat bubbles:

- [System Message] — subagent completion notifications
- [Queued announce messages — batched system messages
- System: [timestamp] — gateway events (e.g. WhatsApp connected)
- Pre-compaction memory flush — internal memory prompts

Includes 6 test cases (5 positive matches + 1 negative for mid-sentence
false positive prevention).

Co-authored-by: togotago <drewmfleury@gmail.com>
2026-02-18 23:00:44 +01:00
Nicolas Varrot
42c84bc387 test: add deviceIdentity tests for buildDeviceAuthPayload (137 total) 2026-02-16 02:01:28 +00:00
Nicolas Varrot
6da30becac chore: bump to v1.65.0 (device identity is a feature, not a patch) 2026-02-16 00:03:27 +00:00
Nicolas Varrot
151215cd4b feat: device identity for OpenClaw 2026.2.14+ pairing (#6)
- Generate Ed25519 keypair via Web Crypto API
- Persist keypair in IndexedDB (survives page reloads)
- Sign connect payload with device private key
- Include device object in connect params (id, publicKey, signature, signedAt)
- Handle NOT_PAIRED error with 'pairing' connection status
- Show pairing-pending banner with instructions to run openclaw devices approve
- Extract nonce from connect.challenge for v2 payload signing
- Add i18n translations for pairing banner in all 8 languages

Closes #6
2026-02-16 00:00:20 +00:00
Nicolas Varrot
da75ac3ccc fix: correct toolUseId property name in export test 2026-02-15 22:02:26 +00:00
Nicolas Varrot
08842d1b3a test: add tests for mergeWithCache, exportAsMarkdown, and slashUtils (127 total) 2026-02-15 22:01:45 +00:00
Nicolas Varrot
414e2ccae5 fix: session tooltip click-through, copy buttons stopPropagation, rename spacebar (v1.64.2) 2026-02-15 20:39:28 +00:00
Nicolas Varrot
5ee2d119a5 docs: mark feedback items #75-#78 as done 2026-02-15 20:08:33 +00:00
Nicolas Varrot
b315d80dac chore: bump v1.64.1 2026-02-15 20:07:38 +00:00
Nicolas Varrot
7606a09ba9 fix: clipboard fallback for insecure contexts, session rename via sessions.patch
- Add copyToClipboard utility with execCommand fallback for HTTP deployments (#76)
- Replace all navigator.clipboard.writeText calls with copyToClipboard
- Session rename now persists server-side via sessions.patch (#78)
- Pass onRename callback from App to Sidebar
2026-02-15 20:07:33 +00:00
Nicolas Varrot
e05e17acd3 chore: bump v1.64.0 2026-02-15 18:04:31 +00:00
Nicolas Varrot
15ace2a9ba feat: collapsible long code blocks with expand/collapse toggle
Code blocks longer than 25 lines are now automatically collapsed,
showing only the first 10 lines with a gradient fade and a
'Show all N lines' button. Click to expand/collapse.

Also fixes version sync (package.json now matches v1.63.4)
and shows line count in the language header for long blocks.
2026-02-15 18:04:25 +00:00
Nicolas Varrot
eb63675761 fix: move action buttons below content to prevent overlap on short messages (v1.63.4) 2026-02-15 17:58:27 +00:00
Nicolas Varrot
bb100a0a22 fix: min-width on bubbles to prevent button wrap, fix session tooltip clickable, fix compact scope (v1.63.3) 2026-02-15 17:56:22 +00:00
Nicolas Varrot
38fb717758 fix: move retry button into inline toolbar (v1.63.2) 2026-02-15 17:43:48 +00:00
Nicolas Varrot
a38e56cd8c fix: message action buttons inside bubble (v1.63.1) 2026-02-15 17:09:50 +00:00
Nicolas Varrot
e52d5b7d51 fix: move message action buttons inside bubble, no more overflow clipping 2026-02-15 17:09:14 +00:00
Nicolas Varrot
a28898fed6 chore: bump v1.63.0 2026-02-15 16:05:00 +00:00
Nicolas Varrot
9ee9874181 feat: swipe gesture to open/close sidebar on mobile
Swipe right from the left edge to open the sidebar,
swipe left to close it. Standard mobile UX pattern
with edge detection, vertical drift rejection, and
time-based velocity check.
2026-02-15 16:04:57 +00:00
Nicolas Varrot
7890d34583 feat: session rename — double-click or pencil icon to set custom session names
- Double-click session name in sidebar to rename inline
- Pencil icon on hover for discoverability
- Custom names persisted in localStorage
- Enter to confirm, Escape to cancel, blur to save
- Clear name to revert to auto-generated display name
- Search filter respects custom names
- i18n for all 8 languages
2026-02-15 14:03:10 +00:00
Nicolas Varrot
eea9fadaf5 chore: bump v1.61.0 2026-02-15 12:04:16 +00:00
Nicolas Varrot
f012336e30 feat: reply-to-message with quote preview in chat input 2026-02-15 12:04:13 +00:00