Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ On the same page, **Style** builds the whole app another way, on this device: Li
- **Clean cache** (a host's): what its enowX folder takes, and what can go of it, each kind with its size, what cleaning it does and a box. It only removes what a look just listed, under folders named in `core/cacheclean`. It asks first and reports what was freed and, item by item, what wasn't. Old app backups and worktrees are picked one by one, with their date and state. Team sync's copies are shown but not offered, as merges need them. `enowx-app cache` and `enowx-app cache clean` do the same. **Logs** keep the current ones and each one's most recent rotated copy ([diagnostics.md](diagnostics.md)).
- **Discord**: Rich Presence, under the user's name in Discord: the selected session's project, branch and agent (in GOD of Agents mode, "Working using GOA" and the agent it runs on instead), how many sessions are open and how long it has run, with a *Get enowX* button to enowx.ai; *In enowX* with no session. On by default; a switch keeps the project's and branch's names out. It goes to the Discord app on this device only, over its local socket, and updates no more often than Discord allows. It needs the build's Discord application (`ENOWX_DISCORD_APP_ID` replaces it).
- **Cloud**: the connected host's sign-in to enowX's cloud, https://cloud.enowx.ai ([cloud.md](cloud.md)), also at the rail's foot (**Sign in**, then the account's menu): signing in with GitHub (the browser opens on a code to approve), nothing reaching the cloud before; then two tabs: **Teams**, the account's teams as cards, each opening a dialog of its members and of an invite link made for one as member, viewer or admin, with **New team** and **Join with an invite** in dialogs of their own; and **Devices**, to sign one out or approve a code another shows. Signing out, removing a member and leaving a team ask first. The account's menu at the rail's foot also picks the space Notes and Canvas show: Personal, or a team's. Each host signs in as a device of its own; this computer's is the app.
- **App**: the editor files open in, desktop notifications, keeping enowX in the menu bar or notification area when its window closes ([tray.md](tray.md)), looking for updates by itself, the version, and the keyboard shortcuts.
- **App**: the editor files open in, desktop notifications, keeping enowX in the menu bar or notification area when its window closes ([tray.md](tray.md)), looking for updates by itself, the version, and customizable keyboard shortcuts (with modifier key requirements, conflict refusal, and terminal key protection).
- **Floating control**: the round panel over any app and its shortcut ([floating-control.md](floating-control.md)), whether clicking another app folds it away, whether it opens at the pointer or in the middle of the display, and hiding the Sessions panel. Its own accent color, tinted segments, compact size and reduced animation can be set here without changing the app theme.
- **Diagnostics**: the host's daemon (version, pid, since when, its build), the end of its log (`daemon.log`), and **Restart the daemon** (`daemon.restart`): it stops as an update stops it, and connecting again starts it, its sessions continued.
7 changes: 4 additions & 3 deletions ui/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,10 @@ type App struct {
// portOffers are ports sessions just opened, offered to open.
portOffers []portOffer
// conflicts are the conflict radar's last look, by project path.
conflicts map[string][]proto.Conflict
budget *budgetForm // setting a session's budget
agentLimit *agentsForm // setting the host's limit of agents at once
conflicts map[string][]proto.Conflict
budget *budgetForm // setting a session's budget
agentLimit *agentsForm // setting the host's limit of agents at once
shortcutsForm *shortcutDialogState
usage usageview.Meter
usageShown bool // the Resource usage page was shown last frame
tok tokensState // token usage: the Tokens tab, sessions' badges (tokens.go)
Expand Down
28 changes: 18 additions & 10 deletions ui/palette.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (a *App) commands() []command {
var out []command
p, hasProject := a.currentProject()
if hasProject {
out = append(out, command{"new", "New session", modKey + "N", icon.Plus, func() { a.openNewSession(p) }})
out = append(out, command{"new", "New session", a.shortcutLabel(ShortcutNewSession), icon.Plus, func() { a.openNewSession(p) }})
}
out = append(out, command{"sessions", "Sessions", "Page", icon.Terminal, func() {
if a.goaOn() {
Expand Down Expand Up @@ -79,14 +79,14 @@ func (a *App) commands() []command {
}
out = append(out,
command{"add-host", "Add host", "A VPS or another device", icon.Server, a.openAddHost},
command{"open", "Open folder", modKey + "O", icon.FolderPlus, a.openFolder},
command{"open", "Open folder", a.shortcutLabel(ShortcutOpenFolder), icon.FolderPlus, a.openFolder},
command{"clone", "Clone from Git", "", icon.Git, a.openClone},
command{"goto-file", "Go to file…", modKey + "P", icon.File, a.openQuickOpen},
command{"goto-file", "Go to file…", a.shortcutLabel(ShortcutQuickOpen), icon.File, a.openQuickOpen},
)
if hasProject && a.client != nil {
out = append(out, command{"history", "Past conversations", p.Name, icon.Chat, func() { a.openHistory(p) }})
}
out = append(out, command{"rail", "Expand or collapse sidebar", modKey + "B", icon.Sidebar, func() { a.state.RailWide = !a.state.RailWide }})
out = append(out, command{"rail", "Expand or collapse sidebar", a.shortcutLabel(ShortcutSidebar), icon.Sidebar, func() { a.state.RailWide = !a.state.RailWide }})
out = append(out, a.sessionCommands()...)
out = append(out, a.runPaletteCommands()...)
if hasProject && a.client != nil {
Expand All @@ -105,7 +105,7 @@ func (a *App) commands() []command {
command{"quit-stop", "Quit and stop all agents", "On this device", icon.Stop, a.quitAndStopAgents},
command{"diagnostics", "Save diagnostics for a bug report", "This device's logs and " + a.host.Name + "'s, as a zip", icon.Download, a.saveDiagnostics},
command{"updates", "Check for updates", "enowX " + version.String, icon.ArrowUp, func() { a.checkForUpdates(true) }},
command{"sessions-panel", "Show or hide the sidebar", modKey + "⇧S", icon.Sidebar, a.toggleSessionsPanel},
command{"sessions-panel", "Show or hide the sidebar", a.shortcutLabel(ShortcutSessionsPanel), icon.Sidebar, a.toggleSessionsPanel},
command{"floating", "Floating control", floatingKey + " · Over any app", icon.Floating, a.toggleFloating},
)
for _, h := range a.allHosts() {
Expand Down Expand Up @@ -135,9 +135,9 @@ func (a *App) sessionCommands() []command {
label = "Show one session at a time"
}
out = append(out,
command{"split", label, modKey + "⇧L", icon.Split, func() { a.setSplit(!a.splitOn()) }},
command{"next", "Next session", modKey + "⇧]", icon.ChevronRight, func() { a.stepSession(1) }},
command{"previous", "Previous session", modKey + "⇧[", icon.ChevronRight, func() { a.stepSession(-1) }},
command{"split", label, a.shortcutLabel(ShortcutSplitView), icon.Split, func() { a.setSplit(!a.splitOn()) }},
command{"next", "Next session", a.shortcutLabel(ShortcutNextSession), icon.ChevronRight, func() { a.stepSession(1) }},
command{"previous", "Previous session", a.shortcutLabel(ShortcutPrevSession), icon.ChevronRight, func() { a.stepSession(-1) }},
)
}
s, ok := a.selectedSession()
Expand All @@ -160,7 +160,11 @@ func (a *App) sessionCommands() []command {
if a.panelShows(panelChanges) {
label = "Hide changes"
}
out = append(out, command{"changes", label, name + " · " + modKey + "⇧D", icon.Git, func() { a.toggleTool(panelChanges) }})
sub := name
if lbl := a.shortcutLabel(ShortcutSidePanel); lbl != "" {
sub += " · " + lbl
}
out = append(out, command{"changes", label, sub, icon.Git, func() { a.toggleTool(panelChanges) }})
}
for _, t := range panelTools[1:] {
label := "Show " + strings.ToLower(t.name)
Expand All @@ -173,7 +177,11 @@ func (a *App) sessionCommands() []command {
if a.maximized != "" {
maximize = "Restore session"
}
out = append(out, command{"maximize", maximize, name + " · " + modKey + "⇧↩", icon.Maximize, func() { a.toggleMaximized(s.ID) }})
maxSub := name
if lbl := a.shortcutLabel(ShortcutMaximize); lbl != "" {
maxSub += " · " + lbl
}
out = append(out, command{"maximize", maximize, maxSub, icon.Maximize, func() { a.toggleMaximized(s.ID) }})
if a.canReview(s) {
for _, r := range []struct {
action, label string
Expand Down
54 changes: 48 additions & 6 deletions ui/settings_sections.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,16 +546,58 @@
a.commandLineCard(c)
})
widget.GridCard(c.Key("keys")).Grow(7).Basis(0).Children(func() {
list := shortcutList()
widget.CardTitle(c, nil, "Keyboard shortcuts", func() {
ui.Text(c, strconv.Itoa(len(list))).FontSize(theme.TextLabel).TextColor(theme.TextSoft)
if a.hasCustomShortcuts() {
if widget.GhostButton(c.Key("reset-shortcuts-top"), "Reset").Clicked() {
a.confirm("Reset all shortcuts to defaults?", "All custom shortcut key combinations will be restored to their factory defaults.", "Reset all", func() {
a.resetAllShortcuts()
})
}
}
if widget.GhostButton(c.Key("customize-shortcuts"), "Customize…").Clicked() {
a.openShortcutSheet()
}
})
masterOn := !a.state.ShortcutsOff
if switchRowKey(c, "app-master-shortcuts", &masterOn, "Enable keyboard shortcuts", "Turn off to disable all application shortcuts") {
a.state.ShortcutsOff = !masterOn
a.saveState()
}
ui.Column(c).FillWidth().MinWidth(0).Children(func() {
for _, s := range list {
for _, def := range GlobalShortcuts {
cfg := a.shortcutConfig(def.ID)
mods, key, disabled := a.effectiveShortcut(def.ID)
globallyOff := a.state.ShortcutsOff
keyStr := FormatKey(mods, key)
if keyStr == "" || disabled || globallyOff {
keyStr = "Off"
}

ui.Box(c).Height(theme.Rule).FillWidth().Shrink(0).Background(theme.Border)
defID := def.ID
row := ui.Row(c.Key(string(defID))).FillWidth().Height(28).Shrink(0).Gap(theme.S3).Cursor(ui.CursorPointer)
if row.Clicked() {
a.openShortcutSheet(defID)
}
row.Children(func() {
ui.Row(c).Grow(1).MinWidth(0).Gap(theme.S2).AlignItems(ui.Center).Children(func() {
widget.Running(c, def.Name, widget.RunStyle{})
if cfg.Custom {
widget.Chip(c, "Custom", ui.Color{})
}
})
ui.Text(c, keyStr).FontSize(theme.TextLabel).TextColor(theme.TextSoft).SingleLine().Shrink(0)
})
}

for _, info := range [][2]string{
{floatingKey, "Floating control, over any app"},
{modKey + "-click", "Open a path or a local page printed in a terminal"},
} {
ui.Box(c).Height(theme.Rule).FillWidth().Shrink(0).Background(theme.Border)
ui.Row(c.Key(s[0])).FillWidth().Height(28).Shrink(0).Gap(theme.S3).Children(func() {
ui.Row(c).Grow(1).MinWidth(0).Children(func() { widget.Running(c, s[1], widget.RunStyle{}) })
ui.Text(c, s[0]).FontSize(theme.TextLabel).TextColor(theme.TextSoft).SingleLine().Shrink(0)
ui.Row(c.Key(info[0])).FillWidth().Height(28).Shrink(0).Gap(theme.S3).Children(func() {
ui.Row(c).Grow(1).MinWidth(0).Children(func() { widget.Running(c, info[1], widget.RunStyle{}) })
ui.Text(c, info[0]).FontSize(theme.TextLabel).TextColor(theme.TextSoft).SingleLine().Shrink(0)
})
}
})
Expand Down Expand Up @@ -600,7 +642,7 @@

// shortcutList is the app's keyboard shortcuts, as the keys and what they
// do.
func shortcutList() [][2]string {

Check failure on line 645 in ui/settings_sections.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

func shortcutList is unused (U1000)

Check failure on line 645 in ui/settings_sections.go

View workflow job for this annotation

GitHub Actions / test (macos-latest)

func shortcutList is unused (U1000)
return [][2]string{
{modKey + "K", "Command palette"},
{modKey + "P", "Go to a file of the session"},
Expand Down
Loading
Loading