Skip to content

Commit 3d29402

Browse files
committed
Remove chat and refine features
- Remove chat mode keybindings and configuration - Remove prompt refinement with AI functionality - Remove associated message types and handlers - Remove chat-related e2e tests
1 parent b6ff95b commit 3d29402

File tree

5 files changed

+16
-603
lines changed

5 files changed

+16
-603
lines changed

internal/config/config.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ type KeyBindings struct {
2424
LeftPane string `toml:"left_pane"`
2525
RightPane string `toml:"right_pane"`
2626
ToggleMinimap string `toml:"toggle_minimap"`
27-
ToggleChat string `toml:"toggle_chat"`
2827
ToggleLeftPane string `toml:"toggle_left_pane"`
2928

3029
// Navigation
@@ -46,7 +45,6 @@ type KeyBindings struct {
4645
NewPrompt string `toml:"new_prompt"`
4746
NewGlobalPrompt string `toml:"new_global_prompt"`
4847
EditPrompt string `toml:"edit_prompt"`
49-
RefinePrompt string `toml:"refine_prompt"`
5048
DeletePrompt string `toml:"delete_prompt"`
5149
YankPrompt string `toml:"yank_prompt"`
5250
InjectMethod string `toml:"inject_method"`
@@ -62,17 +60,6 @@ type KeyBindings struct {
6260
// Plan mode
6361
GeneratePlan string `toml:"generate_plan"`
6462
EditPlan string `toml:"edit_plan"`
65-
66-
// Chat mode
67-
SendChat string `toml:"send_chat"`
68-
CloseChat string `toml:"close_chat"`
69-
KillChat string `toml:"kill_chat"`
70-
ClearChat string `toml:"clear_chat"`
71-
72-
// Context-aware chat keys
73-
ChatRalph string `toml:"chat_ralph"` // Open Ralph chat
74-
ChatPrompt string `toml:"chat_prompt"` // Open Prompt chat
75-
ChatPlan string `toml:"chat_plan"` // Open Plan chat
7663
}
7764

7865
// DefaultConfig returns a config with default values
@@ -89,7 +76,6 @@ func DefaultConfig() *Config {
8976
LeftPane: "[",
9077
RightPane: "]",
9178
ToggleMinimap: "m",
92-
ToggleChat: "c",
9379
ToggleLeftPane: "h",
9480

9581
// Navigation
@@ -111,7 +97,6 @@ func DefaultConfig() *Config {
11197
NewPrompt: "n",
11298
NewGlobalPrompt: "N",
11399
EditPrompt: "e",
114-
RefinePrompt: "r",
115100
DeletePrompt: "ctrl+d",
116101
YankPrompt: "y",
117102
InjectMethod: "i",
@@ -127,17 +112,6 @@ func DefaultConfig() *Config {
127112
// Plan mode
128113
GeneratePlan: "G",
129114
EditPlan: "e",
130-
131-
// Chat mode
132-
SendChat: "enter",
133-
CloseChat: "esc",
134-
KillChat: "ctrl+c",
135-
ClearChat: "ctrl+l",
136-
137-
// Context-aware chat
138-
ChatRalph: "R", // Open Ralph Loop chat
139-
ChatPrompt: "P", // Open Prompt chat
140-
ChatPlan: "A", // Open Plan chat (A for "Ask about plan")
141115
},
142116
}
143117
}
@@ -208,7 +182,6 @@ prev_tab = "shift+tab"
208182
left_pane = "["
209183
right_pane = "]"
210184
toggle_minimap = "m"
211-
toggle_chat = "c"
212185
toggle_left_pane = "h"
213186
214187
# Navigation (used in multiple modes)
@@ -230,7 +203,6 @@ scroll_right = "right"
230203
new_prompt = "n"
231204
new_global_prompt = "N"
232205
edit_prompt = "e"
233-
refine_prompt = "r"
234206
delete_prompt = "ctrl+d"
235207
yank_prompt = "y"
236208
inject_method = "i"
@@ -246,12 +218,6 @@ refresh = "r"
246218
# Plan mode
247219
generate_plan = "G"
248220
edit_plan = "e"
249-
250-
# Chat mode
251-
send_chat = "enter"
252-
close_chat = "esc"
253-
kill_chat = "ctrl+c"
254-
clear_chat = "ctrl+l"
255221
`
256222

257223
return os.WriteFile(Path(), []byte(defaultConfig), 0644)

internal/e2e/e2e_test.go

Lines changed: 0 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -564,32 +564,6 @@ func TestEmptyState(t *testing.T) {
564564
}
565565
}
566566

567-
// TestChatMode verifies chat mode functionality
568-
func TestChatMode(t *testing.T) {
569-
m := model.New("/tmp/test.sock")
570-
cfg := config.DefaultConfig()
571-
572-
// Initialize with window size
573-
updated, _ := m.Update(tea.WindowSizeMsg{Width: 100, Height: 40})
574-
m = updated.(model.Model)
575-
576-
// Chat should not be active initially
577-
// NOTE: Chat feature is not currently implemented, skipping these checks
578-
// Open chat using toggle chat key
579-
// Note: Chat may fail to start in test environment due to missing dependencies
580-
// The test verifies that the key is handled and UI doesn't crash
581-
updated, _ = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(cfg.Keys.ToggleChat)})
582-
m = updated.(model.Model)
583-
584-
// View should remain renderable even if chat startup fails
585-
view := m.View()
586-
if view == "" {
587-
t.Error("expected non-empty view after chat toggle")
588-
}
589-
590-
// NOTE: Skipping chat state tests since ChatActive() is not implemented
591-
}
592-
593567
// TestLeaderKeyMode verifies leader key functionality
594568
func TestLeaderKeyMode(t *testing.T) {
595569
m := model.New("/tmp/test.sock")
@@ -709,99 +683,6 @@ func TestPlanModeNavigation(t *testing.T) {
709683
}
710684
}
711685

712-
// TestChatPanelWithTeatest uses teatest to simulate an interactive TTY session
713-
// This test validates the chat panel UI with proper TTY simulation
714-
func TestChatPanelWithTeatest(t *testing.T) {
715-
// Create a model with a mock socket path
716-
m := model.New("/tmp/test.sock")
717-
718-
// Create teatest environment with fixed terminal size
719-
tm := teatest.NewTestModel(t, m,
720-
teatest.WithInitialTermSize(100, 40),
721-
)
722-
723-
// Wait for initial output (should show the TUI)
724-
teatest.WaitFor(t, tm.Output(), func(bts []byte) bool {
725-
return len(bts) > 0 && bytes.Contains(bts, []byte("/"))
726-
}, teatest.WithCheckInterval(time.Millisecond*100), teatest.WithDuration(time.Second*2))
727-
728-
// Send 'c' key to open chat panel
729-
cfg := config.DefaultConfig()
730-
tm.Send(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(cfg.Keys.ToggleChat)})
731-
732-
// Wait for chat panel indicators in output
733-
teatest.WaitFor(t, tm.Output(), func(bts []byte) bool {
734-
// Look for chat-related UI elements
735-
return bytes.Contains(bts, []byte("Chat")) ||
736-
bytes.Contains(bts, []byte("chat")) ||
737-
bytes.Contains(bts, []byte("Send"))
738-
}, teatest.WithCheckInterval(time.Millisecond*100), teatest.WithDuration(time.Second*1))
739-
740-
// Send escape to close chat
741-
tm.Send(tea.KeyMsg{Type: tea.KeyEsc})
742-
743-
// Wait a bit for the close to take effect
744-
time.Sleep(time.Millisecond * 100)
745-
746-
// Send 'q' to quit the program
747-
tm.Send(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'q'}})
748-
749-
// Wait for program to finish
750-
tm.WaitFinished(t, teatest.WithFinalTimeout(time.Second*2))
751-
752-
// Get final model and assert chat is closed
753-
fm := tm.FinalModel(t)
754-
finalModel, ok := fm.(model.Model)
755-
if !ok {
756-
t.Fatalf("final model is not model.Model: %T", fm)
757-
}
758-
759-
// After closing chat, the model should still be valid
760-
_ = finalModel
761-
}
762-
763-
// TestChatInputWithTeatest tests typing in the chat input field via TTY simulation
764-
func TestChatInputWithTeatest(t *testing.T) {
765-
m := model.New("/tmp/test.sock")
766-
cfg := config.DefaultConfig()
767-
768-
tm := teatest.NewTestModel(t, m,
769-
teatest.WithInitialTermSize(100, 40),
770-
)
771-
772-
// Wait for initial render
773-
teatest.WaitFor(t, tm.Output(), func(bts []byte) bool {
774-
return len(bts) > 0
775-
}, teatest.WithCheckInterval(time.Millisecond*100), teatest.WithDuration(time.Second*1))
776-
777-
// Open chat (may fail in test environment due to missing dependencies)
778-
tm.Send(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(cfg.Keys.ToggleChat)})
779-
time.Sleep(time.Millisecond * 50)
780-
781-
// Type some text
782-
testInput := "hello"
783-
for _, r := range testInput {
784-
tm.Send(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{r}})
785-
}
786-
787-
// Try to wait for output to reflect the input
788-
// If chat didn't start (due to missing dependencies), we'll just close after a delay
789-
time.Sleep(time.Millisecond * 200)
790-
791-
// Close chat (if it started)
792-
tm.Send(tea.KeyMsg{Type: tea.KeyEsc})
793-
794-
// Send 'q' to quit the program
795-
tm.Send(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'q'}})
796-
797-
// Wait for program to finish
798-
tm.WaitFinished(t, teatest.WithFinalTimeout(time.Second*2))
799-
800-
// Get final model state
801-
fm := tm.FinalModel(t)
802-
_ = fm.(model.Model)
803-
}
804-
805686
// TestLeaderKeyWithTeatest tests leader key mode with TTY simulation
806687
func TestLeaderKeyWithTeatest(t *testing.T) {
807688
m := model.New("/tmp/test.sock")
@@ -889,30 +770,3 @@ func TestLeaderKeyTimeout(t *testing.T) {
889770
t.Error("expected non-empty view after leader timeout")
890771
}
891772
}
892-
893-
// TestChatInput verifies chat input field works
894-
func TestChatInput(t *testing.T) {
895-
m := model.New("/tmp/test.sock")
896-
cfg := config.DefaultConfig()
897-
898-
// Initialize with window size
899-
updated, _ := m.Update(tea.WindowSizeMsg{Width: 100, Height: 40})
900-
m = updated.(model.Model)
901-
902-
// Open chat
903-
updated, _ = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(cfg.Keys.ToggleChat)})
904-
m = updated.(model.Model)
905-
906-
// Type some text
907-
testInput := "hello world"
908-
for _, r := range testInput {
909-
updated, _ = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{r}})
910-
m = updated.(model.Model)
911-
}
912-
913-
// View should still render
914-
view := m.View()
915-
if view == "" {
916-
t.Error("expected non-empty view after typing in chat")
917-
}
918-
}

0 commit comments

Comments
 (0)