Skip to content
Merged
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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ For more info on how to configure Programa, head over to our docs.
| Shortcut | Action |
|----------|--------|
| ⌘ N | New workspace |
| ⌘ P | Go to workspace |
| ⌘ 1–8 | Jump to workspace 1–8 |
| ⌘ 9 | Jump to last workspace |
| ⌃ ⌘ ] | Next workspace |
Expand Down Expand Up @@ -224,6 +225,7 @@ Browser developer-tool shortcuts follow Safari defaults and are customizable in
| Shortcut | Action |
|----------|--------|
| ⌘ ⇧ N | New window |
| ⌘ ⇧ P | Command palette |
| ⌘ , | Settings |
| ⌘ ⇧ , | Reload configuration |
| ⌘ Q | Quit |
Expand Down
68 changes: 68 additions & 0 deletions Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,40 @@
}
}
},
"command.reloadConfiguration.subtitle": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Re-read settings.json and programa.json"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "settings.json と programa.json を再読み込みします"
}
}
}
},
"command.reloadConfiguration.title": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Reload Configuration"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "設定を再読み込み"
}
}
}
},
"command.renameTab.title": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -2795,6 +2829,40 @@
}
}
},
"command.sendFeedback.subtitle": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Compose feedback to the programa team"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "programa チームにフィードバックを送る"
}
}
}
},
"command.sendFeedback.title": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Send Feedback…"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "フィードバックを送信…"
}
}
}
},
"command.showNotifications.subtitle": {
"extractionState": "manual",
"localizations": {
Expand Down
22 changes: 22 additions & 0 deletions Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3594,6 +3594,22 @@ struct ContentView: View {
keywords: ["create", "new", "window"]
)
)
contributions.append(
CommandPaletteCommandContribution(
commandId: "palette.sendFeedback",
title: constant(String(localized: "command.sendFeedback.title", defaultValue: "Send Feedback…")),
subtitle: constant(String(localized: "command.sendFeedback.subtitle", defaultValue: "Compose feedback to the programa team")),
keywords: ["feedback", "report", "bug"]
)
)
contributions.append(
CommandPaletteCommandContribution(
commandId: "palette.reloadConfiguration",
title: constant(String(localized: "command.reloadConfiguration.title", defaultValue: "Reload Configuration")),
subtitle: constant(String(localized: "command.reloadConfiguration.subtitle", defaultValue: "Re-read settings.json and programa.json")),
keywords: ["reload", "config", "settings", "refresh"]
)
)
contributions.append(
CommandPaletteCommandContribution(
commandId: "palette.installCLI",
Expand Down Expand Up @@ -4352,6 +4368,12 @@ struct ContentView: View {
registry.register(commandId: "palette.newWindow") {
AppDelegate.shared?.openNewMainWindow(nil)
}
registry.register(commandId: "palette.sendFeedback") {
presentFeedbackComposer()
}
registry.register(commandId: "palette.reloadConfiguration") {
GhosttyApp.shared.reloadConfiguration(source: "palette.reloadConfiguration")
}
registry.register(commandId: "palette.installCLI") {
AppDelegate.shared?.installProgramaCLIInPath(nil)
}
Expand Down
44 changes: 44 additions & 0 deletions tests_v2/test_command_palette_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ def _matches() -> bool:
_wait_until(_matches, timeout_s=timeout_s, message=message)


def _results_contain_command(client: cmux, window_id: str, command_id: str, limit: int = 20) -> bool:
rows = _palette_results(client, window_id, limit=limit).get("results") or []
return any(str((row or {}).get("command_id") or "") == command_id for row in rows)


def _set_palette_visible(client: cmux, window_id: str, visible: bool) -> None:
if _palette_visible(client, window_id) == visible:
return
Expand Down Expand Up @@ -186,6 +191,45 @@ def main() -> int:
message="second cmd+p did not close the command palette",
)

# New palette commands (issue #136 closeout): sendFeedback and
# reloadConfiguration must be searchable in commands mode. This only
# asserts presence in results — it does not invoke either command.
client.simulate_shortcut("cmd+shift+p")
_wait_until(
lambda: _palette_visible(client, window_id)
and str(_palette_results(client, window_id).get("mode") or "") == "commands",
message="cmd+shift+p did not reopen commands mode for feedback query",
)
client.simulate_type("feedback")
_wait_until(
lambda: _results_contain_command(client, window_id, "palette.sendFeedback"),
message="commands mode search for 'feedback' did not surface palette.sendFeedback",
)

client.simulate_shortcut("cmd+shift+p")
_wait_until(
lambda: not _palette_visible(client, window_id),
message="cmd+shift+p did not close the command palette after feedback query",
)

client.simulate_shortcut("cmd+shift+p")
_wait_until(
lambda: _palette_visible(client, window_id)
and str(_palette_results(client, window_id).get("mode") or "") == "commands",
message="cmd+shift+p did not reopen commands mode for reload config query",
)
client.simulate_type("reload config")
_wait_until(
lambda: _results_contain_command(client, window_id, "palette.reloadConfiguration"),
message="commands mode search for 'reload config' did not surface palette.reloadConfiguration",
)

client.simulate_shortcut("cmd+shift+p")
_wait_until(
lambda: not _palette_visible(client, window_id),
message="cmd+shift+p did not close the command palette after reload config query",
)

print("PASS: command palette cmd+p/cmd+shift+p open correct modes and toggle on repeat")
return 0

Expand Down
Loading