detached de05f76

Broadcast workspace focus changes to webviews

commit
de05f76f1d6c671e7e428761d55baec2e5d1d56f
author
bamen · · 2025-10-12 19:35 UTC
committer
bamen · · 2025-10-12 19:24 UTC
parent
4ca17b2
signature
unsigned
1 file · +15 -0
M internal/app/browser/focus_state_machine.go +15 -0
@@ -619,6 +619,11 @@ func (fsm *FocusStateMachine) applyInitialFocus(node *paneNode) error {
619619 fsm.wm.app.activePane = node.pane
620620 }
621621
622+ // Notify JS runtime about focus state
623+ if fsm.wm != nil {
624+ fsm.wm.DispatchPaneFocusEvent(node, true)
625+ }
626+
622627 return nil
623628 }
624629
@@ -787,6 +792,16 @@ func (fsm *FocusStateMachine) executeFocusChange(request FocusRequest) error {
787792 fsm.wm.app.activePane = newPane.pane
788793 }
789794
795+ // Notify JS runtimes about focus change
796+ if fsm.wm != nil {
797+ if oldPane != nil {
798+ fsm.wm.DispatchPaneFocusEvent(oldPane, false)
799+ }
800+ if newPane != nil {
801+ fsm.wm.DispatchPaneFocusEvent(newPane, true)
802+ }
803+ }
804+
790805 // Start settling timer
791806 fsm.startSettlingTimer()
792807
@@ -619,6 +619,11 @@ func (fsm *FocusStateMachine) applyInitialFocus(node *paneNode) error {
619 fsm.wm.app.activePane = node.pane619 fsm.wm.app.activePane = node.pane
620 }620 }
621 621
622+ // Notify JS runtime about focus state
623+ if fsm.wm != nil {
624+ fsm.wm.DispatchPaneFocusEvent(node, true)
625+ }
626+
622 return nil627 return nil
623 }628 }
624 629
@@ -787,6 +792,16 @@ func (fsm *FocusStateMachine) executeFocusChange(request FocusRequest) error {
787 fsm.wm.app.activePane = newPane.pane792 fsm.wm.app.activePane = newPane.pane
788 }793 }
789 794
795+ // Notify JS runtimes about focus change
796+ if fsm.wm != nil {
797+ if oldPane != nil {
798+ fsm.wm.DispatchPaneFocusEvent(oldPane, false)
799+ }
800+ if newPane != nil {
801+ fsm.wm.DispatchPaneFocusEvent(newPane, true)
802+ }
803+ }
804+
790 // Start settling timer805 // Start settling timer
791 fsm.startSettlingTimer()806 fsm.startSettlingTimer()
792 807

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