feat: chat docked as the homepage command bar + suggested prompts (Catalog HQ 3/3, chat#1850)#1854
feat: chat docked as the homepage command bar + suggested prompts (Catalog HQ 3/3, chat#1850)#1854sweetmantech wants to merge 1 commit into
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview verification (sha 4dfc77e, https://chat-git-feat-home-command-bar-recoup.vercel.app/):
|
There was a problem hiding this comment.
1 issue found across 8 files
Confidence score: 4/5
- In
lib/home/getHomeSuggestedPrompts.ts,artistNameis checked/interpolated before trimming, so whitespace-only input can slip through and generate visibly broken suggested prompt text for users; trim (or normalize)artistNamebefore the truthiness check and interpolation before merging.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="lib/home/getHomeSuggestedPrompts.ts">
<violation number="1" location="lib/home/getHomeSuggestedPrompts.ts:50">
P2: `artistName` should be trimmed before truthiness checks and interpolation. A whitespace-only string (e.g. `" "`) is truthy in JavaScript, so it passes the `if (artistName)` gate and produces broken prompt copy like `"What should do this week?"`. Consider normalizing with `const trimmedArtistName = artistName.trim();` and using `trimmedArtistName` throughout the function for both the conditional and the interpolations.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| }); | ||
| } | ||
|
|
||
| if (artistName) { |
There was a problem hiding this comment.
P2: artistName should be trimmed before truthiness checks and interpolation. A whitespace-only string (e.g. " ") is truthy in JavaScript, so it passes the if (artistName) gate and produces broken prompt copy like "What should do this week?". Consider normalizing with const trimmedArtistName = artistName.trim(); and using trimmedArtistName throughout the function for both the conditional and the interpolations.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At lib/home/getHomeSuggestedPrompts.ts, line 50:
<comment>`artistName` should be trimmed before truthiness checks and interpolation. A whitespace-only string (e.g. `" "`) is truthy in JavaScript, so it passes the `if (artistName)` gate and produces broken prompt copy like `"What should do this week?"`. Consider normalizing with `const trimmedArtistName = artistName.trim();` and using `trimmedArtistName` throughout the function for both the conditional and the interpolations.</comment>
<file context>
@@ -0,0 +1,60 @@
+ });
+ }
+
+ if (artistName) {
+ prompts.push({
+ label: `What should ${artistName} do this week?`,
</file context>
5eb9fc8 to
c2d0e25
Compare
4dfc77e to
29ad23f
Compare
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
…ompts (chat#1850)
With the Catalog HQ modules as the hero, the chat input's job is
interrogating the data: the modules now render inside the chat's empty
state with the existing input docked beneath them, plus up to three
suggested prompt chips wired to the visible modules ('Why did my
valuation change?', 'What did my last task run do?'). Chips prefill the
input via the provider's setInput; sending goes through the untouched
send path, so the command bar opens the normal session-scoped chat and
the modules return as the landing state on /.
No transport changes; composed hooks only. Accounts with no modules keep
the exact centered greeting (the hideGreeting prop from the hero PR is
subsumed by this mechanism and removed).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
c2d0e25 to
2874fed
Compare
29ad23f to
efd97b8
Compare
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
What this does
Third and final PR of the Catalog HQ homepage stack (#1850). Chat becomes the command bar:
setInput(same mechanism as the?q=prefill from feat: prefill the input with the ?q= prompt while provisioning (chat#1848 follow-up) #1849); the send itself goes through the untouched send path.handleSendMessage+history.replaceStateto the canonical chat URL); once messages exist the modules give way to the normal message view, and returning to/renders the modules as the landing state again (the Done-when).modulesis an optional prop, absent on every otherChatmount.hideGreetingprop is subsumed by the docked-modules mechanism and removed (no dead props).Tests (TDD — confirmed RED before implementing)
5 new unit tests, full suite 114 passed (32 files):
lib/home/__tests__/getHomeSuggestedPrompts.test.ts— chips wired to visible modules, capped at 3, catalog-worth fallback, artist chip omitted without an artist, every chip carries a sendable prompt.pnpm exec tsc --noEmit: no new errors (same two pre-existing failures asmain).eslint+prettierclean on changed files.Screenshots
N/A in the body — preview verification results go in a PR comment.
Stack
Part of a 3-PR stack for chat#1850 (merge in order, each PR only after its base):
feat/home-valuation-hero→ basemainfeat/home-tasks-module→ basefeat/home-valuation-herofeat/home-command-bar→ basefeat/home-tasks-moduleWhen #1853 merges, this PR gets re-targeted accordingly.
Tracked in #1850.
🤖 Generated with Claude Code
Summary by cubic
Chat is now the homepage command bar: the valuation hero and tasks module render above the chat input, with up to three suggested prompts tied to what’s visible. Final step of the Catalog HQ homepage work (chat#1850).
New Features
Refactors
hideGreeting; added optionalmodulesandsuggestedPromptsprops toNewChatBootstrapandChat(existing mounts unchanged).useHomeTasksModuleState,getHomeSuggestedPrompts, andSuggestedPromptChips;TasksModulenow uses the composed hook. Added unit tests for prompt selection.Written for commit efd97b8. Summary will update on new commits.