detached cccb5fe

fix: preserve popup tab names before tab bar insertion

- keep caller-supplied tab names from CreateWithPane
- run onTabCreated before adding popup tabs to the tab bar
commit
cccb5fe798638a598d4f08ea5f23e68a1ee1805c
author
brice · · 2026-04-28 18:26 UTC
parent
5509537
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +14 -9
M internal/ui/app.go +7 -4
@@ -2126,11 +2126,14 @@ func (a *App) initTabCoordinator(ctx context.Context) {
21262126 }
21272127 // Set a window-scoped default title so "Tab N" doesn't use global position.
21282128 // Count only live tabs owned by this window via the helper.
2129- count := a.tabCountForBrowserWindow(bw)
2130- if count <= 0 {
2131- count = 1
2129+ // Only assign a default name if the creator did not supply one.
2130+ if strings.TrimSpace(tab.Name) == "" {
2131+ count := a.tabCountForBrowserWindow(bw)
2132+ if count <= 0 {
2133+ count = 1
2134+ }
2135+ tab.Name = defaultTabName(count)
21322136 }
2133- tab.Name = defaultTabName(count)
21342137 a.createWorkspaceView(ctx, tab)
21352138 })
21362139 a.tabCoord.SetOnTabSwitched(func(ctx context.Context, tab *entity.Tab) {
@@ -2126,11 +2126,14 @@ func (a *App) initTabCoordinator(ctx context.Context) {
2126 }2126 }
2127 // Set a window-scoped default title so "Tab N" doesn't use global position.2127 // Set a window-scoped default title so "Tab N" doesn't use global position.
2128 // Count only live tabs owned by this window via the helper.2128 // Count only live tabs owned by this window via the helper.
2129- count := a.tabCountForBrowserWindow(bw)2129+ // Only assign a default name if the creator did not supply one.
2130- if count <= 0 {2130+ if strings.TrimSpace(tab.Name) == "" {
2131- count = 12131+ count := a.tabCountForBrowserWindow(bw)
2132+ if count <= 0 {
2133+ count = 1
2134+ }
2135+ tab.Name = defaultTabName(count)
2132 }2136 }
2133- tab.Name = defaultTabName(count)
2134 a.createWorkspaceView(ctx, tab)2137 a.createWorkspaceView(ctx, tab)
2135 })2138 })
2136 a.tabCoord.SetOnTabSwitched(func(ctx context.Context, tab *entity.Tab) {2139 a.tabCoord.SetOnTabSwitched(func(ctx context.Context, tab *entity.Tab) {
M internal/ui/coordinator/tab.go +7 -5
@@ -496,6 +496,13 @@ func (c *TabCoordinator) CreateWithPane(
496496 // Set new tab as active
497497 c.tabs.SetActive(output.Tab.ID)
498498
499+ // Notify app before adding tab to the visible tab bar.
500+ // The app assigns window ownership and the scoped default name here,
501+ // and TabBar.AddTab reads tab.Title() immediately when creating the button.
502+ if c.onTabCreated != nil {
503+ c.onTabCreated(ctx, output.Tab)
504+ }
505+
499506 // Update tab bar
500507 if c.mainWindow != nil && c.mainWindow.TabBar() != nil {
501508 c.mainWindow.TabBar().AddTab(output.Tab)
@@ -505,11 +512,6 @@ func (c *TabCoordinator) CreateWithPane(
505512 // Update tab bar visibility
506513 c.UpdateBarVisibility(ctx)
507514
508- // Notify app to create workspace view
509- if c.onTabCreated != nil {
510- c.onTabCreated(ctx, output.Tab)
511- }
512-
513515 // Attach the popup WebView to the new tab's workspace
514516 if c.onAttachPopupToTab != nil {
515517 c.onAttachPopupToTab(ctx, output.Tab.ID, pane, wv)
@@ -496,6 +496,13 @@ func (c *TabCoordinator) CreateWithPane(
496 // Set new tab as active496 // Set new tab as active
497 c.tabs.SetActive(output.Tab.ID)497 c.tabs.SetActive(output.Tab.ID)
498 498
499+ // Notify app before adding tab to the visible tab bar.
500+ // The app assigns window ownership and the scoped default name here,
501+ // and TabBar.AddTab reads tab.Title() immediately when creating the button.
502+ if c.onTabCreated != nil {
503+ c.onTabCreated(ctx, output.Tab)
504+ }
505+
499 // Update tab bar506 // Update tab bar
500 if c.mainWindow != nil && c.mainWindow.TabBar() != nil {507 if c.mainWindow != nil && c.mainWindow.TabBar() != nil {
501 c.mainWindow.TabBar().AddTab(output.Tab)508 c.mainWindow.TabBar().AddTab(output.Tab)
@@ -505,11 +512,6 @@ func (c *TabCoordinator) CreateWithPane(
505 // Update tab bar visibility512 // Update tab bar visibility
506 c.UpdateBarVisibility(ctx)513 c.UpdateBarVisibility(ctx)
507 514
508- // Notify app to create workspace view
509- if c.onTabCreated != nil {
510- c.onTabCreated(ctx, output.Tab)
511- }
512-
513 // Attach the popup WebView to the new tab's workspace515 // Attach the popup WebView to the new tab's workspace
514 if c.onAttachPopupToTab != nil {516 if c.onAttachPopupToTab != nil {
515 c.onAttachPopupToTab(ctx, output.Tab.ID, pane, wv)517 c.onAttachPopupToTab(ctx, output.Tab.ID, pane, wv)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close