Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/src/app/contrib/controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ registry.registerMany([
collapsible: true,
dock: { pane: 'workspace', pos: 'left' },
revealAliases: ['chat-sidebar'],
showCloseButton: false,
width: `${SIDEBAR_DEFAULT_WIDTH}px`,
minWidth: `${SIDEBAR_DEFAULT_WIDTH}px`,
maxWidth: `${SIDEBAR_MAX_WIDTH}px`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ interface PaneChrome extends PaneSizing {
/** No Close in the tab menu — the one surface the app can't lose (the
* main workspace). Session tiles share `placement: 'main'` but close. */
uncloseable?: boolean
/** Hide the hover ✕ while retaining explicit close behavior for this pane. */
showCloseButton?: boolean
/** Wrap this pane's TAB (e.g. in a domain context menu — a session tile's
* pin/branch/rename/archive/delete). The wrapper must render `tab` as its
* interactive child; the zone's own strip menu still owns non-tab space. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ export function TreeGroup({
}}
role="tab"
selected={isSelected}
showCloseButton={chrome.showCloseButton !== false}
style={{ cursor: 'grab' }}
>
{chrome.tabLead ? (
Expand Down
15 changes: 15 additions & 0 deletions apps/desktop/src/components/ui/pane-tab.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ describe('PaneTab hover close button', () => {
expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()
})

it('can hide the hover ✕ while retaining the close handler', () => {
const onClose = vi.fn()
render(
<PaneTab onClose={onClose} showCloseButton={false}>
<PaneTabLabel>tab</PaneTabLabel>
</PaneTab>
)

expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()
const tab = screen.getByText('tab')
fireEvent.pointerDown(tab, { button: 1 })
fireEvent.pointerUp(tab, { button: 1 })
expect(onClose).toHaveBeenCalledTimes(1)
})

it('renders no ✕ on a vertical rail tab (middle/⌘-click only there)', () => {
const onClose = vi.fn()
render(
Expand Down
5 changes: 4 additions & 1 deletion apps/desktop/src/components/ui/pane-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ interface PaneTabProps extends React.ComponentProps<'div'> {
/** Part of a multi-tab selection (⌥/Ctrl-click, Shift-click) — an accent
* wash marks every tab that a drag would carry, Chrome-style. */
selected?: boolean
/** Whether a closeable horizontal tab reveals the hover ✕. */
showCloseButton?: boolean
/** Vertical rail form (collapsed sidebar zones). */
vertical?: boolean
/** Content-facing edge of a vertical rail — the strip line the active tab cuts. */
Expand All @@ -81,6 +83,7 @@ export const PaneTab = React.forwardRef<HTMLDivElement, PaneTabProps>(function P
onPointerUp,
onClickCapture,
selected = false,
showCloseButton = true,
vertical = false,
side = 'left',
children,
Expand Down Expand Up @@ -159,7 +162,7 @@ export const PaneTab = React.forwardRef<HTMLDivElement, PaneTabProps>(function P
<span className="size-2 rounded-full bg-amber-500 shadow-[0_0_0_2px_var(--tab-bg),0_1px_2px_rgba(0,0,0,0.45)] dark:bg-amber-400" />
</span>
)}
{onClose && !vertical && (
{onClose && showCloseButton && !vertical && (
// Hover ✕, painted OVER the label's right edge as an overlay (no
// layout shift, tab width never jumps on hover). The runway is a tiny
// transparent→`--tab-face` gradient, so the button melts into the
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/plugins/hermes-bots/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9777,7 +9777,7 @@ export default {
// sessions pane collapses alone without this flag. The zone then keeps
// a stranded BOTS tab on screen. The narrow edge overlay mirrors the
// zone's tab strip, so the pane stays reachable while collapsed.
data: { placement: 'left', width: '260px', collapsible: true, dock: { pane: 'sessions', pos: 'center', enforce: true } },
data: { placement: 'left', width: '260px', collapsible: true, showCloseButton: false, dock: { pane: 'sessions', pos: 'center', enforce: true } },
render: () => jsx(BotsPane, {})
})

Expand Down