Skip to content

fix(desktop): show private/forum icons in channel browser rows - #6205

Open
santhiprakash wants to merge 1 commit into
block:mainfrom
santhiprakash:fix/desktop-channel-browser-private-visibility-6120
Open

fix(desktop): show private/forum icons in channel browser rows#6205
santhiprakash wants to merge 1 commit into
block:mainfrom
santhiprakash:fix/desktop-channel-browser-private-visibility-6120

Conversation

@santhiprakash

@santhiprakash santhiprakash commented Aug 18, 2026

Copy link
Copy Markdown

Fixes #6120.

Summary

The Add Channel dialog (ChannelBrowserDialog) rendered every row with a hardcoded # prefix, ignoring channel.visibility and channel.channelType. The sidebar already shows a lock for private channels and a file icon for forum channels; the channel browser drifted away from that and the same channel looked different in two surfaces of the same window.

This PR adds a pure, unit-testable ChannelRowIcon component with a getChannelRowIconKind() helper and uses it in ChannelBrowserDialog so the browser matches the sidebar's precedence (privateforum#).

While this branch was open, main landed ChannelGlyph in SidebarSection via #6590, which also handles the project-home icon. Rebased on current main and left SidebarSection on ChannelGlyph to avoid duplicating or regressing that new behavior. ChannelRowIcon is now the browser-only icon, which keeps the PR focused on the reported bug.

Evidence

Checked against current main:

  • ChannelBrowserDialog.tsx was emitting a literal # regardless of channel kind.
  • SidebarSection.tsx now uses ChannelGlyph for the same visibility/type precedence (plus project home).

Reproduce

  1. Create or join a private channel and a public channel in the same community.
  2. Open the channel browser (Add channel).
  3. Both rows show #. Nothing marks the private one as private.
  4. The sidebar shows a lock on the private channel.

Expected

The browser row uses the same icon logic as the sidebar: lock for visibility === private, FileText for forum channels, # otherwise.

Testing

cd desktop && node --import ./test-loader.mjs --experimental-strip-types \
  --test src/features/channels/ui/ChannelRowIcon.test.mjs

6/6 pass. The helper is tested directly (getChannelRowIconKind) and the component is rendered under JSDOM + @testing-library/react to assert the right lucide-* class reaches the DOM for each channel kind.

tsc --noEmit -p tsconfig.json is clean.

Notes

  • No screenshot: the icons are already present in the sidebar and the change makes the browser match it — the sidebar is the reference.
  • File-by-file:
    • +desktop/src/features/channels/ui/ChannelRowIcon.tsx (new): 41 lines.
    • +desktop/src/features/channels/ui/ChannelRowIcon.test.mjs (new): 132 lines.
    • ~desktop/src/features/channels/ui/ChannelBrowserDialog.tsx: replace hardcoded # span with ChannelRowIcon.

@santhiprakash
santhiprakash requested a review from a team as a code owner August 18, 2026 11:24
@santhiprakash
santhiprakash force-pushed the fix/desktop-channel-browser-private-visibility-6120 branch 2 times, most recently from 2a02efa to 9f7c9f1 Compare August 27, 2026 01:50
The Add Channel dialog rendered every row with a hardcoded '#' prefix, ignoring channel.visibility and channel.channelType. The sidebar already shows a lock for private channels and a file icon for forum channels; the channel browser drifted away from that and the same channel looked different in two surfaces of the same window (block#6120).

Add a pure, unit-testable ChannelRowIcon component with getChannelRowIconKind() and use it in ChannelBrowserDialog. The sidebar now uses ChannelGlyph (introduced by block#6590), so this PR focuses on the browser surface.

Tests cover the helper directly and render the component under JSDOM to assert the right lucide-* class reaches the DOM for each channel kind.

Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
@santhiprakash
santhiprakash force-pushed the fix/desktop-channel-browser-private-visibility-6120 branch from 9f7c9f1 to 33bf57d Compare August 28, 2026 15:51
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 86b9142a09f2af3ba2fff7effa6a6cd53b40f51c...33bf57da93c0820eb21894d70aa46f1cdd8964ac.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 33bf57da93c0820eb21894d70aa46f1cdd8964ac to authorize a new review.
Any previous review applies only to its recorded range.

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.

Desktop: channel browser renders every channel with '#' — private channels are indistinguishable from open ones (sidebar shows a lock)

1 participant