Repository navigation
feat(ui): interleaved sidebar zone with custom session icons and drag ordering - #110682
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 18, 2026, 8:11 AM ET / 12:11 UTC. Summary PR surface: Source +919, Tests +212, Other +2. Total +1133 across 40 files. Reproducibility: not applicable. as a bug reproduction: this is a new UI and protocol capability. The submitted screenshots and focused tests provide a high-confidence demonstration of the intended picker and pinned-row behavior. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Decide whether OpenClaw should support arbitrary agent-drawn SVG in session state; if not, ship the proven named-icon and single-emoji picker path only, and keep the gateway/tool contract limited to those formats. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this is a new UI and protocol capability. The submitted screenshots and focused tests provide a high-confidence demonstration of the intended picker and pinned-row behavior. Is this the best way to solve the issue? Unclear. The named-icon and emoji path is a narrow maintainable solution, while arbitrary persisted SVG adds a security-sensitive public contract that needs an explicit owner decision before it can be judged the best solution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 74880cb56f9e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +919, Tests +212, Other +2. Total +1133 across 40 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b1b01db74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| import { | ||
| normalizeSessionIconInput, | ||
| parseSessionIcon, | ||
| } from "../../../packages/gateway-protocol/src/index.js"; |
There was a problem hiding this comment.
Import icon helpers from the leaf module
When the Control UI sidebar loads, app-sidebar-session-list.ts imports this registry, so this value import executes the gateway-protocol barrel. That barrel imports the full schema/validator graph (packages/gateway-protocol/src/index.ts pulls in protocol-validator and the schema registry), while nearby UI code already documents that the barrel/typebox runtime must stay out of normal startup (ui/src/components/session-row-badges.ts:2). This adds a large startup dependency just to parse icons; import session-icon.js directly here and in session-menu.ts instead.
Useful? React with 👍 / 👎.
… regen Swift protocol client
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb973d4d4c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const EXTENDED_PICTOGRAPHIC_RE = /\p{Extended_Pictographic}/u; | ||
| const SVG_PREFIX = "svg:"; | ||
| const SVG_MAX_BYTES = 4096; | ||
| const graphemeSegmenter = new Intl.Segmenter(undefined, { granularity: "grapheme" }); |
There was a problem hiding this comment.
Avoid crashing when Intl.Segmenter is unavailable
In browsers or WebViews without Intl.Segmenter, this top-level construction throws during module evaluation; the sidebar imports this helper through ui/src/components/session-icon-registry.ts, so the Control UI can fail to start before any fallback icon is rendered. Nearby UI code already treats Segmenter as optional with fallbacks (ui/src/app-navigation.ts:139 and ui/src/pages/plugins/presentation.ts:210), so this helper should do the same or fall back to a simpler grapheme check.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c24719cfdb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| sidebarEntries: prefSpec<string[]>({ | ||
| extract: (value) => normalizeSidebarEntries(value) ?? undefined, | ||
| local: (settings) => settings.sidebarEntries, |
There was a problem hiding this comment.
Compare sidebar prefs by value before applying server deltas
When sidebarEntries is synced, unchanged arrays are still treated as changed in applyServerUiPrefs because the per-field delta check uses reference inequality (prefs[prefKey] !== lastSeen[prefKey] at ui/src/app/server-prefs.ts:272). If another server pref changes while this browser has an unpushable/local-only sidebar order, the unchanged server sidebarEntries array is included in changed and serverPrefsLocalPatch applies it, reverting the local sidebar edit; the existing sync comment says unchanged fields must not do that. Use the same value comparison here before adding array-valued prefs.
Useful? React with 👍 / 👎.
| /** Custom sidebar icon in the format accepted by the gateway protocol session-icon helper. */ | ||
| icon?: string; |
There was a problem hiding this comment.
Carry session icons through cron session rollovers
This adds icon as durable session management state, but the cron fresh-session path still only carries the older preference fields (FRESH_CRON_CARRIED_PREFERENCE_FIELDS in src/cron/isolated-agent/session.ts includes pinnedAt, label, and displayName, but not icon). For a pinned cron/scheduled session with a custom icon, the next forced/fresh rollover keeps the pin but silently drops the icon, unlike reset/compaction paths updated in this commit; classify icon with the carried cron preferences too.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
… ordering (openclaw#110682) * feat(ui): custom session icons with agent-drawable SVG and nav-parity pinned rows * wip: slice-2 interleaved sidebar zone (pre-review) * fix(ui): trim icon exports, bypass protocol barrel in startup bundle, regen Swift protocol client * fix(ui): preserve unknown-agent zone entries on writes, prune entries on any unpin * fix(ui): reset keeps unloaded session slots; enforce SVG byte cap on canonical form * fix(ui): archiving a pinned session retires its sidebar zone slot * fix(ui): persist drag-pinned zone slot only after the pin patch lands * fix(ui): recompute drop insertion against freshest zone order on pin ack * fix(ui): consume self-drop events before the zone bailout * docs(ui): note the non-sidebar unpin pruning contract on pruneSidebarSessionEntry * refactor(ui): extract pure session-tree projection; drop unused zone type export
… ordering (openclaw#110682) * feat(ui): custom session icons with agent-drawable SVG and nav-parity pinned rows * wip: slice-2 interleaved sidebar zone (pre-review) * fix(ui): trim icon exports, bypass protocol barrel in startup bundle, regen Swift protocol client * fix(ui): preserve unknown-agent zone entries on writes, prune entries on any unpin * fix(ui): reset keeps unloaded session slots; enforce SVG byte cap on canonical form * fix(ui): archiving a pinned session retires its sidebar zone slot * fix(ui): persist drag-pinned zone slot only after the pin patch lands * fix(ui): recompute drop insertion against freshest zone order on pin ack * fix(ui): consume self-drop events before the zone bailout * docs(ui): note the non-sidebar unpin pruning contract on pruneSidebarSessionEntry * refactor(ui): extract pure session-tree projection; drop unused zone type export
What Problem This Solves
Pinned sessions promoted a conversation into the sidebar, but they read like list rows under a "PINNED" label rather than first-class sidebar entries, they had no identity of their own, and nothing in the top zone could be arranged. This PR makes the sidebar's top zone one coherent surface: nav pages and pinned sessions interleave in a single drag-ordered list under a fixed Home row, every pinned session can carry a custom icon (user-picked or agent-drawn), and entries move — drag a session up to pin it in place, drag a page or pinned session down into the session list to hide/unpin it (pages come back from the pen menu on the Pages header).
Why This Change Was Made
Icons (server-side, protocol, agent surface)
iconstring: one emoji grapheme,name:<id>from a curated 12-icon UI registry, orsvg:<svg …>drawn by an agent. The shared parser/sanitizer lives inpackages/gateway-protocol/src/session-icon.ts; the SVG sanitizer is a strict hand-written tokenizer (whitelisted elements/attributes only; no scripts, handlers, hrefs, url()/data:, DOCTYPE, comments, namespaces; paint values restricted; canonical reserialization; the 4 KiB cap is enforced on the canonical serialized form since entity re-encoding can expand input). The UI re-validates before rendering SVG.sessions.patchparam + row/event projection; write scope matches the other chat-organization fields.iconpersists likepinnedAtand survives list projection,sessions.changedevents, reset, and compaction. Swift protocol client regenerated.sessionstool'spatchaction gainsicon, so agents can pick or draw one.Interleaved zone (UI-local, synced prefs)
sidebarPinnedRoutesis replaced by orderedsidebarEntries(route:<id>/session:<key>) in the gateway-synced ui.prefs, with a one-time read migration from the legacy key. Home is fixed and never in the list.reconcileSidebarZonerenders valid routes plus currently-pinned sessions in entry order, appends externally pinned sessions, and — on canonical writes — preserves entries whose sessions are not loaded in the current view (other agents, loading caches), so synced cross-agent order cannot be corrupted by a partial view.User Impact
The sidebar's top zone is now fully yours: pages and pinned conversations mix in one ordered list, each pinned chat has a cute icon (or one an agent drew), and everything rearranges by drag. Hidden pages return via the pen menu.
Evidence
Backend:
node scripts/run-vitest.mjs packages/gateway-protocol/src/session-icon.test.ts src/gateway/sessions-patch.test.ts src/agents/tools/sessions-tool.test.ts— 12 + 86 + 10 green (hostile-SVG matrix incl. canonical-expansion byte-cap regression).UI:
node scripts/run-vitest.mjs ui/src/lib/sidebar-zone.test.ts ui/src/components/app-sidebar.test.ts ui/src/components/session-menu.test.ts ui/src/app/settings.node.test.ts ui/src/app/server-prefs.test.ts ui/src/app-navigation-groups.test.ts— 209+ green, incl. interleave order, drag reorder/pin/hide writes, unknown-agent slot preservation, prune-on-unpin.Live: drag-reorder, drag-hide, and drag-unpin exercised against
pnpm dev:ui:mockvia Playwright (screenshots above; entry-state dumps asserted).Perf: barrel import of gateway-protocol removed from startup JS — 12 requests / 291.4 KiB gzip (limits 18 / 310); CSS budget green on the merge tree (36.5 KiB vs 38.0 limit).
Six autoreview rounds (Codex/Sol, xhigh); every accepted finding fixed in dedicated commits (unknown-slot preservation, unpin/archive pruning, reset canonical filtering, SVG canonical byte cap, pin-ack write ordering, self-drop bubbling); one consciously rejected edge (Sessions-page unpin relies on documented known-unpinned pruning).
Full CI green on head c24719c: run 29650964215 (all lanes incl. QA smoke, lint, dependencies, bundled-protocol).