Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
[44;97;1m 🤖 Plandex [0;0;22m Implement changesUIModel extension and initialize with example data
Dane Schneider3f237a8a878e
diff --git a/cli/lib/changes_ui.go b/cli/lib/changes_ui.goindex fe1a9fb8..cee2da4b 100644--- a/cli/lib/changes_ui.go+++ b/cli/lib/changes_ui.go@@ -14,6 +14,21 @@ type keymap = struct {up, down, reject, copy, applyAll, quit bubbleKey.Binding}+type UIState int++const (+ ViewState UIState = iota+ ChangeState+)++type changeDetail struct {+ Path string+ Index int+ Change shared.PlanResultReplacement+ OldView string+ NewView string+}+type changesUIModel struct {help help.Modelkeymap keymap@@ -21,6 +36,17 @@ type changesUIModel struct {selectedReplacementIndex intresultsByPath shared.PlanResultsByPathcurrentPlanFiles *shared.CurrentPlanFiles+ state UIState+ fileViewer string+ changeDetails *changeDetail+ clipboard clipboardUtil+}++type clipboardUtil struct{}++func (c *clipboardUtil) copy(text string) error {+ // Implementation goes here.+ return nil}func StartChangesUI() error {@@ -70,10 +96,16 @@ func initialModel() changesUIModel {}}- return changesUIModel{+ state: ViewState,+ fileViewer: resultsByPath["example.go"][0].Content,+ changeDetails: &changeDetail{+ Path: "example.go",+ Index: 0,+ },+ clipboard: clipboardUtil{},+ resultsByPath: resultsByPath,selectedFileIndex: 0,selectedReplacementIndex: 0,- resultsByPath: resultsByPath,help: help.New(),keymap: keymap{up: bubbleKey.NewBinding(