tui2: add full in-app palette command reference

This commit is contained in:
thePR0M3TH3AN committed 2026-03-02 09:20:04 -05:00
1 parent 949d87dd4f
commit 3f0d4a8d89
6 files changed
+107 -23

No files matched your search

+7 -3
View File
@@ -64,9 +64,9 @@ Use these docs as inputs, but treat this file as the decision layer:
## 4) Recommended Next Steps (Priority Order)
1. Advance Nostr resilience validation with optional real-relay soak lane after deterministic suites.
2. Finish supply-chain readiness evidence and release-protection policy.
3. Expand operational runbooks and staged rollout evidence for security readiness closure.
1. Continue feature-development parity polish in TUI v2 with user-driven UX gaps.
2. Raise TUI v2 critical-path coverage beyond current gate floor (target >82% for `src/seedpass/tui_v2/app.py`).
3. Advance Nostr resilience validation with optional real-relay soak lane after deterministic suites.
4. Execute a tagged release integrity run and attach evidence URLs in readiness checklist.
## 5) Next Slice Definition (Recommended Immediate Work)
@@ -122,6 +122,10 @@ Progress update (2026-03-02):
- `docs/operational_runbooks.md`
- `docs/staged_rollout_runbook.md`
- `docs/agent-handoffs/incidents/2026-02-15-relay-health-preflight-job.md`
- Discoverability parity improved in TUI v2:
- added full palette command reference (`help-commands`, alias `commands`)
- `help` now also renders in-app command reference in entry detail pane
- focused TUI gate remains green with improved app coverage (`79.97%`)
## 6) Working Rule
+1 -1
View File
@@ -21,7 +21,7 @@ This checklist tracks readiness to switch default interactive mode from legacy T
| Graph links list | Limited | Yes | Dedicated links panel. |
| Link add/remove | Limited | Yes | Via command palette commands. |
| Neighbor traversal | No | Yes | Link cursor + open target entry. |
| Command discoverability | Menu-driven | Partial | Keybind hints and palette `help`. |
| Command discoverability | Menu-driven | Yes | Keybind hints, compact `?` overlay, palette `help`, and full `help-commands` reference. |
| Full legacy workflow coverage | Yes | Yes | Closed with parity matrix completion + bug-bash evidence (2026-03-02). |
## Phase 4 Deliverables
+24
View File
@@ -768,3 +768,27 @@
- `docs/security_readiness_checklist.md` rows 8/9/10 now reference new runbooks and moved 9/10 to `In Progress`.
- `docs/dev_control_center.md` and `docs/README.md` now link the new runbook docs.
- `TODO.md` supply-chain item now references published verification runbook.
## 2026-03-02 Feature/parity refocus slice: in-app command discoverability + coverage bump
- Added full palette command reference support in TUI v2 (`src/seedpass/tui_v2/app.py`):
- new command: `help-commands`
- alias: `commands`
- `help` now also renders the full reference in the entry-detail panel.
- Added command reference helpers:
- `_palette_help_summary()`
- `_palette_reference_text()`
- Updated palette placeholder copy to include `help-commands`.
- Tests added/expanded:
- `src/tests/test_tui_v2_textual_interactions.py`
- `test_tui2_textual_palette_help_commands_reference`
- `src/tests/test_tui_v2_action_matrix.py`
- command matrix now covers `help-commands` success + usage error path.
- Validation:
- `pytest -q src/tests/test_tui_v2_textual_interactions.py src/tests/test_tui_v2_action_matrix.py src/tests/test_tui_v2_parity_scenarios.py src/tests/test_tui_v2_helpers.py`
- Result: `40 passed`.
- `./scripts/tui2_coverage_gate.sh` -> PASS
- `src/seedpass/tui_v2/app.py`: `79.97%` (up from `79.87%`)
- `src/seedpass/core/api.py`: `86.64%`.
- Docs updated:
- `docs/tui_v2_parity_checklist.md`: command discoverability row moved from `Partial` to `Yes`.
- `docs/dev_control_center.md`: priorities refocused to feature/parity and test coverage targets first.
+53 -19
View File
@@ -282,6 +282,7 @@ def launch_tui2(
yield Input(
placeholder=(
"Command palette: help | open <id> | search <q> | "
"help-commands | "
"filter <kind> | archive | restore | "
"archive-filter <active|all|archived> | "
"add-password <label> <length> [username] [url] | "
@@ -489,6 +490,46 @@ def launch_tui2(
def _set_secret_panel(self, text: str) -> None:
self.query_one("#secret-detail", Static).update(text)
def _palette_help_summary(self) -> str:
return (
"Palette commands: help, help-commands, open, search, filter, "
"archive, restore, archive-filter, edit-doc/save-doc/cancel-edit, "
"link-add/link-rm/link-filter/link-next/link-prev/link-open, "
"add-*, notes/tags/fields, 2fa-*, profile-*, setting-*, relay-*, "
"npub, nostr-reset-sync-state, nostr-fresh-namespace, sync-now/sync-bg, "
"checksum-*, db-*, totp-export, parent-seed-backup, managed-load/exit, "
"reveal/qr, page-*, retry, jump."
)
def _palette_reference_text(self) -> str:
return "\n".join(
[
"Palette Reference",
"-----------------",
"",
"Core: help | help-commands | open <id> | jump <id> | search <q>",
"Filters: filter <kind|all> | archive-filter <active|all|archived>",
"Pages: page-next | page-prev | page <n>",
"",
"Entry Actions: archive | restore | reveal [confirm] | qr [public|private] [confirm]",
"Docs: edit-doc | save-doc | cancel-edit | doc-export [output_path]",
"Graph: link-add <target> [relation] [note] | link-rm <target> [relation]",
"Graph Nav: link-filter <relation|all> | link-next | link-prev | link-open",
"",
"Add: add-password | add-totp | add-key-value | add-document | add-ssh | add-pgp | add-nostr | add-seed | add-managed-account",
"Entry Fields: notes-set | notes-clear | tag-add | tag-rm | tags-set | tags-clear | field-add | field-rm | set-field | clear-field",
"",
"2FA: 2fa-board | 2fa-hide | 2fa-refresh | 2fa-copy <entry_id>",
"Profiles: profiles-list | profile-switch | profile-add | profile-remove | profile-rename",
"Settings: setting-secret | setting-offline | setting-quick-unlock | setting-timeout | setting-kdf-iterations | setting-kdf-mode",
"Nostr: relay-list | relay-add | relay-rm | relay-reset | npub | nostr-reset-sync-state | nostr-fresh-namespace",
"Sync/Utility: sync-now | sync-bg | checksum-verify | checksum-update | db-export | db-import | totp-export | parent-seed-backup",
"Sessions: managed-load [entry_id] | managed-exit",
"",
"Tip: use '?' for compact keyboard help overlay.",
]
)
def _update_help_overlay(self) -> None:
box = self.query_one("#help-overlay", Static)
if not self.help_open:
@@ -1391,26 +1432,19 @@ def launch_tui2(
return
if cmd == "help":
self._set_status(
"Palette commands: help, open, search, filter, archive, "
"restore, archive-filter, edit-doc, save-doc, cancel-edit, link-add, link-rm, "
"add-password, add-totp, add-key-value, add-document, add-ssh, "
"add-pgp, add-nostr, add-seed, add-managed-account, "
"notes-set, notes-clear, tag-add, tag-rm, tags-set, tags-clear, "
"field-add, field-rm, set-field, clear-field, doc-export, "
"2fa-board, 2fa-hide, 2fa-refresh, 2fa-copy, "
"profiles-list, profile-switch, profile-add, profile-remove, profile-rename, "
"setting-secret, setting-offline, setting-quick-unlock, setting-timeout, "
"setting-kdf-iterations, setting-kdf-mode, "
"relay-list, relay-add, relay-rm, relay-reset, "
"npub, nostr-reset-sync-state, nostr-fresh-namespace, "
"sync-now, sync-bg, "
"checksum-verify, checksum-update, db-export, db-import, "
"totp-export, parent-seed-backup, managed-load, managed-exit, "
"reveal [confirm], qr [public|private] [confirm], link-filter, "
"link-next, link-prev, link-open, page-next, page-prev, page <n>, "
"retry, jump <id>"
self.query_one("#entry-detail", Static).update(
self._palette_reference_text()
)
self._set_status(self._palette_help_summary())
return
if cmd in {"help-commands", "commands"}:
if args:
self._set_status("Usage: help-commands")
return
self.query_one("#entry-detail", Static).update(
self._palette_reference_text()
)
self._set_status("Displayed full palette command reference")
return
if cmd == "retry":
self.action_retry_last_error()
+2
View File
@@ -504,6 +504,7 @@ async def test_tui2_matrix_actions_palette_events_and_guards() -> None:
app._run_palette_command("page")
app._run_palette_command("page abc")
app._run_palette_command("page 0")
app._run_palette_command("help-commands now")
app._run_palette_command("link-filter")
app._run_palette_command("link-add")
app._run_palette_command("link-add no")
@@ -577,6 +578,7 @@ async def test_tui2_matrix_actions_palette_events_and_guards() -> None:
await pilot.pause()
app._run_palette_command("help")
app._run_palette_command("help-commands")
app._run_palette_command("search Doc")
app._run_palette_command("filter document")
app._run_palette_command("archive-filter all")
@@ -738,6 +738,26 @@ async def test_tui2_textual_link_commands_and_neighbor_open() -> None:
assert "No graph links" in links_text
@pytest.mark.anyio
async def test_tui2_textual_palette_help_commands_reference() -> None:
service = FakeEntryService([{"id": 1, "kind": "document", "label": "Doc 1"}])
app = _build_app(service)
async with app.run_test() as pilot:
await pilot.pause()
await _run_palette(app, pilot, "help-commands")
detail = _widget_text(app, "#entry-detail")
assert "Palette Reference" in detail
assert "archive-filter <active|all|archived>" in detail
assert "npub" in detail
assert "Displayed full palette command reference" in _status_text(app)
await _run_palette(app, pilot, "help")
assert "Palette Reference" in _widget_text(app, "#entry-detail")
assert "Palette commands:" in _status_text(app)
@pytest.mark.anyio
async def test_tui2_textual_reveal_and_qr_flow() -> None:
service = FakeEntryService(