Skip to content
3 changes: 2 additions & 1 deletion frontend/src/components/window/workspace/Panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</script>

<LayoutCol on:pointerdown={() => panelType && editor.handle.setActivePanel(panelType)} class={`panel ${className}`.trim()} {classes} style={styleName} {styles}>
<LayoutRow class="tab-bar" classes={{ "min-widths": tabMinWidths }}>
<LayoutRow class="tab-bar" classes={{ "min-widths": tabMinWidths }} on:dblclick={() => editor.handle.newDocumentDialog()}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add the click handler to a new element that fills the portion of the bar not occupied by tabs, you won’t need to stop event propagation. I think it feels a little cleaner.

Copy link
Author

@partg952 partg952 Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain a little more?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its about making 2 new LayoutCol. Left one should have contain existing document tab and the right one could have on:dblclick=()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain a little more?

I mean add a extra child to the tab bar at the end that takes all remaining space.
That child would have the dblclick listener.

Take a look at how I did it in a similar case

<LayoutRow on:mousedown={() => editor.handle.appWindowDrag()} on:dblclick={() => editor.handle.appWindowMaximize()} />

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh okay lemme do it like that

<LayoutRow class="tab-group" scrollableX={true}>
{#each tabLabels as tabLabel, tabIndex}
<LayoutRow
Expand All @@ -118,6 +118,7 @@
closeAction?.(tabIndex);
}
}}
on:dblclick={(e) => e.stopPropagation()}
on:mouseup={(e) => {
// Middle mouse button click fallback for Safari:
// https://developer.mozilla.org/en-US/docs/Web/API/Element/auxclick_event#browser_compatibility
Expand Down
Loading