Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(channels): keep the narrow Chat sidebar open when switching tabs (#9198)

gbirman513887f0b3e6
diff --git a/apps/web/src/components/view-shell/ViewShell.test.tsx b/apps/web/src/components/view-shell/ViewShell.test.tsx
index 628f908210..761b7cf31a 100644
--- a/apps/web/src/components/view-shell/ViewShell.test.tsx
+++ b/apps/web/src/components/view-shell/ViewShell.test.tsx
@@ -546,6 +546,22 @@ describe('pinned navigation', () => {
screen.queryByRole('button', { name: 'Hide navigation' })
).toBeNull();
});
+
+ it('keeps an open narrow overlay open when the pin changes', () => {
+ measurement.width = () => 600;
+ const [pinned, setPinned] = createSignal(true);
+ render(() => <Workspace app="channels" asidePinned={pinned()} />);
+ fireEvent.click(screen.getByRole('button', { name: 'Show navigation' }));
+
+ setPinned(false);
+ expect(
+ screen.getByRole('button', { name: 'Close navigation backdrop' })
+ ).toBeTruthy();
+ setPinned(true);
+ expect(
+ screen.getByRole('button', { name: 'Close navigation backdrop' })
+ ).toBeTruthy();
+ });
});
describe('required navigation', () => {
diff --git a/apps/web/src/features/channels-view/channels-view.tsx b/apps/web/src/features/channels-view/channels-view.tsx
index 313dd5a740..aa8dd2e41f 100644
--- a/apps/web/src/features/channels-view/channels-view.tsx
+++ b/apps/web/src/features/channels-view/channels-view.tsx
@@ -174,9 +174,11 @@ function ChannelsViewRoot() {
<ViewShell.Root
asidePreferenceKey="channels"
// The empty state only points at the rail, so keep it open.
- asideRequired={
- threadsTab() || selectedChannel() === undefined
- }
+ asideRequired={selectedChannel() === undefined}
+ // Keep the tab out of asideRequired: every change to it
+ // resets a narrow overlay, so switching tabs inside the
+ // overlay would close it.
+ asidePinned={threadsTab()}
aside={{
width: state.asideWidth,
preserveDuringResize: false,
diff --git a/docs/agent-guide/channels.md b/docs/agent-guide/channels.md
index 9a1aa726ee..5fe1ac6bde 100644
--- a/docs/agent-guide/channels.md
+++ b/docs/agent-guide/channels.md
@@ -906,7 +906,10 @@ with the same sort and `+` controls as the All tab's sections. Conversations
lists only channels and DMs that hold threads the user takes part in; it pages
through the user's threads and loads their channels, so scrolling the section
reveals more. Selecting a row filters the main pane instead of opening the
-conversation. `All threads` clears the filter.
+conversation. `All threads` clears the filter. At desktop width the rail stays
+docked on Threads with no **Hide navigation** control. In narrow splits the tab
+neither opens nor closes the slide-over, so switching between `Threads`, `All`,
+and `Recent` inside it keeps it open.
The main pane is a virtualized list of channel threads the user takes part in,
newest reply first. It loads more as it nears the end and returns to the top