镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

feat(channels): import sidebar sections from a pasted outline - #3265

Draft
joahg wants to merge 1 commit into
block:mainfrom
joahg:joah/import-channel-sections
Draft

joahg wants to merge 1 commit into
block:mainfrom
joahg:joah/import-channel-sections

Conversation

@joahg

@joahg joahg commented Nov 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds Import sections to the Channels section's ⋯ menu, right after Create section. People who move from another chat app can recreate their sidebar sections in one step instead of building each section by hand.

The dialog takes a pasted outline:

Code Review
#code-review
#ai-pr-approvals

Platform
- dx-help
  github-support
  • Section names: each unindented line is a section name. A trailing : is ignored.
  • Channel lines: these start with #, a bullet (-, *, •) or an indent. Channels listed before the first section name are ignored.
  • Matching: channel names match the user's stream channels, ignoring case, #, spaces and underscores. Archived channels, DMs and forums are skipped. Each channel is claimed by the first section that lists it.
  • Existing sections: a section whose name matches an existing one, ignoring case, is reused rather than duplicated.
  • Starred channels: these stay in Starred. The preview lists them as "Staying in Starred".
  • Preview: before anything is written, the dialog shows each section as new or existing, its channel count and any names that matched none of the user's channels.
  • Saving: writes go through the existing sidebarPreferences createSection and assign paths, one at a time. A retry after a partial failure reuses the section IDs it already generated, so it doesn't create duplicate sections.

Files

  • src/bundled/channels/section-import.ts: outline parsing and import planning, with no UI.
  • src/bundled/channels/ImportSidebarSections.tsx: the dialog, built from the shared Dialog, Field, Textarea and Button.
  • SidebarSection.tsx and ChannelInventory.tsx: the menu item and the dialog mount.

Testing

  • pnpm typecheck and pnpm lint pass.
  • vitest run src/bundled/channels: 1,167 pass, including the new section-import.test.ts.
  • pnpm test:browser --project=chromium sidebar-section: all 19 pass. That includes the new sidebar-section-import.spec.mjs, which pastes an outline, checks the preview and imports. It then reloads and checks that the sections and channel assignments persisted. The menu-order assertion in sidebar-section-creation.spec.mjs is updated for the new item.
  • An agent exercised the dialog in headless Chromium, but not in the native app yet. A human hasn't tested it, so this stays a draft.

How to test

  1. Run bin/just desktop and sign in.
  2. Hover Channels, open ⋯ and choose Import sections.
  3. Paste an outline that uses a few of your channel names. Include one name you aren't in and one starred channel.
  4. Check the preview. It should show the matched counts, "Not in your channels" for the unknown name and "Staying in Starred" for the starred channel.
  5. Click Import N channels. The sections should appear with their channels and still be there after a restart.

🤖 Generated with Claude Code

Adds "Import sections" to the Channels section menu. Paste an outline of
section names followed by their channels (for example a Slack sidebar),
preview which channels match, then create the sections and move the
matched channels. Sections with the same name are reused, and starred
channels stay starred.

Co-authored-by: Hertz <c6741012416ef5c49a865db79682113385c5fb998e8c890234fb442b59e22748@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Joah Gerstenberg <joah@squareup.com>

This branch has not been deployed

No deployments
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