Feature 48/notification toasting layer #105
No reviewers
Labels
No labels
bug
ci
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
performance
priority
P0
priority
P1
priority
P2
question
refactor
size
L
size
M
size
S
size
XL
size
XS
tests
trivial
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/paso!105
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature-48/notification-toasting-layer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
CONTRIBUTING.mdgo test ./... -race) locallygofmt -w .andgolangci-lint run ./...respectivelyREADME.mdif applicableSummary
New notifications

Informational Warning:
The snapshot tests have been changed.
Please add a screenshot showing what has been changed, and a description of why it was changed.
If you do not provide an explanation and screenshot in 3 days, this PR will be closed.
@TheNoeTrevino
Changed snapshot files (2 files)
internal/testing/snapshots/tui/testdata/notification_error.goldeninternal/testing/snapshots/tui/testdata/notification_warning.golden@ -97,6 +97,10 @@ func renderColumnWithTasksContent(availableHeight := height - columnOverheadmaxVisibleTasks := max(availableHeight/TaskCardHeight, 1)// Clamp scrollOffset to prevent slicing past the end of the task list.The clamp
min(scrollOffset, len(tasks))is off by one. WhenscrollOffset == len(tasks)andlen(tasks) > 0,tasks[scrollOffset:endIdx]is empty but the "▲ more above" indicator still renders (becausescrollOffset > 0), showing a misleading indicator with no tasks visible.CreatedAtis set here but never read anywhere in the codebase. Expiry is handled entirely by thetea.Ticktimer inaddNotification. This is dead code and should be removed from the struct.@ -165,8 +162,7 @@ func (m Model) handleNavigateLeft() (tea.Model, tea.Cmd) {Rapid key-repeat at a boundary (e.g., holding left arrow at column 0) now fires
addNotificationon every key event, spawning a newtea.Ticktimer each time and pushing duplicate notifications into the stack (capped at 3, then evicting). The previousClear()on each keypress made this idempotent. Consider deduplicating: skip adding if the top notification has the same message, or check before callingaddNotification.Review Summary
3 issues found.
1. Off-by-one in scroll clamp (column.go line 100)
min(scrollOffset, len(tasks)) permits scrollOffset == len(tasks), which renders an empty task area while still showing the scroll-up indicator. The bound should be max(len(tasks)-1, 0).
2. Duplicate notification spam on held keys (update_normal.go boundary guards)
All boundary navigation handlers now call addNotification on every keypress. Holding a key at a boundary fires repeated identical notifications and timers, cycling through the 3-notification cap with eviction. The old Clear() per-keypress prevented this. A dedup check (skip if top notification has the same message) would restore the correct behavior.
3. Dead CreatedAt field (notification_state.go)
Notification.CreatedAt is assigned but never read. Expiry is handled by the tea.Tick timer, making this field unused dead code.
Score: 7/10