v0.28.0 3cb3770

config_types.go RawHistoryFolder

1package entity
2
3// Config value types shared between infrastructure/config and the UI layer.
4// Keeping these in domain/entity allows UI packages to use them without
5// importing infrastructure/config.
6
7// AppearanceConfig holds visual appearance settings.
8type AppearanceConfig struct {
9	SansFont        string       `mapstructure:"sans_font" yaml:"sans_font" toml:"sans_font" json:"sans_font"`
10	SerifFont       string       `mapstructure:"serif_font" yaml:"serif_font" toml:"serif_font" json:"serif_font"`
11	MonospaceFont   string       `mapstructure:"monospace_font" yaml:"monospace_font" toml:"monospace_font" json:"monospace_font"`
12	DefaultFontSize int          `mapstructure:"default_font_size" yaml:"default_font_size" toml:"default_font_size" json:"default_font_size"`
13	LightPalette    ColorPalette `mapstructure:"light_palette" yaml:"light_palette" toml:"light_palette" json:"light_palette"`
14	DarkPalette     ColorPalette `mapstructure:"dark_palette" yaml:"dark_palette" toml:"dark_palette" json:"dark_palette"`
15	ColorScheme     string       `mapstructure:"color_scheme" yaml:"color_scheme" toml:"color_scheme" json:"color_scheme"`
16}
17
18// ColorPalette defines the color scheme for a theme variant (light/dark).
19type ColorPalette struct {
20	Background     string `mapstructure:"background" yaml:"background" toml:"background" json:"background"`
21	Surface        string `mapstructure:"surface" yaml:"surface" toml:"surface" json:"surface"`
22	SurfaceVariant string `mapstructure:"surface_variant" yaml:"surface_variant" toml:"surface_variant" json:"surface_variant"`
23	Text           string `mapstructure:"text" yaml:"text" toml:"text" json:"text"`
24	Muted          string `mapstructure:"muted" yaml:"muted" toml:"muted" json:"muted"`
25	Accent         string `mapstructure:"accent" yaml:"accent" toml:"accent" json:"accent"`
26	Border         string `mapstructure:"border" yaml:"border" toml:"border" json:"border"`
27}
28
29// ActionBinding maps a config action name to key bindings.
30type ActionBinding struct {
31	Keys []string `mapstructure:"keys" yaml:"keys" toml:"keys" json:"keys"`
32	Desc string   `mapstructure:"desc" yaml:"desc" toml:"desc" json:"desc,omitempty"`
33}
34
35// PaneModeConfig holds pane mode shortcut configuration.
36type PaneModeConfig struct {
37	ActivationShortcut  string                   `mapstructure:"activation_shortcut" yaml:"activation_shortcut" toml:"activation_shortcut" json:"activation_shortcut"` //nolint:lll // struct tags must stay on one line
38	TimeoutMilliseconds int                      `mapstructure:"timeout_ms" yaml:"timeout_ms" toml:"timeout_ms" json:"timeout_ms"`
39	Actions             map[string]ActionBinding `mapstructure:"actions" yaml:"actions" toml:"actions" json:"actions"`
40}
41
42// keyBindingsFromActions converts an action binding map to a key→action map.
43// This is the canonical implementation shared by all GetKeyBindings methods.
44func keyBindingsFromActions(actions map[string]ActionBinding) map[string]string {
45	keyToAction := make(map[string]string)
46	for action, binding := range actions {
47		for _, key := range binding.Keys {
48			keyToAction[key] = action
49		}
50	}
51	return keyToAction
52}
53
54// GetKeyBindings returns a map from key string to action name.
55func (p *PaneModeConfig) GetKeyBindings() map[string]string {
56	return keyBindingsFromActions(p.Actions)
57}
58
59// TabModeConfig holds tab mode shortcut configuration.
60type TabModeConfig struct {
61	ActivationShortcut  string                   `mapstructure:"activation_shortcut" yaml:"activation_shortcut" toml:"activation_shortcut" json:"activation_shortcut"` //nolint:lll // struct tags must stay on one line
62	TimeoutMilliseconds int                      `mapstructure:"timeout_ms" yaml:"timeout_ms" toml:"timeout_ms" json:"timeout_ms"`
63	Actions             map[string]ActionBinding `mapstructure:"actions" yaml:"actions" toml:"actions" json:"actions"`
64}
65
66// GetKeyBindings returns a map from key string to action name.
67func (t *TabModeConfig) GetKeyBindings() map[string]string {
68	return keyBindingsFromActions(t.Actions)
69}
70
71// ResizeModeConfig holds resize mode shortcut configuration.
72type ResizeModeConfig struct {
73	ActivationShortcut  string                   `mapstructure:"activation_shortcut" yaml:"activation_shortcut" toml:"activation_shortcut" json:"activation_shortcut"` //nolint:lll // struct tags must stay on one line
74	TimeoutMilliseconds int                      `mapstructure:"timeout_ms" yaml:"timeout_ms" toml:"timeout_ms" json:"timeout_ms"`
75	StepPercent         float64                  `mapstructure:"step_percent" yaml:"step_percent" toml:"step_percent" json:"step_percent"`
76	MinPanePercent      float64                  `mapstructure:"min_pane_percent" yaml:"min_pane_percent" toml:"min_pane_percent" json:"min_pane_percent"` //nolint:lll // struct tags must stay on one line
77	Actions             map[string]ActionBinding `mapstructure:"actions" yaml:"actions" toml:"actions" json:"actions"`
78}
79
80// GetKeyBindings returns a map from key string to action name.
81func (r *ResizeModeConfig) GetKeyBindings() map[string]string {
82	return keyBindingsFromActions(r.Actions)
83}
84
85// SessionModeConfig holds session mode shortcut configuration.
86type SessionModeConfig struct {
87	ActivationShortcut  string                   `mapstructure:"activation_shortcut" yaml:"activation_shortcut" toml:"activation_shortcut" json:"activation_shortcut"` //nolint:lll // struct tags must stay on one line
88	TimeoutMilliseconds int                      `mapstructure:"timeout_ms" yaml:"timeout_ms" toml:"timeout_ms" json:"timeout_ms"`
89	Actions             map[string]ActionBinding `mapstructure:"actions" yaml:"actions" toml:"actions" json:"actions"`
90}
91
92// GetKeyBindings returns a map from key string to action name.
93func (s *SessionModeConfig) GetKeyBindings() map[string]string {
94	return keyBindingsFromActions(s.Actions)
95}
96
97// SessionConfig holds session persistence and restoration settings.
98type SessionConfig struct {
99	AutoRestore bool `mapstructure:"auto_restore" yaml:"auto_restore" toml:"auto_restore" json:"auto_restore"`
100
101	SnapshotIntervalMs int `mapstructure:"snapshot_interval_ms" yaml:"snapshot_interval_ms" toml:"snapshot_interval_ms" json:"snapshot_interval_ms"` //nolint:lll // struct tags must stay on one line
102
103	MaxExitedSessions int `mapstructure:"max_exited_sessions" yaml:"max_exited_sessions" toml:"max_exited_sessions" json:"max_exited_sessions"` //nolint:lll // struct tags must stay on one line
104
105	MaxExitedSessionAgeDays int `mapstructure:"max_exited_session_age_days" yaml:"max_exited_session_age_days" toml:"max_exited_session_age_days" json:"max_exited_session_age_days"` //nolint:lll // struct tags must stay on one line
106
107	SessionMode SessionModeConfig `mapstructure:"session_mode" yaml:"session_mode" toml:"session_mode" json:"session_mode"`
108}
109
110// GlobalShortcutsConfig holds workspace-level global shortcut bindings.
111type GlobalShortcutsConfig struct {
112	Actions map[string]ActionBinding `mapstructure:"actions" yaml:"actions" toml:"actions" json:"actions"`
113}
114
115// GetKeyBindings returns a map from key string to action name.
116func (g *GlobalShortcutsConfig) GetKeyBindings() map[string]string {
117	return keyBindingsFromActions(g.Actions)
118}
119
120// FloatingPaneProfile defines a named floating pane preset.
121type FloatingPaneProfile struct {
122	Keys []string `mapstructure:"keys" yaml:"keys" toml:"keys" json:"keys"`
123	URL  string   `mapstructure:"url" yaml:"url" toml:"url" json:"url"`
124	Desc string   `mapstructure:"desc" yaml:"desc" toml:"desc" json:"desc,omitempty"`
125}
126
127// FloatingPaneConfig holds floating pane layout and profile settings.
128type FloatingPaneConfig struct {
129	WidthPct  float64                        `mapstructure:"width_pct" yaml:"width_pct" toml:"width_pct" json:"width_pct"`
130	HeightPct float64                        `mapstructure:"height_pct" yaml:"height_pct" toml:"height_pct" json:"height_pct"`
131	Profiles  map[string]FloatingPaneProfile `mapstructure:"profiles" yaml:"profiles" toml:"profiles" json:"profiles"`
132}
133
134// WorkspaceStylingConfig defines visual styling for workspace elements.
135type WorkspaceStylingConfig struct {
136	BorderWidth     int    `mapstructure:"border_width" yaml:"border_width" toml:"border_width" json:"border_width"`
137	BorderColor     string `mapstructure:"border_color" yaml:"border_color" toml:"border_color" json:"border_color"`
138	ModeBorderWidth int    `mapstructure:"mode_border_width" yaml:"mode_border_width" toml:"mode_border_width" json:"mode_border_width"` //nolint:lll // struct tags must stay on one line
139
140	PaneModeColor    string `mapstructure:"pane_mode_color" yaml:"pane_mode_color" toml:"pane_mode_color" json:"pane_mode_color"`             //nolint:lll // struct tags must stay on one line
141	TabModeColor     string `mapstructure:"tab_mode_color" yaml:"tab_mode_color" toml:"tab_mode_color" json:"tab_mode_color"`                 //nolint:lll // struct tags must stay on one line
142	SessionModeColor string `mapstructure:"session_mode_color" yaml:"session_mode_color" toml:"session_mode_color" json:"session_mode_color"` //nolint:lll // struct tags must stay on one line
143	ResizeModeColor  string `mapstructure:"resize_mode_color" yaml:"resize_mode_color" toml:"resize_mode_color" json:"resize_mode_color"`     //nolint:lll // struct tags must stay on one line
144
145	ModeIndicatorToasterEnabled bool `mapstructure:"mode_indicator_toaster_enabled" yaml:"mode_indicator_toaster_enabled" toml:"mode_indicator_toaster_enabled" json:"mode_indicator_toaster_enabled"` //nolint:lll // struct tags must stay on one line
146
147	TransitionDuration int `mapstructure:"transition_duration" yaml:"transition_duration" toml:"transition_duration" json:"transition_duration"` //nolint:lll // struct tags must stay on one line
148}
149
150// PopupBehavior defines how a popup is placed in the workspace.
151type PopupBehavior string
152
153const (
154	PopupBehaviorSplit    PopupBehavior = "split"
155	PopupBehaviorStacked  PopupBehavior = "stacked"
156	PopupBehaviorTabbed   PopupBehavior = "tabbed"
157	PopupBehaviorWindowed PopupBehavior = "windowed"
158)
159
160// PopupBehaviorConfig controls how popup windows are handled.
161type PopupBehaviorConfig struct {
162	Behavior PopupBehavior `mapstructure:"behavior" yaml:"behavior" toml:"behavior" json:"behavior"`
163
164	Placement string `mapstructure:"placement" yaml:"placement" toml:"placement" json:"placement"`
165
166	OpenInNewPane bool `mapstructure:"open_in_new_pane" yaml:"open_in_new_pane" toml:"open_in_new_pane" json:"open_in_new_pane"`
167
168	FollowPaneContext bool `mapstructure:"follow_pane_context" yaml:"follow_pane_context" toml:"follow_pane_context" json:"follow_pane_context"` //nolint:lll // struct tags must stay on one line
169
170	BlankTargetBehavior string `mapstructure:"blank_target_behavior" yaml:"blank_target_behavior" toml:"blank_target_behavior" json:"blank_target_behavior"` //nolint:lll // struct tags must stay on one line
171
172	EnableSmartDetection bool `mapstructure:"enable_smart_detection" yaml:"enable_smart_detection" toml:"enable_smart_detection" json:"enable_smart_detection"` //nolint:lll // struct tags must stay on one line
173
174	OAuthAutoClose bool `mapstructure:"oauth_auto_close" yaml:"oauth_auto_close" toml:"oauth_auto_close" json:"oauth_auto_close"`
175}
176
177// WorkspaceConfig holds all workspace layout and behavior settings.
178type WorkspaceConfig struct {
179	NewPaneURL   string                `mapstructure:"new_pane_url" yaml:"new_pane_url" toml:"new_pane_url" json:"new_pane_url"`
180	PaneMode     PaneModeConfig        `mapstructure:"pane_mode" yaml:"pane_mode" toml:"pane_mode" json:"pane_mode"`
181	TabMode      TabModeConfig         `mapstructure:"tab_mode" yaml:"tab_mode" toml:"tab_mode" json:"tab_mode"`
182	ResizeMode   ResizeModeConfig      `mapstructure:"resize_mode" yaml:"resize_mode" toml:"resize_mode" json:"resize_mode"`
183	Shortcuts    GlobalShortcutsConfig `mapstructure:"shortcuts" yaml:"shortcuts" toml:"shortcuts" json:"shortcuts"`
184	FloatingPane FloatingPaneConfig    `mapstructure:"floating_pane" yaml:"floating_pane" toml:"floating_pane" json:"floating_pane"`
185
186	TabBarPosition          string `mapstructure:"tab_bar_position" yaml:"tab_bar_position" toml:"tab_bar_position" json:"tab_bar_position"`
187	HideTabBarWhenSingleTab bool   `mapstructure:"hide_tab_bar_when_single_tab" yaml:"hide_tab_bar_when_single_tab" toml:"hide_tab_bar_when_single_tab" json:"hide_tab_bar_when_single_tab"` //nolint:lll // struct tags must stay on one line
188	SwitchToTabOnMove       bool   `mapstructure:"switch_to_tab_on_move" yaml:"switch_to_tab_on_move" toml:"switch_to_tab_on_move" json:"switch_to_tab_on_move"`                             //nolint:lll // struct tags must stay on one line
189
190	Popups  PopupBehaviorConfig    `mapstructure:"popups" yaml:"popups" toml:"popups" json:"popups"`
191	Styling WorkspaceStylingConfig `mapstructure:"styling" yaml:"styling" toml:"styling" json:"styling"`
192}
193
194// UpdateConfig holds auto-update behavior settings.
195type UpdateConfig struct {
196	EnableOnStartup     bool `mapstructure:"enable_on_startup" yaml:"enable_on_startup" toml:"enable_on_startup"`
197	AutoDownload        bool `mapstructure:"auto_download" yaml:"auto_download" toml:"auto_download"`
198	NotifyOnNewSettings bool `mapstructure:"notify_on_new_settings" yaml:"notify_on_new_settings" toml:"notify_on_new_settings"`
199}

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