feat(pane): add stack-pane shortcut binding (s key), stub handler until incremental ops implemented
- commit
- 385e5a201b26edd140f0b55e0d0f9814a851639a
- author
- brice · · 2025-12-16 05:09 UTC
- parent
- e926382
- signature
- unsigned
2 files · +17 -0
M internal/infrastructure/config/defaults.go +1 -0
| @@ -167,6 +167,7 @@ func DefaultConfig() *Config { | |||
| 167 | 167 | "split-left": {"arrowleft", "l"}, | |
| 168 | 168 | "split-up": {"arrowup", "u"}, | |
| 169 | 169 | "split-down": {"arrowdown", "d"}, | |
| 170 | + | "stack-pane": {"s"}, | |
| 170 | 171 | "close-pane": {"x"}, | |
| 171 | 172 | "confirm": {"enter"}, | |
| 172 | 173 | "cancel": {"escape"}, | |
| @@ -167,6 +167,7 @@ func DefaultConfig() *Config { | |||||
| 167 | "split-left": {"arrowleft", "l"}, | 167 | "split-left": {"arrowleft", "l"}, | ||
| 168 | "split-up": {"arrowup", "u"}, | 168 | "split-up": {"arrowup", "u"}, | ||
| 169 | "split-down": {"arrowdown", "d"}, | 169 | "split-down": {"arrowdown", "d"}, | ||
| 170 | + | "stack-pane": {"s"}, | |||
| 170 | "close-pane": {"x"}, | 171 | "close-pane": {"x"}, | ||
| 171 | "confirm": {"enter"}, | 172 | "confirm": {"enter"}, | ||
| 172 | "cancel": {"escape"}, | 173 | "cancel": {"escape"}, | ||
M internal/ui/app.go +16 -0
| @@ -300,6 +300,8 @@ func (a *App) handleKeyboardAction(ctx context.Context, action input.Action) err | |||
| 300 | 300 | return a.handlePaneSplit(ctx, usecase.SplitDown) | |
| 301 | 301 | case input.ActionClosePane: | |
| 302 | 302 | return a.handleClosePane(ctx) | |
| 303 | + | case input.ActionStackPane: | |
| 304 | + | return a.handleStackPane(ctx) | |
| 303 | 305 | case input.ActionFocusRight: | |
| 304 | 306 | return a.handlePaneFocus(ctx, usecase.NavRight) | |
| 305 | 307 | case input.ActionFocusLeft: | |
| @@ -668,6 +670,20 @@ func (a *App) handlePaneFocus(ctx context.Context, direction usecase.NavigateDir | |||
| 668 | 670 | return nil | |
| 669 | 671 | } | |
| 670 | 672 | ||
| 673 | + | // handleStackPane converts the active pane into a stacked container. | |
| 674 | + | // TODO: Implement incremental widget operations for stacked panes (like old repo). | |
| 675 | + | // Currently, stacked panes require incremental GTK widget manipulation rather than | |
| 676 | + | // full tree rebuilds because WebViews maintain state and parent references. | |
| 677 | + | func (a *App) handleStackPane(ctx context.Context) error { | |
| 678 | + | log := logging.FromContext(ctx) | |
| 679 | + | ||
| 680 | + | // Stacked panes are not yet fully supported in the new architecture. | |
| 681 | + | // The rebuild approach conflicts with WebView's stateful widget lifecycle. | |
| 682 | + | // See dumber-refs/internal/app/browser/stacked_panes.go for incremental approach. | |
| 683 | + | log.Warn().Msg("stacked panes not yet implemented in clean architecture - requires incremental widget operations") | |
| 684 | + | return nil | |
| 685 | + | } | |
| 686 | + | ||
| 671 | 687 | // attachWorkspaceWebViews ensures each pane has a WebView widget attached. | |
| 672 | 688 | func (a *App) attachWorkspaceWebViews(ctx context.Context, ws *entity.Workspace, wsView *component.WorkspaceView) { | |
| 673 | 689 | log := logging.FromContext(ctx) | |
| @@ -300,6 +300,8 @@ func (a *App) handleKeyboardAction(ctx context.Context, action input.Action) err | |||||
| 300 | return a.handlePaneSplit(ctx, usecase.SplitDown) | 300 | return a.handlePaneSplit(ctx, usecase.SplitDown) | ||
| 301 | case input.ActionClosePane: | 301 | case input.ActionClosePane: | ||
| 302 | return a.handleClosePane(ctx) | 302 | return a.handleClosePane(ctx) | ||
| 303 | + | case input.ActionStackPane: | |||
| 304 | + | return a.handleStackPane(ctx) | |||
| 303 | case input.ActionFocusRight: | 305 | case input.ActionFocusRight: | ||
| 304 | return a.handlePaneFocus(ctx, usecase.NavRight) | 306 | return a.handlePaneFocus(ctx, usecase.NavRight) | ||
| 305 | case input.ActionFocusLeft: | 307 | case input.ActionFocusLeft: | ||
| @@ -668,6 +670,20 @@ func (a *App) handlePaneFocus(ctx context.Context, direction usecase.NavigateDir | |||||
| 668 | return nil | 670 | return nil | ||
| 669 | } | 671 | } | ||
| 670 | 672 | ||||
| 673 | + | // handleStackPane converts the active pane into a stacked container. | |||
| 674 | + | // TODO: Implement incremental widget operations for stacked panes (like old repo). | |||
| 675 | + | // Currently, stacked panes require incremental GTK widget manipulation rather than | |||
| 676 | + | // full tree rebuilds because WebViews maintain state and parent references. | |||
| 677 | + | func (a *App) handleStackPane(ctx context.Context) error { | |||
| 678 | + | log := logging.FromContext(ctx) | |||
| 679 | + | ||||
| 680 | + | // Stacked panes are not yet fully supported in the new architecture. | |||
| 681 | + | // The rebuild approach conflicts with WebView's stateful widget lifecycle. | |||
| 682 | + | // See dumber-refs/internal/app/browser/stacked_panes.go for incremental approach. | |||
| 683 | + | log.Warn().Msg("stacked panes not yet implemented in clean architecture - requires incremental widget operations") | |||
| 684 | + | return nil | |||
| 685 | + | } | |||
| 686 | + | ||||
| 671 | // attachWorkspaceWebViews ensures each pane has a WebView widget attached. | 687 | // attachWorkspaceWebViews ensures each pane has a WebView widget attached. | ||
| 672 | func (a *App) attachWorkspaceWebViews(ctx context.Context, ws *entity.Workspace, wsView *component.WorkspaceView) { | 688 | func (a *App) attachWorkspaceWebViews(ctx context.Context, ws *entity.Workspace, wsView *component.WorkspaceView) { | ||
| 673 | log := logging.FromContext(ctx) | 689 | log := logging.FromContext(ctx) | ||