Repository navigation
feat: externally managed channels, sidebar sections, archive hiding, embed channel view - #102
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d358e826e2
ℹ️ 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".
| : group.channels.filter( | ||
| (channel) => | ||
| (channel.id === selectedChannelID && !selectedDirectID) || | ||
| (channel.unread_count || 0) > 0, |
There was a problem hiding this comment.
Keep archived rows hidden when their group is collapsed
When an archived channel has unread messages—for example, another member archives it before this user reads it—this predicate still renders the channel even though the Archived disclosure defaults to collapsed. As a result, archiving does not reliably hide the channel and a visibly collapsed group can contain rows; the unread exception should not apply to the archived group.
Useful? React with 👍 / 👎.
What Problem This Solves
External systems (specifically the OpenClaw gateway, which binds one discussion channel per agent session) need to manage ClickClack channels programmatically: mark them as externally managed with a link back to the owning object, group them in the sidebar, and archive them so they leave the sidebar without losing history. Today channels have no external identity, no grouping, and archiving a channel does not even hide it.
Why This Change Was Made
Adds four additive channel fields —
external_managed,external_ref,external_url,sidebar_section— through migration (SQLite + Postgres), store, API (create + PATCH with empty-string clearing), OpenAPI/SDK, and the durablechannel.updatedevent (now carriesarchived). The sidebar now renders sections bysidebar_section, hides archived channels behind a collapsed "Archived" group, and shows a link marker + external-link affordance for managed channels. A standalone/embed/channel/{workspace}/{channel}view (mirroring the recent/embed/threadpage) lets a host app dock a whole channel.User Impact
Bots with
channels:writecan create and lifecycle-manage channels end to end; archived channels disappear from the sidebar but stay findable; grouped session channels render in their own section; hosts can iframe a live channel. Unmanaged deployments see no behavior change beyond archived channels finally being hidden.Evidence
pnpm test,pnpm typecheck && pnpm -r typecheck,pnpm lint,pnpm fmt:checkall pass; new Go tests for field round-trips/clearing + archived event metadata + embed CSP; new Playwright e2etests/e2e/embed-channel.spec.tspasses; embedded dist refreshed viapnpm build.