Merge pull request #6 from shokinn/codex/update-key-bindings-as-per-project-brief

Align key bindings with project brief
This commit is contained in:
Philip Henning 2025-08-14 09:05:55 +02:00 committed by GitHub
commit 63c0d38455
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 8 deletions

View file

@ -18,13 +18,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
} else {
m.focus = listPane
}
case "e":
case "ctrl+e":
if m.mode == ViewMode {
m.mode = EditMode
} else {
m.mode = ViewMode
}
case "a":
case " ":
if m.mode == EditMode {
if entry := m.SelectedEntry(); entry != nil {
entry.Active = !entry.Active
@ -34,7 +34,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
case "up", "k":
if m.focus == detailPane {
m.detail.LineUp(1)
m.detail.ScrollUp(1)
} else {
m.list, cmd = m.list.Update(msg)
m.refreshDetail()
@ -42,7 +42,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, cmd
case "down", "j":
if m.focus == detailPane {
m.detail.LineDown(1)
m.detail.ScrollDown(1)
} else {
m.list, cmd = m.list.Update(msg)
m.refreshDetail()

View file

@ -24,8 +24,8 @@
- ✅ **Parser integration** loading `/etc/hosts` into the UI
### Phase 3: Edit Mode (IN PROGRESS)
- 🔄 **Edit mode toggle** via 'e' key with status bar indication
- 🔄 **Entry activation toggle** using 'a' key
- 🔄 **Edit mode toggle** via 'ctrl+e' key with status bar indication
- 🔄 **Entry activation toggle** using spacebar
- 🔄 **Model tests** covering edit mode behavior
### Parser Capabilities Achieved

View file

@ -80,6 +80,7 @@
- **Active work**: Expand edit mode with file integration and advanced editing
- **Blockers**: None - comprehensive parser foundation with 54 tests completed
- **Parser status**: Production-ready with all safety features implemented
- **Key bindings updated**: `ctrl+e` for edit mode, spacebar to toggle entries
### Development Readiness
- ✅ **Architecture designed**: Clear technical approach documented

View file

@ -72,12 +72,12 @@ func TestEditModeToggleAndActivation(t *testing.T) {
m := tui.NewModel(hf)
// enter edit mode
nm, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'e'}})
nm, _ := m.Update(tea.KeyMsg{Type: tea.KeyCtrlE})
m = nm.(tui.Model)
assert.Equal(t, tui.EditMode, m.Mode())
// toggle active state of first entry
nm, _ = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'a'}})
nm, _ = m.Update(tea.KeyMsg{Type: tea.KeySpace})
m = nm.(tui.Model)
assert.False(t, m.SelectedEntry().Active)