feat: add tip rotation system with version-update and tip widgets#287
Open
Avimarzan wants to merge 1 commit intosirmalloc:mainfrom
Open
feat: add tip rotation system with version-update and tip widgets#287Avimarzan wants to merge 1 commit intosirmalloc:mainfrom
Avimarzan wants to merge 1 commit intosirmalloc:mainfrom
Conversation
Adds a tip rotation system that generates tips from Claude Code changelogs. Includes two new widgets (version-update, tip), core utility module with caching and async tip generation, Zod schemas, v3→v4 settings migration, hook handler integration, TUI config screen, and shared test helpers (44 tests). Review fixes applied: hideWhenEmpty placeholder (F-1), empty previousVersion guard (F-2), cached tip pool with write-only-on-rotation (F-3), deduplicated semver sort (F-4), async execFile (F-5), path.join (F-6), pre-release semver handling (F-7), ESM imports (F-8), deduplicated defaults (F-11), useState for TUI file reads (F-12), extracted test helpers (F-13), response body drain (F-14). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Adds a tip rotation system that surfaces useful tips from Claude Code changelogs directly in the status line. Includes:
version-update— showsUpdated: vX.Y.Z → vA.B.Cfrom the latest non-expired tip filetip— shows a rotating tip from the merged pool of all non-expired tip files (💡 emoji prefix, sequential rotation)src/utils/tips.ts):claude --printwith<TIPS>marker extractionTipsSettingsSchema):enabled,tipDir,rotateEvery,expiryDays,maxTipLength,minTips— all with sensible defaultsTipsMenu):handleHook()checks for version changes and triggers tip generation whentips.enabledis trueNew files
src/widgets/Tip.tshideWhenEmptytogglesrc/widgets/VersionUpdate.tssrc/utils/tips.tssrc/types/TipData.tssrc/tui/components/TipsMenu.tsxsrc/test-helpers/tips.tsModified files
src/types/Settings.tsTipsSettingsSchema, bumped version 3→4src/utils/migrations.tssrc/utils/widget-manifest.tsversion-updateandtipwidgetssrc/widgets/index.tssrc/tui/App.tsxsrc/tui/components/MainMenu.tsxsrc/tui/components/index.tssrc/ccstatusline.tsTest coverage
44 tests across 3 test files, all passing:
src/utils/__tests__/tips.test.ts— 27 tests (storage, rotation, semver, pool, expiry, pipeline)src/widgets/__tests__/Tip.test.ts— 8 tests (rendering, hideWhenEmpty, preview, raw mode)src/widgets/__tests__/VersionUpdate.test.ts— 9 tests (rendering, empty version guard, semver ordering, expiry)Design decisions
promisify(execFile)to avoid blocking the event loop in the TUITest plan
bun testpasses (44 tip tests + existing suite)tipandversion-updatewidgets via TUI, confirm they render🤖 Generated with Claude Code