refactor: correct README and if/else to max
Maxwell Jensen 85795372+maxwelljens@users.noreply.github.com
Thu, 16 Apr 2026 20:09:32 +0200
2 files changed,
16 insertions(+),
17 deletions(-)
M
README.md
→
README.md
@@ -77,19 +77,18 @@ ## Project Structure
``` . -├── cmd/bibel.go # Main CLI entry point +├── cmd/bibel.go # Main CLI entry point ├── internal/ -│ ├── bible/ # Core Bible functionality -│ │ ├── verse.go # Data structures -│ │ ├── loader.go # JSON loading and indexing -│ │ ├── dateprogression.go # Date-based position calculation -│ │ └── formatter.go # Output formatting -│ └── tui/ # Terminal User Interface -│ └── model.go # bubbletea TUI model and styling -├── books/pol_nbg.json # Bible data -├── go.mod # Go module dependencies -├── go.sum # Go dependency checksums -└── old_code.ml # Original OCaml implementation +│ ├── bible/ # Core Bible functionality +│ ├── verse.go # Data structures +│ ├── loader.go # JSON loading and indexing +│ ├── dateprogression.go # Date-based position calculation +│ ├── formatter.go # Output formatting +│ └── tui/ # Terminal User Interface +│ └── model.go # bubbletea TUI model and styling +├── books/pol_nbg.json # Bible data +├── go.mod # Go module dependencies +└── go.sum # Go dependency checksums ``` ## Examples
M
internal/tui/model.go
→
internal/tui/model.go
@@ -143,10 +143,11 @@ // Box has: Padding(1, 2) = 2 left + 2 right = 4
// Border = 1 left + 1 right = 2 // Total horizontal frame = 6 // Use window width with some margin - availableWidth := m.width - 10 // Leave some terminal margin - if availableWidth < 30 { - availableWidth = 30 // Minimum reasonable width - } + availableWidth := max( + // Leave some terminal margin + m.width-10, + // Minimum reasonable width + 30) contentWidth := availableWidth - 6 // Account for box frame // Apply width constraint for text wrapping@@ -194,4 +195,3 @@ }
return result.String() } -