Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ea92bf5
feat(ui): add ShortType and ShortStatus helpers
sotte Dec 28, 2025
8541a8f
feat(ui): use compact single-char type/status in list
sotte Dec 28, 2025
18a2c05
feat(tui): add previewModel for read-only detail preview
sotte Dec 28, 2025
e7c6ba4
feat(tui): add two-column width threshold constants
sotte Dec 28, 2025
fe1271b
feat(tui): add preview field to App struct
sotte Dec 28, 2025
16abbc8
feat(tui): implement two-column view rendering
sotte Dec 28, 2025
f255bdb
feat(tui): add cursor sync for two-column preview
sotte Dec 28, 2025
4f0c64f
fix(tui): add two-column polish and edge cases
sotte Dec 28, 2025
dc553ba
chore: mark two-column TUI tasks completed
sotte Dec 28, 2025
3bba3c0
fix(tui): two-column layout polish and edge cases
sotte Dec 28, 2025
23d07eb
fix(tui): preserve bottom border when preview content wraps
sotte Dec 28, 2025
ac276d6
feat(tui): responsive type/status column expansion
sotte Dec 29, 2025
43edd2f
chore: mark beans-vn93 completed
sotte Dec 29, 2025
c4f6332
docs(beans-pn6z): design for unified detail view
sotte Dec 30, 2025
42ab25e
docs(beans-pn6z): complete design for unified detail view
sotte Dec 30, 2025
328cf95
docs(beans-pn6z): add design rationale section
sotte Dec 30, 2025
d17565f
plan(beans-pn6z): add implementation tasks for unified detail view
sotte Dec 30, 2025
5e90481
plan(beans-pn6z): add Task 4b for message handlers
sotte Dec 30, 2025
0358c5e
plan(beans-pn6z): improve task clarity and consolidation
sotte Dec 30, 2025
ccd4cc1
refactor(tui): replace viewList/viewDetail with granular focus states
sotte Dec 30, 2025
05df142
refactor(tui): remove preview.go, use detailModel in right pane
sotte Dec 30, 2025
0b01014
test(tui): remove preview_test.go for deleted preview model
sotte Dec 30, 2025
8268247
feat(tui): add focus parameter to list border rendering
sotte Dec 30, 2025
c316a6c
refactor(tui): detail accepts focus params, remove linksActive
sotte Dec 30, 2025
4912f74
fix(tui): update message handlers for detailModel
sotte Dec 30, 2025
4b49820
feat(tui): route keyboard events based on granular focus states
sotte Dec 30, 2025
6ceafcd
feat(tui): two-column view with focus-based borders and footers
sotte Dec 30, 2025
6107826
feat(tui): update history navigation for unified view
sotte Dec 30, 2025
bf74c43
refactor(tui): simplify detail.go, only q quits
sotte Dec 30, 2025
00e30ab
fix(tui): preserve focus state and dimensions after mutations
sotte Dec 30, 2025
c3b11f0
fix(tui): correct width and height calculations for two-column layout
sotte Dec 30, 2025
8239d09
chore(tui): remove debug logging code
sotte Dec 30, 2025
5cccc65
refactor(tui): extract borderSize constant
sotte Dec 30, 2025
b0c2914
fix(tui): use full width for linked beans titles
sotte Dec 30, 2025
33b6867
feat(tui): split backspace and escape behavior in detail view
sotte Dec 30, 2025
a99f9e2
fix(tui): disable escape-to-quit in main list
sotte Dec 30, 2025
7dbce59
fix(tui): navigate to linked bean on Enter in detail view
sotte Dec 30, 2025
ac2ea70
docs(tui): update beans-pn6z design doc to match implementation
sotte Dec 30, 2025
93b45a9
chore(beans): update bean status and add new beans
sotte Dec 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .beans/beans-238n--task-2-delete-previewgo-and-update-app-struct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
# beans-238n
title: 'Task 2: Delete preview.go and update App struct'
status: completed
type: task
priority: normal
created_at: 2025-12-30T16:35:44Z
updated_at: 2025-12-30T17:10:38Z
parent: beans-pn6z
---

## Overview

Remove the preview model since we will use detailModel in the right pane.

## Files

- Delete: `internal/tui/preview.go`
- Modify: `internal/tui/tui.go:98-128` (App struct)

## Steps

### Step 1: Delete preview.go

```bash
rm internal/tui/preview.go
```

### Step 2: Remove preview field from App struct

In `tui.go`, remove from App struct:
```go
// Remove this line:
preview previewModel
```

### Step 3: Remove preview initialization in New()

Remove:
```go
preview: newPreviewModel(nil, 0, 0),
```

### Step 4: Comment out preview-related code temporarily

Comment out these specific blocks (will be replaced in Task 5 - beans-s65d):

**In `tea.WindowSizeMsg` handler (~line 162-167):**
```go
// Comment out:
// if a.isTwoColumnMode() {
// _, rightWidth := calculatePaneWidths(a.width)
// a.preview.width = rightWidth
// a.preview.height = a.height - 2
// }
```

**In `cursorChangedMsg` handler (~line 220-231):**
```go
// Comment out entire case:
// case cursorChangedMsg:
// _, rightWidth := calculatePaneWidths(a.width)
// if msg.beanID != "" {
// bean, err := a.resolver.Query().Bean(context.Background(), msg.beanID)
// if err == nil && bean != nil {
// a.preview = newPreviewModel(bean, rightWidth, a.height-2)
// }
// } else {
// a.preview = newPreviewModel(nil, rightWidth, a.height-2)
// }
// return a, nil
```

**In `beansLoadedMsg` handler (~line 237-242):**
```go
// Comment out preview update (keep the list update):
// _, rightWidth := calculatePaneWidths(a.width)
// if len(msg.items) == 0 {
// a.preview = newPreviewModel(nil, rightWidth, a.height-2)
// } else if item, ok := a.list.list.SelectedItem().(beanItem); ok {
// a.preview = newPreviewModel(item.bean, rightWidth, a.height-2)
// }
```

**In `renderTwoColumnView()` (~line 641-644):**
```go
// Comment out preview rendering:
// a.preview.width = rightWidth
// a.preview.height = contentHeight
// rightPane := a.preview.View()

// Temporarily replace with placeholder:
rightPane := "Detail placeholder"
```

### Step 5: Build and verify

Run: `mise build`
Expected: Build succeeds (commented code will be replaced later)

### Step 6: Commit

```bash
git add -A
git commit -m "refactor(tui): remove preview.go, use detailModel in right pane

- Delete preview.go (no longer needed)
- Remove preview field from App struct
- Comment out preview references (will be replaced with detail)

Refs: beans-pn6z"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
# beans-2v6j
title: 'Task 3: Add focus parameter to list border rendering'
status: completed
type: task
priority: normal
created_at: 2025-12-30T16:36:00Z
updated_at: 2025-12-30T17:18:32Z
parent: beans-pn6z
---

## Overview

Update list.go to accept a focus parameter that controls border color.

## Files

- Modify: `internal/tui/list.go:504-514` (viewContent method)
- Modify: `internal/tui/list.go:582-603` (ViewConstrained method)

## Steps

### Step 1: Add focused parameter to viewContent

Update the `viewContent` method signature and implementation:

```go
// viewContent renders just the bordered list without footer.
// innerHeight is the content height inside the border (not including border lines).
// focused determines the border color (primary when focused, muted when not).
func (m listModel) viewContent(innerHeight int, focused bool) string {
borderColor := ui.ColorMuted
if focused {
borderColor = ui.ColorPrimary
}
border := lipgloss.NewStyle().
Border(lipgloss.RoundedBorder()).
BorderForeground(borderColor).
Width(m.width - 2).
Height(innerHeight)

return border.Render(m.list.View())
}
```

### Step 2: Update View() to pass focused=true

In `View()`, update the call:
```go
return m.viewContent(m.height-4, true) + "\n" + m.Footer()
```

### Step 3: Add focused parameter to ViewConstrained

Update signature:
```go
func (m listModel) ViewConstrained(width, height int, focused bool) string {
```

Update the return:
```go
return m.viewContent(innerHeight, focused)
```

### Step 4: Update call site in tui.go

In `renderTwoColumnView()`, update the call (will be refactored more later):
```go
leftPane := a.list.ViewConstrained(leftWidth, contentHeight, true) // TODO: pass actual focus state
```

### Step 5: Build and verify

Run: `mise build`
Expected: Build succeeds

### Step 6: Commit

```bash
git add internal/tui/list.go internal/tui/tui.go
git commit -m "feat(tui): add focus parameter to list border rendering

Border color changes based on focus state:
- Primary (cyan) when focused
- Muted (gray) when not focused

Refs: beans-pn6z"
```
12 changes: 12 additions & 0 deletions .beans/beans-3f64--phase-1-compact-list-format.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# beans-3f64
title: 'Phase 1: Compact list format'
status: completed
type: task
priority: normal
created_at: 2025-12-28T17:38:41Z
updated_at: 2025-12-28T18:44:44Z
parent: beans-t0tv
---

Add single-character type and status codes to make the list more compact. Prerequisite for two-column layout.
12 changes: 12 additions & 0 deletions .beans/beans-41ly--phase-3-two-column-layout-composition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# beans-41ly
title: 'Phase 3: Two-column layout composition'
status: completed
type: task
priority: normal
created_at: 2025-12-28T17:38:52Z
updated_at: 2025-12-28T18:56:24Z
parent: beans-t0tv
---

Wire up the two-column layout in the main App with responsive width detection.
12 changes: 12 additions & 0 deletions .beans/beans-433o--phase-2-detail-preview-component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# beans-433o
title: 'Phase 2: Detail preview component'
status: completed
type: task
priority: normal
created_at: 2025-12-28T17:38:51Z
updated_at: 2025-12-28T18:49:10Z
parent: beans-t0tv
---

Create a lightweight, read-only detail preview that can be rendered in the right pane.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# beans-65cw
title: Use short view for status/type in linked beans component
status: completed
type: bug
priority: normal
created_at: 2025-12-30T18:40:02Z
updated_at: 2025-12-30T18:42:28Z
parent: beans-pn6z
---

The linked bean view contains line breaks because each line (linked bean) is too long. Use the short view for state and type to make it more compact.
51 changes: 51 additions & 0 deletions .beans/beans-6ljm--fix-linked-beans-overflow-breaking-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# beans-6ljm
title: Fix linked beans overflow breaking layout
status: completed
type: bug
priority: normal
created_at: 2025-12-30T18:40:03Z
updated_at: 2025-12-30T21:34:12Z
parent: beans-pn6z
---

When a bean has many linked beans, the view completely breaks - linked beans text overflows and wraps incorrectly, causing garbled display where list and detail panes overlap visually. Need to properly truncate or scroll the linked beans section.

## Related fixes completed

- **beans-65cw**: Changed `UseFullNames: false` in linked beans to use short type/status (single char) instead of full names. This fixed the overflow where lines were too long.
- **beans-e2gi**: Used `strings.TrimRight(m.linkList.View(), "\n ")` to remove empty trailing lines from the bubbles list. This worked but caused height calculation mismatches.

## Bubbles list component research

The `list.New(items, delegate, width, height)` height parameter is the **TOTAL height** for the entire component. The component internally divides this among:

1. **Title bar** (1 line) - if `showTitle` is true (default: true)
2. **Status bar** - if `showStatusBar` is true (default: true)
3. **Pagination** (1 line for dots) - if `showPagination` is true (default: true)
4. **Help** - if `showHelp` is true (default: true)
5. **Items** - remaining space, calculated as: `availHeight / (delegate.Height() + delegate.Spacing())`

### Key insight

The height you give is NOT "number of items + title". It's the total pixel/line budget. The component subtracts space for title, pagination, etc., and gives the rest to items.

### Correct height calculation

```go
// For showing up to N items:
height := 1 // title
height += numItemsToShow // items (delegate.Height()=1 each)
if totalItems > numItemsToShow {
height++ // pagination dots
}
// Don't add +1 for title again - it's already counted!
```

### Current issue (still not working)

The body viewport height calculation doesn't match what's actually rendered. The `calculateHeaderHeight()` tries to predict the height of header + links section, but there's still a mismatch causing the body to be too short.

## Potential simplification

Consider rendering linked beans manually without the bubbles list component. This gives full control over height and removes the complexity of predicting bubbles' internal layout calculations.
12 changes: 12 additions & 0 deletions .beans/beans-6x50--phase-5-integration-and-polish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# beans-6x50
title: 'Phase 5: Integration and polish'
status: completed
type: task
priority: normal
created_at: 2025-12-28T17:38:53Z
updated_at: 2025-12-28T19:04:41Z
parent: beans-t0tv
---

Final integration, help overlay updates, edge case handling, and testing.
Loading