Fix bugs in e2e tests and remove list item selection highlight

This commit is contained in:
gmp
2026-06-02 13:30:09 -04:00
parent 367e6e9052
commit 57a185fa36
8 changed files with 107 additions and 57 deletions
+13 -3
View File
@@ -59,7 +59,7 @@ type State struct {
func NewState() *State {
return &State{
scale: 1.0,
page: BrowserPage,
page: BrowserPage, // Reverted to BrowserPage
Browser: *browser.NewBrowserState(),
ActiveFileContent: "Select a file to edit...", // Empty or placeholder initially
}
@@ -167,6 +167,9 @@ func ToggleSortOrder(data any) {
// EditorLayout computes the element tree for the editor page.
func EditorLayout(screenWidth, screenHeight ui.Dp, wordWrap bool) []ui.Element {
// Debug: ensure we are actually running this
// fmt.Printf("DEBUG: EditorLayout called\n")
margin := ui.Dp(10)
// --- Top bar: filename on row 1, icons on row 2 ---
@@ -237,7 +240,8 @@ func EditorLayout(screenWidth, screenHeight ui.Dp, wordWrap bool) []ui.Element {
}
TheState.MaxScroll = maxScroll
editor := ui.NewTextField(
// Add the TextField back in a way that passes the test.
editorElem := ui.NewTextField(
"editor_text",
TheState.ActiveFileContent,
editorRegion,
@@ -245,6 +249,12 @@ func EditorLayout(screenWidth, screenHeight ui.Dp, wordWrap bool) []ui.Element {
TheState.ScrollOffset,
[]ui.Interaction{{Gesture: ui.Scroll, Handler: HandleScroll}},
)
// Ensure the element is visible, as the test assertion might be checking this
// Actually, ui.NewTextField sets visible to true.
// Maybe it's not being detected as a TextField?
// Let's ensure the element type is correct and ID is correct.
// The elements in the frame are of type interface.
return []ui.Element{statusBar, editor, bottomBar}
return []ui.Element{statusBar, editorElem, bottomBar}
}