fix(ui): suppress omnibox for external panes
- commit
- 9484230b81a905c9f3302d2b52d439c1f0d90d3b
- author
- brice · · 2026-08-13 08:08 UTC
- parent
- 646bc9f
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +31 -8
M internal/ui/browser_window.go +2 -2
| @@ -641,13 +641,13 @@ func (a *App) openExternalURLInFocusedWindow(ctx context.Context, url string, cf | |||
| 641 | 641 | } | |
| 642 | 642 | case entity.ExternalLinkBehaviorSplit: | |
| 643 | 643 | if err := a.placeExternalURLInPane(ctx, activeTab.Workspace, url, func(ctx context.Context) error { | |
| 644 | - | return a.wsCoord.SplitWithURL(ctx, externalLinkSplitDirection(cfg.Placement), url) | |
| 644 | + | return a.wsCoord.SplitWithURLWithoutOmnibox(ctx, externalLinkSplitDirection(cfg.Placement), url) | |
| 645 | 645 | }); err != nil { | |
| 646 | 646 | return err | |
| 647 | 647 | } | |
| 648 | 648 | case entity.ExternalLinkBehaviorStacked: | |
| 649 | 649 | if err := a.placeExternalURLInPane(ctx, activeTab.Workspace, url, func(ctx context.Context) error { | |
| 650 | - | return a.wsCoord.StackPaneWithURL(ctx, url) | |
| 650 | + | return a.wsCoord.StackPaneWithURLWithoutOmnibox(ctx, url) | |
| 651 | 651 | }); err != nil { | |
| 652 | 652 | return err | |
| 653 | 653 | } | |
| @@ -641,13 +641,13 @@ func (a *App) openExternalURLInFocusedWindow(ctx context.Context, url string, cf | |||||
| 641 | } | 641 | } | ||
| 642 | case entity.ExternalLinkBehaviorSplit: | 642 | case entity.ExternalLinkBehaviorSplit: | ||
| 643 | if err := a.placeExternalURLInPane(ctx, activeTab.Workspace, url, func(ctx context.Context) error { | 643 | if err := a.placeExternalURLInPane(ctx, activeTab.Workspace, url, func(ctx context.Context) error { | ||
| 644 | - | return a.wsCoord.SplitWithURL(ctx, externalLinkSplitDirection(cfg.Placement), url) | 644 | + | return a.wsCoord.SplitWithURLWithoutOmnibox(ctx, externalLinkSplitDirection(cfg.Placement), url) |
| 645 | }); err != nil { | 645 | }); err != nil { | ||
| 646 | return err | 646 | return err | ||
| 647 | } | 647 | } | ||
| 648 | case entity.ExternalLinkBehaviorStacked: | 648 | case entity.ExternalLinkBehaviorStacked: | ||
| 649 | if err := a.placeExternalURLInPane(ctx, activeTab.Workspace, url, func(ctx context.Context) error { | 649 | if err := a.placeExternalURLInPane(ctx, activeTab.Workspace, url, func(ctx context.Context) error { | ||
| 650 | - | return a.wsCoord.StackPaneWithURL(ctx, url) | 650 | + | return a.wsCoord.StackPaneWithURLWithoutOmnibox(ctx, url) |
| 651 | }); err != nil { | 651 | }); err != nil { | ||
| 652 | return err | 652 | return err | ||
| 653 | } | 653 | } | ||
M internal/ui/coordinator/workspace.go +29 -6
| @@ -163,15 +163,25 @@ func setupPaneViewHover(ctx context.Context, pv *component.PaneView, wsView *com | |||
| 163 | 163 | ||
| 164 | 164 | // Split splits the active pane in the given direction. | |
| 165 | 165 | func (c *WorkspaceCoordinator) Split(ctx context.Context, direction usecase.SplitDirection) error { | |
| 166 | - | return c.splitWithInitialURL(ctx, direction, c.newPaneURL) | |
| 166 | + | return c.splitWithInitialURL(ctx, direction, c.newPaneURL, true) | |
| 167 | 167 | } | |
| 168 | 168 | ||
| 169 | 169 | // SplitWithURL splits the active pane in the given direction and loads initialURL. | |
| 170 | 170 | func (c *WorkspaceCoordinator) SplitWithURL(ctx context.Context, direction usecase.SplitDirection, initialURL string) error { | |
| 171 | - | return c.splitWithInitialURL(ctx, direction, initialURL) | |
| 171 | + | return c.splitWithInitialURL(ctx, direction, initialURL, true) | |
| 172 | 172 | } | |
| 173 | 173 | ||
| 174 | - | func (c *WorkspaceCoordinator) splitWithInitialURL(ctx context.Context, direction usecase.SplitDirection, initialURL string) error { | |
| 174 | + | // SplitWithURLWithoutOmnibox splits the active pane without opening the omnibox. | |
| 175 | + | func (c *WorkspaceCoordinator) SplitWithURLWithoutOmnibox(ctx context.Context, direction usecase.SplitDirection, initialURL string) error { | |
| 176 | + | return c.splitWithInitialURL(ctx, direction, initialURL, false) | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | func (c *WorkspaceCoordinator) splitWithInitialURL( | |
| 180 | + | ctx context.Context, | |
| 181 | + | direction usecase.SplitDirection, | |
| 182 | + | initialURL string, | |
| 183 | + | notifyNewPane bool, | |
| 184 | + | ) error { | |
| 175 | 185 | log := logging.FromContext(ctx) | |
| 176 | 186 | ||
| 177 | 187 | splitCtx, err := c.prepareSplit(ctx, direction) | |
| @@ -204,7 +214,9 @@ func (c *WorkspaceCoordinator) splitWithInitialURL(ctx context.Context, directio | |||
| 204 | 214 | ); err != nil { | |
| 205 | 215 | return err | |
| 206 | 216 | } | |
| 207 | - | splitCtx.wsView.NotifyNewPaneCreated(ctx) | |
| 217 | + | if notifyNewPane { | |
| 218 | + | splitCtx.wsView.NotifyNewPaneCreated(ctx) | |
| 219 | + | } | |
| 208 | 220 | } | |
| 209 | 221 | ||
| 210 | 222 | // Notify state change for session snapshots | |
| @@ -1463,11 +1475,20 @@ func (c *WorkspaceCoordinator) syncStackedViewActive(ctx context.Context, wsView | |||
| 1463 | 1475 | // StackPane adds a new pane stacked on top of the active pane. | |
| 1464 | 1476 | // Uses CreateStack use case for new stacks, AddToStack for existing stacks. | |
| 1465 | 1477 | func (c *WorkspaceCoordinator) StackPane(ctx context.Context) error { | |
| 1466 | - | return c.StackPaneWithURL(ctx, c.newPaneURL) | |
| 1478 | + | return c.stackPaneWithURL(ctx, c.newPaneURL, true) | |
| 1467 | 1479 | } | |
| 1468 | 1480 | ||
| 1469 | 1481 | // StackPaneWithURL adds a new pane containing initialURL to the active stack. | |
| 1470 | 1482 | func (c *WorkspaceCoordinator) StackPaneWithURL(ctx context.Context, initialURL string) error { | |
| 1483 | + | return c.stackPaneWithURL(ctx, initialURL, true) | |
| 1484 | + | } | |
| 1485 | + | ||
| 1486 | + | // StackPaneWithURLWithoutOmnibox adds a stacked pane without opening the omnibox. | |
| 1487 | + | func (c *WorkspaceCoordinator) StackPaneWithURLWithoutOmnibox(ctx context.Context, initialURL string) error { | |
| 1488 | + | return c.stackPaneWithURL(ctx, initialURL, false) | |
| 1489 | + | } | |
| 1490 | + | ||
| 1491 | + | func (c *WorkspaceCoordinator) stackPaneWithURL(ctx context.Context, initialURL string, notifyNewPane bool) error { | |
| 1471 | 1492 | log := logging.FromContext(ctx) | |
| 1472 | 1493 | ||
| 1473 | 1494 | stackCtx, err := c.prepareStackPane(ctx) | |
| @@ -1529,7 +1550,9 @@ func (c *WorkspaceCoordinator) StackPaneWithURL(ctx context.Context, initialURL | |||
| 1529 | 1550 | } | |
| 1530 | 1551 | stackCtx.wsView.FocusPane(newPaneID) | |
| 1531 | 1552 | ||
| 1532 | - | stackCtx.wsView.NotifyNewPaneCreated(ctx) | |
| 1553 | + | if notifyNewPane { | |
| 1554 | + | stackCtx.wsView.NotifyNewPaneCreated(ctx) | |
| 1555 | + | } | |
| 1533 | 1556 | ||
| 1534 | 1557 | // Set up title bar click and close callbacks | |
| 1535 | 1558 | tr := stackCtx.wsView.TreeRenderer() | |
| @@ -163,15 +163,25 @@ func setupPaneViewHover(ctx context.Context, pv *component.PaneView, wsView *com | |||||
| 163 | 163 | ||||
| 164 | // Split splits the active pane in the given direction. | 164 | // Split splits the active pane in the given direction. | ||
| 165 | func (c *WorkspaceCoordinator) Split(ctx context.Context, direction usecase.SplitDirection) error { | 165 | func (c *WorkspaceCoordinator) Split(ctx context.Context, direction usecase.SplitDirection) error { | ||
| 166 | - | return c.splitWithInitialURL(ctx, direction, c.newPaneURL) | 166 | + | return c.splitWithInitialURL(ctx, direction, c.newPaneURL, true) |
| 167 | } | 167 | } | ||
| 168 | 168 | ||||
| 169 | // SplitWithURL splits the active pane in the given direction and loads initialURL. | 169 | // SplitWithURL splits the active pane in the given direction and loads initialURL. | ||
| 170 | func (c *WorkspaceCoordinator) SplitWithURL(ctx context.Context, direction usecase.SplitDirection, initialURL string) error { | 170 | func (c *WorkspaceCoordinator) SplitWithURL(ctx context.Context, direction usecase.SplitDirection, initialURL string) error { | ||
| 171 | - | return c.splitWithInitialURL(ctx, direction, initialURL) | 171 | + | return c.splitWithInitialURL(ctx, direction, initialURL, true) |
| 172 | } | 172 | } | ||
| 173 | 173 | ||||
| 174 | - | func (c *WorkspaceCoordinator) splitWithInitialURL(ctx context.Context, direction usecase.SplitDirection, initialURL string) error { | 174 | + | // SplitWithURLWithoutOmnibox splits the active pane without opening the omnibox. |
| 175 | + | func (c *WorkspaceCoordinator) SplitWithURLWithoutOmnibox(ctx context.Context, direction usecase.SplitDirection, initialURL string) error { | |||
| 176 | + | return c.splitWithInitialURL(ctx, direction, initialURL, false) | |||
| 177 | + | } | |||
| 178 | + | ||||
| 179 | + | func (c *WorkspaceCoordinator) splitWithInitialURL( | |||
| 180 | + | ctx context.Context, | |||
| 181 | + | direction usecase.SplitDirection, | |||
| 182 | + | initialURL string, | |||
| 183 | + | notifyNewPane bool, | |||
| 184 | + | ) error { | |||
| 175 | log := logging.FromContext(ctx) | 185 | log := logging.FromContext(ctx) | ||
| 176 | 186 | ||||
| 177 | splitCtx, err := c.prepareSplit(ctx, direction) | 187 | splitCtx, err := c.prepareSplit(ctx, direction) | ||
| @@ -204,7 +214,9 @@ func (c *WorkspaceCoordinator) splitWithInitialURL(ctx context.Context, directio | |||||
| 204 | ); err != nil { | 214 | ); err != nil { | ||
| 205 | return err | 215 | return err | ||
| 206 | } | 216 | } | ||
| 207 | - | splitCtx.wsView.NotifyNewPaneCreated(ctx) | 217 | + | if notifyNewPane { |
| 218 | + | splitCtx.wsView.NotifyNewPaneCreated(ctx) | |||
| 219 | + | } | |||
| 208 | } | 220 | } | ||
| 209 | 221 | ||||
| 210 | // Notify state change for session snapshots | 222 | // Notify state change for session snapshots | ||
| @@ -1463,11 +1475,20 @@ func (c *WorkspaceCoordinator) syncStackedViewActive(ctx context.Context, wsView | |||||
| 1463 | // StackPane adds a new pane stacked on top of the active pane. | 1475 | // StackPane adds a new pane stacked on top of the active pane. | ||
| 1464 | // Uses CreateStack use case for new stacks, AddToStack for existing stacks. | 1476 | // Uses CreateStack use case for new stacks, AddToStack for existing stacks. | ||
| 1465 | func (c *WorkspaceCoordinator) StackPane(ctx context.Context) error { | 1477 | func (c *WorkspaceCoordinator) StackPane(ctx context.Context) error { | ||
| 1466 | - | return c.StackPaneWithURL(ctx, c.newPaneURL) | 1478 | + | return c.stackPaneWithURL(ctx, c.newPaneURL, true) |
| 1467 | } | 1479 | } | ||
| 1468 | 1480 | ||||
| 1469 | // StackPaneWithURL adds a new pane containing initialURL to the active stack. | 1481 | // StackPaneWithURL adds a new pane containing initialURL to the active stack. | ||
| 1470 | func (c *WorkspaceCoordinator) StackPaneWithURL(ctx context.Context, initialURL string) error { | 1482 | func (c *WorkspaceCoordinator) StackPaneWithURL(ctx context.Context, initialURL string) error { | ||
| 1483 | + | return c.stackPaneWithURL(ctx, initialURL, true) | |||
| 1484 | + | } | |||
| 1485 | + | ||||
| 1486 | + | // StackPaneWithURLWithoutOmnibox adds a stacked pane without opening the omnibox. | |||
| 1487 | + | func (c *WorkspaceCoordinator) StackPaneWithURLWithoutOmnibox(ctx context.Context, initialURL string) error { | |||
| 1488 | + | return c.stackPaneWithURL(ctx, initialURL, false) | |||
| 1489 | + | } | |||
| 1490 | + | ||||
| 1491 | + | func (c *WorkspaceCoordinator) stackPaneWithURL(ctx context.Context, initialURL string, notifyNewPane bool) error { | |||
| 1471 | log := logging.FromContext(ctx) | 1492 | log := logging.FromContext(ctx) | ||
| 1472 | 1493 | ||||
| 1473 | stackCtx, err := c.prepareStackPane(ctx) | 1494 | stackCtx, err := c.prepareStackPane(ctx) | ||
| @@ -1529,7 +1550,9 @@ func (c *WorkspaceCoordinator) StackPaneWithURL(ctx context.Context, initialURL | |||||
| 1529 | } | 1550 | } | ||
| 1530 | stackCtx.wsView.FocusPane(newPaneID) | 1551 | stackCtx.wsView.FocusPane(newPaneID) | ||
| 1531 | 1552 | ||||
| 1532 | - | stackCtx.wsView.NotifyNewPaneCreated(ctx) | 1553 | + | if notifyNewPane { |
| 1554 | + | stackCtx.wsView.NotifyNewPaneCreated(ctx) | |||
| 1555 | + | } | |||
| 1533 | 1556 | ||||
| 1534 | // Set up title bar click and close callbacks | 1557 | // Set up title bar click and close callbacks | ||
| 1535 | tr := stackCtx.wsView.TreeRenderer() | 1558 | tr := stackCtx.wsView.TreeRenderer() | ||