v0.14.1 0da30ba

workspace_tree_rebalancer.go RawHistoryFolder

1// workspace_tree_rebalancer.go - Simplified no-op tree rebalancer placeholder.
2//
3// The original TreeRebalancer relied on SafeWidget abstractions. Until a
4// pointer-based implementation is restored, we keep a lightweight stub so the
5// rest of the workspace code can continue to depend on the API without
6// carrying dead logic.
7package browser
8
9// TreeRebalancer is currently a no-op shim kept for API compatibility.
10type TreeRebalancer struct {
11	enabled bool
12}
13
14// RebalanceOperation describes an attempted rebalance step (unused in shim).
15type RebalanceOperation struct {
16	Type        RebalanceType
17	Node        *paneNode
18	Description string
19}
20
21// RebalanceType enumerates rebalancer operations (kept for completeness).
22type RebalanceType int
23
24const (
25	RebalanceRotateLeft RebalanceType = iota
26	RebalanceRotateRight
27	RebalancePromote
28	RebalanceRestructure
29)
30
31// TreeMetrics represents the structural metrics of the workspace tree.
32type TreeMetrics struct{}
33
34// NewTreeRebalancer returns a disabled stub implementation.
35// NOTE: Tree rebalancing logic has been temporarily disabled in favor of manual geometry management.
36// Future work may restore automatic rebalancing or replace it with an alternative approach.
37func NewTreeRebalancer(_ *WorkspaceManager, _ *TreeValidator) *TreeRebalancer {
38	return &TreeRebalancer{}
39}
40
41// SetMaxImbalance is preserved for API compatibility.
42func (tr *TreeRebalancer) SetMaxImbalance(_ int) {}
43
44// Enable toggles the stub on (no functional impact).
45func (tr *TreeRebalancer) Enable() { tr.enabled = true }
46
47// Disable toggles the stub off.
48func (tr *TreeRebalancer) Disable() { tr.enabled = false }
49
50// RebalanceAfterClose is a no-op in the stub implementation.
51func (tr *TreeRebalancer) RebalanceAfterClose(_ *paneNode, _ *paneNode) error {
52	return nil
53}
54
55// CalculateTreeMetrics returns empty metrics in the stub.
56func (tr *TreeRebalancer) CalculateTreeMetrics(_ *paneNode) TreeMetrics {
57	return TreeMetrics{}
58}
59
60// GetRebalancingStats exposes minimal instrumentation for diagnostics.
61func (tr *TreeRebalancer) GetRebalancingStats() map[string]interface{} {
62	return map[string]interface{}{
63		"enabled": tr != nil && tr.enabled,
64	}
65}

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