feat: restructure KeyMappings into nested config with form-specific k… #119
No reviewers
Labels
No labels
bug
ci
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
performance
priority
P0
priority
P1
priority
P2
question
refactor
size
L
size
M
size
S
size
XL
size
XS
tests
trivial
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/paso!119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature-110/consistent-keymappings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reorganize flat KeyMappings struct into 7 nested sub-structs (navigation, tasks, kanban, projects, forms, pickers, general) so all keybindings come from config. Add form-specific ctrl+ shortcuts to FormKeys to avoid conflicting with text input. Rename navigation keys from prev_column/ next_column/prev_task/next_task to move_left/right/up/down since they are used across pickers, filter bar, and other contexts. Add example_config.yaml with all defaults for easy user setup.
Checklist
CONTRIBUTING.mdgo test ./... -race) locallygofmt -w .andgolangci-lint run ./...respectivelyREADME.mdif applicableSummary
Closes: #110
Each of the 7 sub-struct
applyDefaults()methods callsDefaultKeyMappings()independently, so a singleKeyMappings.applyDefaults()invocation constructs 7 fullKeyMappingsvalues and discards 6/7ths of each. The fix is to compute the defaults once and pass the relevant slice down:This keeps the logic per-struct while allocating only once.
@ -49,7 +51,7 @@ func (m Model) updateCommentEdit(msg tea.KeyMsg) (tea.Model, tea.Cmd) {}The
"n"alternative binding for "new comment" has been silently removed. The previouscase "ctrl+n", "n":is nowcase km.Forms.OpenCommentsView:(defaults toctrl+nonly).updateCommentEditoperates on a comment list, not a text input field, so"n"did not conflict with text entry — its removal is a behavioral regression with no rationale in the PR description.@ -0,0 +34,4 @@edit_due_date: "ctrl+d"edit_parent_task: "p"edit_child_task: "c"edit_type: "ctrl+t"tasks.edit_typeis documented here as a normal-mode task shortcut (the section comment says "single-key shortcuts"), butkm.Tasks.EditTypehas nocasehandler inhandleNormalMode(update_normal.go). Onlykm.Forms.EditTypeis consumed (insideupdateTaskForm). A user who sets this key will observe no effect from the kanban/list view. Either wire it up in normal mode or move it exclusively to theformssection.Review Summary
The restructuring is clean and the intent is correct — breaking a flat 30-field struct into 7 contextual sub-structs is the right call, and the rename from prev_column/next_column/prev_task/next_task to directional names is an improvement. Three issues found:
applyDefaults efficiency (keymaps.go): DefaultKeyMappings() is invoked once per sub-struct, so a single config load constructs 7 full KeyMappings values. Minor in practice (config loads once), but structurally wrong.
Silent removal of 'n' binding (update_notes.go): The plain-n shortcut for new comment in comment-edit mode was dropped without explanation. That mode presents a list — no text input — so there is no conflict reason to remove it.
Dead config key (example_config.yaml, keymaps.go): tasks.edit_type is listed as a normal-mode single-key shortcut but km.Tasks.EditType has no handler in handleNormalMode. Only km.Forms.EditType is consumed. Setting this key does nothing from the kanban/list view.
Score: 7/10