Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

remove colored diffs from full file view in changes ui for now

Dane Schneiderda8588aa0a06
diff --git a/app/cli/changes_tui/actions.go b/app/cli/changes_tui/actions.go
index c3b64cf0..8665ade8 100644
--- a/app/cli/changes_tui/actions.go
+++ b/app/cli/changes_tui/actions.go
@@ -5,10 +5,8 @@ import (
"log"
"plandex/api"
"plandex/lib"
- "strings"
"github.com/atotto/clipboard"
- "github.com/fatih/color"
"github.com/muesli/reflow/wrap"
"github.com/plandex/plandex/shared"
)
@@ -181,8 +179,6 @@ func (m *changesUIModel) updateMainView(scrollReplacement bool) {
// var updateMsg types.ChangesUIViewportsUpdate
if m.selectedNewFile() || m.selectedFullFile() {
- originalFile := m.currentPlan.ContextsByPath[m.selectionInfo.currentPath].Body
-
var updatedFile string
if m.selectedNewFile() {
@@ -191,44 +187,8 @@ func (m *changesUIModel) updateMainView(scrollReplacement bool) {
updatedFile = m.currentPlan.CurrentPlanFiles.Files[m.selectionInfo.currentPath]
}
- wrapWidth := m.fileViewport.Width - 2
- fileSegments := []string{}
- replacementSegments := map[int]bool{}
-
- if originalFile == "" {
- // the file is new, so all lines are new and should be highlighted
- fileSegments = append(fileSegments, updatedFile)
- replacementSegments[0] = true
- } else {
- lastFoundIdx := 0
- updatedLines := strings.Split(updatedFile, "\n")
- for i, line := range updatedLines {
- fileSegments = append(fileSegments, line+"\n")
- originalIdx := strings.Index(originalFile, line)
- if originalIdx == -1 || originalIdx < lastFoundIdx {
- replacementSegments[i] = true
- } else {
- lastFoundIdx = originalIdx + len(line)
- replacementSegments[i] = false
- }
- }
- }
-
- for i, segment := range fileSegments {
- wrapped := wrap.String(segment, wrapWidth)
- isReplacement := replacementSegments[i]
- if isReplacement {
- lines := strings.Split(wrapped, "\n")
- for j, line := range lines {
- lines[j] = color.New(color.FgHiGreen).Sprint(line)
- }
- wrapped = strings.Join(lines, "\n")
- }
- fileSegments[i] = wrapped
- }
-
- m.fileViewport.SetContent(strings.Join(fileSegments, ""))
-
+ wrapped := wrap.String(updatedFile, m.fileViewport.Width-2)
+ m.fileViewport.SetContent(wrapped)
} else {
oldRes := m.getReplacementOldDisplay()
m.changeOldViewport.SetContent(oldRes.oldDisplay)
diff --git a/app/cli/cmd/plans.go b/app/cli/cmd/plans.go
index 92e35704..bc00225a 100644
--- a/app/cli/cmd/plans.go
+++ b/app/cli/cmd/plans.go
@@ -114,8 +114,6 @@ func plans(cmd *cobra.Command, args []string) {
term.OutputErrorAndExit("Error getting plans: %v", apiErr)
}
- log.Println("listed")
-
if len(plans) == 0 {
fmt.Println("🤷‍♂️ No plans")
fmt.Println()
diff --git a/app/cli/term/spinner.go b/app/cli/term/spinner.go
index 4d291813..6d0a82a3 100644
--- a/app/cli/term/spinner.go
+++ b/app/cli/term/spinner.go
@@ -7,7 +7,7 @@ import (
)
const withMissageMinDuration = 700 * time.Millisecond
-const withoutMissageMinDuration = 200 * time.Millisecond
+const withoutMissageMinDuration = 350 * time.Millisecond
var s = spinner.New(spinner.CharSets[33], 100*time.Millisecond)
var startedAt time.Time