Skip to content

feat: externally managed channels, sidebar sections, archive hiding, embed channel view - #102

Merged
steipete merged 4 commits into
mainfrom
feat/managed-channels
Jul 19, 2026
Merged

steipete merged 4 commits into
mainfrom
feat/managed-channels

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 durable channel.updated event (now carries archived). The sidebar now renders sections by sidebar_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/thread page) lets a host app dock a whole channel.

User Impact

Bots with channels:write can 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

Sidebar: sections + managed markers + Archived group Embed channel view
sidebar embed

pnpm test, pnpm typecheck && pnpm -r typecheck, pnpm lint, pnpm fmt:check all pass; new Go tests for field round-trips/clearing + archived event metadata + embed CSP; new Playwright e2e tests/e2e/embed-channel.spec.ts passes; embedded dist refreshed via pnpm build.

@steipete
steipete marked this pull request as ready for review July 19, 2026 08:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +143 to 146
: group.channels.filter(
(channel) =>
(channel.id === selectedChannelID && !selectedDirectID) ||
(channel.unread_count || 0) > 0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant