Skip to content
Merged
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
24 changes: 24 additions & 0 deletions desktop/dock/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,10 @@ impl DockView {
}
let custom = if single { self.content.header(&selected, window, cx) } else { None };
let fills = custom.is_some() && self.content.header_fills(&selected, cx);
// A custom header takes the tab's place, and its × with it: without
// one at the bar's end, a thread's own panel could only be closed
// from a right-click menu (Wayne, 19 Nov 2026).
let header_close = custom.is_some() && self.content.closable(&selected, cx);
if let Some(custom) = custom {
let press_panel = selected.clone();
bar = bar.child(
Expand Down Expand Up @@ -843,6 +847,26 @@ impl DockView {
if let Some(accessory) = self.content.accessory(&selected, window, cx) {
bar = bar.child(accessory);
}
if header_close {
let title = self.content.title(&selected, cx);
let close = selected.clone();
bar = bar.child(
div()
.id(ElementId::Name(format!("dock-header-close-{}", group.id).into()))
.flex_none()
.size(px(24.))
.flex()
.items_center()
.justify_center()
.rounded(px(6.))
.cursor_pointer()
.hover(|s| s.bg(theme.tab_hover))
.child(svg().path(Lucide::Close.path()).size(px(13.)).text_color(theme.secondary))
.tooltip(move |window, cx| Tooltip::new(format!("Close {title}")).build(window, cx))
.on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation())
.on_click(cx.listener(move |this, _: &ClickEvent, _, cx| this.model.update(cx, |m, cx| m.close(&close, cx)))),
);
}
bar
}

Expand Down
3 changes: 2 additions & 1 deletion docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,8 @@ The icons down the right edge of the window open and close the thread's
own panels: Highlights at the top, one for each panel its patches add,
and Patches at the foot. To open a thread in a panel of its own, beside
the one you're reading, right-click it in the list and pick Open in New
Panel.
Panel. The × at the end of its title bar closes it, and Move to Main
Panel, on the same right-click menu, brings it back to the main panel.

A patch's panel follows the thread you pick, and steps aside for a thread
that doesn't have it. To keep one in view while you work in another
Expand Down
Loading