feat(tui): context-aware jot target (batch 1/3) - #17
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
startJot now resolves the jot target based on current screen/selection. doJot appends to the targeted entry instead of always querying for the daily entry. Existing tests updated to set dailyEntry for the today screen. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consistent with Bubble Tea convention — read-only methods use value receivers. Addresses Gavel finding about receiver type inconsistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Runs gavel analyze on the current branch diff against main, triages findings, and fixes genuine issues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Filter the PR diff to *.go files so Gavel doesn't analyze markdown docs and instruction files as code. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| // Append to existing daily entry (oldest) | ||
| daily := entries[len(entries)-1] | ||
| if m.jotTarget != nil { | ||
| // Append to the targeted entry |
Check failure
Code scanning / gavel
Detect critical bugs, logic errors, and potential runtime failures Error
Comment on lines
+942
to
+962
| func (m pickerModel) resolveJotTarget() *entry.Entry { | ||
| switch m.screen { | ||
| case screenToday: | ||
| if m.todayFocus == focusEntryList { | ||
| if item, ok := m.todayList.SelectedItem().(entryItem); ok { | ||
| e := item.entry | ||
| return &e | ||
| } | ||
| } | ||
| return m.dailyEntry | ||
| case screenDayDetail: | ||
| if item, ok := m.dayList.SelectedItem().(entryItem); ok { | ||
| e := item.entry | ||
| return &e | ||
| } | ||
| return nil | ||
| case screenEntryDetail: | ||
| return &m.entry | ||
| default: | ||
| return nil | ||
| } |
Check warning
Code scanning / gavel
Assess test quality, coverage gaps, and testing best practices Warning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
resolveJotTarget()method that determines which entry to jot into based on the current screen and selection statestartJot()and refactorsdoJot()to use the resolved target instead of always querying for the daily entry/gavelslash command for running code analysis on branch diffsThis is batch 1 of 3 for the context-aware jot feature (design doc). Remaining batches:
Jot target resolution
Test plan
resolveJotTargetunit tests for all 5 screen states (6 tests)internal/uitest suite: 68 tests passing🤖 Generated with Claude Code