diff --git a/src/seedpass/tui_v2/app.py b/src/seedpass/tui_v2/app.py index 53e3149c..4d14d8d2 100644 --- a/src/seedpass/tui_v2/app.py +++ b/src/seedpass/tui_v2/app.py @@ -110,7 +110,7 @@ def launch_tui2( from textual.binding import Binding from textual.containers import Horizontal, Vertical from textual.reactive import reactive - from textual.widgets import Input, Label, ListItem, ListView, Static + from textual.widgets import Button, Input, Label, ListItem, ListView, Static try: from textual.widgets import TextArea @@ -125,6 +125,22 @@ def launch_tui2( class SeedPassTuiV2(App[None]): RESULT_PAGE_SIZE = 200 DETAIL_CONTENT_PREVIEW_LIMIT = 4000 + FILTER_PRESETS: dict[str, list[str] | None] = { + "all": None, + "secrets": [ + "password", + "stored_password", + "seed", + "managed_account", + "ssh", + "pgp", + "nostr", + "key_value", + ], + "docs": ["document", "note"], + "keys": ["seed", "managed_account", "ssh", "pgp", "nostr"], + "2fa": ["totp"], + } CSS = """ Screen { @@ -183,7 +199,7 @@ def launch_tui2( #body { height: 1fr; margin: 0 1; } #top-work { height: 6fr; } #status { - height: 4; + height: 3; padding: 0 1; border: heavy #58f29d; background: #11191f; @@ -191,7 +207,7 @@ def launch_tui2( margin: 1 1 0 1; } #action-strip { - height: 4; + height: 3; padding: 0 1; margin: 0 1; border: heavy #2abf75; @@ -199,6 +215,17 @@ def launch_tui2( color: #daf2e5; } #left { width: 31; border: solid #1a3024; padding: 0 1; background: #0d1114; } + #left.sidebar-collapsed { width: 3; padding: 0; } + #sidebar-toggle { + height: 1; + min-height: 1; + margin: 0; + border: none; + background: transparent; + color: #58f29d; + text-style: bold; + content-align: left middle; + } #center { width: 1fr; border: solid #1a3024; padding: 0 1; background: #0d1114; margin-left: 1; } #right { height: 5fr; border: heavy #3ce79c; padding: 1; background: #0d1114; margin-top: 0; } #grid-heading { @@ -228,27 +255,31 @@ def launch_tui2( } #search { margin-bottom: 0; } #quick-jump { margin-bottom: 0; } + #kind-filter-input { + margin-bottom: 0; + border: solid #2abf75; + } #entry-list { height: 1fr; } #entry-detail { width: 1fr; height: 1fr; overflow: auto; border: solid #58f29d; - padding: 1; + padding: 0 1; } #link-detail { min-height: 3; height: 2fr; overflow: auto; border: solid #2abf75; - padding: 1; + padding: 0 1; } #secret-detail { min-height: 3; height: 1fr; overflow: auto; border: solid #58f29d; - padding: 1; + padding: 0 1; margin-top: 0; text-wrap: nowrap; } @@ -296,7 +327,8 @@ def launch_tui2( ("1", "focus_left", "Left"), ("2", "focus_center", "Center"), ("3", "focus_right", "Right"), - ("f", "cycle_filter", "Filter"), + ("f", "toggle_filter_menu", "Filter Menu"), + ("shift+f", "cycle_filter", "Filter"), ("d", "toggle_density", "Density"), ("h", "cycle_archive_scope", "Archive View"), ("up", "profile_tree_prev", "Profile Prev"), @@ -315,6 +347,7 @@ def launch_tui2( ("e", "edit_document", "Edit Document"), ("ctrl+s", "save_document", "Save"), ("ctrl+p", "open_palette", "Palette"), + ("ctrl+b", "toggle_sidebar", "Sidebar"), ("escape", "cancel_document_edit", "Cancel"), ] @@ -332,7 +365,7 @@ def launch_tui2( "Command palette: help | open | search | " "help-commands | onboarding | quickstart | stats | session-status | lock | unlock | " "density | " - "filter | archive | restore | " + "filter | archive | restore | " "archive-filter | " "add-password