Skip to content

feat: chat docked as the homepage command bar + suggested prompts (Catalog HQ 3/3, chat#1850)#1854

Open
sweetmantech wants to merge 1 commit into
feat/home-tasks-modulefrom
feat/home-command-bar
Open

feat: chat docked as the homepage command bar + suggested prompts (Catalog HQ 3/3, chat#1850)#1854
sweetmantech wants to merge 1 commit into
feat/home-tasks-modulefrom
feat/home-command-bar

Conversation

@sweetmantech

@sweetmantech sweetmantech commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What this does

Third and final PR of the Catalog HQ homepage stack (#1850). Chat becomes the command bar:

  • The Catalog HQ modules (valuation hero + tasks module) now render inside the chat's empty state, with the existing chat input docked directly beneath them — artist context preserved, no transport changes, composed hooks only.
  • Up to 3 suggested prompt chips above the input, wired to whichever modules are visible: "Why did my valuation change?" (hero), "What did my last task run do?" (tasks module), "What should {artist} do this week?" — plus a "What's my catalog worth?" fallback when no valuation is shown. Chips prefill the input via the provider's existing 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.
  • Sending from the command bar opens the normal session-scoped chat (existing handleSendMessage + history.replaceState to 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).
  • Accounts with no visible modules keep the exact current centered greeting — modules is an optional prop, absent on every other Chat mount.
  • Cleanup: PR 1's hideGreeting prop 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 as main). eslint + prettier clean 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):

  1. feat: homepage valuation hero (Catalog HQ 1/3, chat#1850) #1852 feat/home-valuation-hero → base main
  2. feat: homepage tasks module — recent runs + one-click starter task (Catalog HQ 2/3, chat#1850) #1853 feat/home-tasks-module → base feat/home-valuation-hero
  3. this PR feat/home-command-bar → base feat/home-tasks-module

When #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

    • Modules render in the chat empty state with the input docked beneath; sending opens the normal session-scoped chat.
    • Up to 3 prompt chips above the input: “Why did my valuation change?”, “What did my last task run do?”, and “What should {artist} do this week?” with a “What’s my catalog worth?” fallback; chips prefill the input.
    • Modules hide once messages exist; returning to “/” shows the modules again. If no modules are visible, the centered greeting remains.
  • Refactors

    • Removed hideGreeting; added optional modules and suggestedPrompts props to NewChatBootstrap and Chat (existing mounts unchanged).
    • Added useHomeTasksModuleState, getHomeSuggestedPrompts, and SuggestedPromptChips; TasksModule now uses the composed hook. Added unit tests for prompt selection.

Written for commit efd97b8. Summary will update on new commits.

Review in cubic

@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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.

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview Jul 6, 2026 10:15pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • test

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3e378a19-b6af-48d6-93db-a9dfa8e58518

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/home-command-bar

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sweetmantech

Copy link
Copy Markdown
Collaborator Author

Preview verification (sha 4dfc77e, https://chat-git-feat-home-command-bar-recoup.vercel.app/):

  • Vercel preview build: SUCCESS (CodeRabbit also green).
  • Loaded the preview homepage signed out: with no modules visible the page renders exactly the current centered greeting + input ('Ask me about your roster'), zero console errors — confirming the docked layout is strictly additive and the no-modules path is untouched.
  • Not verified on preview: the authenticated docked state (modules on top, chips, input beneath) and the chip-prefill -> send -> normal-session flow, because I could not complete a Privy OTP login from this run. Chip contents/caps are unit-tested (getHomeSuggestedPrompts); the send path itself is the existing untouched transport. Recommend one manual authenticated pass on this preview before merge, together with the PR 1/2 authenticated checks.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 8 files

Confidence score: 4/5

  • In lib/home/getHomeSuggestedPrompts.ts, artistName is checked/interpolated before trimming, so whitespace-only input can slip through and generate visibly broken suggested prompt text for users; trim (or normalize) artistName before 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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@sweetmantech sweetmantech force-pushed the feat/home-tasks-module branch from 5eb9fc8 to c2d0e25 Compare July 6, 2026 21:52
@sweetmantech sweetmantech force-pushed the feat/home-command-bar branch from 4dfc77e to 29ad23f Compare July 6, 2026 21:52
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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>
@sweetmantech sweetmantech force-pushed the feat/home-tasks-module branch from c2d0e25 to 2874fed Compare July 6, 2026 22:13
@sweetmantech sweetmantech force-pushed the feat/home-command-bar branch from 29ad23f to efd97b8 Compare July 6, 2026 22:13
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant