detached e182a2c

feat(workspace): add cleanup generation tracking and debug infrastructure to core types

commit
e182a2ceeeea8d7b178409aad7481f47b48fdd9a
author
Brice · · 2025-09-30 05:15 UTC
parent
197375c
signature
unsigned
2 files · +19 -0
M internal/app/browser/workspace_manager.go +15 -0
@@ -65,6 +65,13 @@ type WorkspaceManager struct {
6565 geometryValidator *GeometryValidator
6666 stackLifecycleManager *StackLifecycleManager
6767 stateTombstoneManager *StateTombstoneManager
68+
69+ // Debug instrumentation helpers
70+ debugPaneClose bool
71+ diagnostics *WorkspaceDiagnostics
72+
73+ // Enhanced pane close refactoring fields
74+ cleanupCounter uint
6875 }
6976
7077 // Workspace navigation shortcuts are now handled globally by WindowShortcutHandler
@@ -148,13 +155,21 @@ func NewWorkspaceManager(app *BrowserApp, rootPane *BrowserPane) *WorkspaceManag
148155 false, // CSS debug removed
149156 app.config.Debug.EnableFocusMetrics,
150157 )
158+
159+ manager.debugPaneClose = app.config.Debug.EnablePaneCloseDebug
151160 }
152161
162+ manager.diagnostics = NewWorkspaceDiagnostics(manager.debugPaneClose)
163+
153164 // Initialize focus state machine after all setup is complete
154165 if err := manager.focusStateMachine.Initialize(); err != nil {
155166 log.Printf("[workspace] Failed to initialize focus state machine: %v", err)
156167 }
157168
169+ if manager.debugPaneClose {
170+ manager.dumpTreeState("workspace_init")
171+ }
172+
158173 return manager
159174 }
160175
@@ -65,6 +65,13 @@ type WorkspaceManager struct {
65 geometryValidator *GeometryValidator65 geometryValidator *GeometryValidator
66 stackLifecycleManager *StackLifecycleManager66 stackLifecycleManager *StackLifecycleManager
67 stateTombstoneManager *StateTombstoneManager67 stateTombstoneManager *StateTombstoneManager
68+
69+ // Debug instrumentation helpers
70+ debugPaneClose bool
71+ diagnostics *WorkspaceDiagnostics
72+
73+ // Enhanced pane close refactoring fields
74+ cleanupCounter uint
68 }75 }
69 76
70 // Workspace navigation shortcuts are now handled globally by WindowShortcutHandler77 // Workspace navigation shortcuts are now handled globally by WindowShortcutHandler
@@ -148,13 +155,21 @@ func NewWorkspaceManager(app *BrowserApp, rootPane *BrowserPane) *WorkspaceManag
148 false, // CSS debug removed155 false, // CSS debug removed
149 app.config.Debug.EnableFocusMetrics,156 app.config.Debug.EnableFocusMetrics,
150 )157 )
158+
159+ manager.debugPaneClose = app.config.Debug.EnablePaneCloseDebug
151 }160 }
152 161
162+ manager.diagnostics = NewWorkspaceDiagnostics(manager.debugPaneClose)
163+
153 // Initialize focus state machine after all setup is complete164 // Initialize focus state machine after all setup is complete
154 if err := manager.focusStateMachine.Initialize(); err != nil {165 if err := manager.focusStateMachine.Initialize(); err != nil {
155 log.Printf("[workspace] Failed to initialize focus state machine: %v", err)166 log.Printf("[workspace] Failed to initialize focus state machine: %v", err)
156 }167 }
157 168
169+ if manager.debugPaneClose {
170+ manager.dumpTreeState("workspace_init")
171+ }
172+
158 return manager173 return manager
159 }174 }
160 175
M internal/app/browser/workspace_types.go +4 -0
@@ -37,6 +37,10 @@ type paneNode struct {
3737 activeStackIndex int // Index of currently visible pane in stack
3838 titleBar *SafeWidget // GtkBox for title bar (when collapsed)
3939 stackWrapper *SafeWidget // Internal GtkBox containing the actual stacked widgets (titles + webviews)
40+
41+ // Enhanced pane close refactoring fields
42+ widgetValid bool // Guard flagged before GTK destruction
43+ cleanupGeneration uint // Helps assert that asynchronous callbacks skip stale nodes
4044 }
4145
4246 // Workspace CSS class constants
@@ -37,6 +37,10 @@ type paneNode struct {
37 activeStackIndex int // Index of currently visible pane in stack37 activeStackIndex int // Index of currently visible pane in stack
38 titleBar *SafeWidget // GtkBox for title bar (when collapsed)38 titleBar *SafeWidget // GtkBox for title bar (when collapsed)
39 stackWrapper *SafeWidget // Internal GtkBox containing the actual stacked widgets (titles + webviews)39 stackWrapper *SafeWidget // Internal GtkBox containing the actual stacked widgets (titles + webviews)
40+
41+ // Enhanced pane close refactoring fields
42+ widgetValid bool // Guard flagged before GTK destruction
43+ cleanupGeneration uint // Helps assert that asynchronous callbacks skip stale nodes
40 }44 }
41 45
42 // Workspace CSS class constants46 // Workspace CSS class constants

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