Skip to content

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

Merged
sweetmantech merged 1 commit into
mainfrom
feat/home-command-bar
Jul 7, 2026
Merged

feat: chat docked as the homepage command bar + suggested prompts (Catalog HQ 3/3, chat#1850)#1854
sweetmantech merged 1 commit into
mainfrom
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 in the empty state above the input, with suggested prompt chips that prefill the input. Final step of the Catalog HQ homepage work (chat#1850).

  • New Features

    • Unified empty state: valuation hero, tasks module, and up to 3 prompt chips render above the docked input; each self-hides; accounts with no modules keep the centered greeting.
    • Chips: valuation change, last task run, weekly advice; “What’s my catalog worth?” when no valuation is shown; clicking pre-fills the input; sending opens the normal session-scoped chat; returning to “/” shows the modules again.
  • Refactors

    • Removed the modules prop; modules now live inside ChatGreeting.
    • Added HomeSuggestedPrompts inside ChatGreeting (self-contained, no new props), plus useHomeTasksModuleState and getHomeSuggestedPrompts; other chat mounts and NewChatBootstrap are unchanged.
    • Added unit tests for prompt selection.

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

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added homepage suggested prompt chips in the chat area, giving users quick one-click starter prompts.
    • Prompt chips now appear in both main home states, including alongside task content and under the introductory chat text.
    • The home tasks area now uses a more streamlined loading and display flow, improving consistency across states.
  • Bug Fixes

    • Improved when suggested prompts are shown so they better match the current home context and available content.

@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 7, 2026 9:08pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new HomeSuggestedPrompts component that renders clickable prompt chips prefilling chat input, backed by a new getHomeSuggestedPrompts utility. Introduces useHomeTasksModuleState hook to consolidate task/artist state, refactoring TasksModule to use it, and wires the new component into ChatGreeting.

Changes

Home Suggested Prompts Feature

Layer / File(s) Summary
Prompt generation logic
lib/home/getHomeSuggestedPrompts.ts
New HomeSuggestedPrompt interface and getHomeSuggestedPrompts function build up to three prompt chip objects based on valuation, runs, and artist-name booleans.
Composed tasks module state hook
hooks/useHomeTasksModuleState.ts, components/Home/TasksModule.tsx
New hook composes useTaskRuns and useArtistProvider into getHomeTasksModuleState inputs; TasksModule refactored to use the hook instead of manual wiring.
Chip component and wiring
components/Home/HomeSuggestedPrompts.tsx, components/Chat/ChatGreeting.tsx
New client component renders suggested prompt chips that call setInput on click; integrated into both valuation and non-valuation branches of ChatGreeting.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant HomeSuggestedPrompts
  participant getHomeSuggestedPrompts
  participant VercelChatContext

  HomeSuggestedPrompts->>getHomeSuggestedPrompts: compute prompts from valuation/tasks/artist state
  getHomeSuggestedPrompts-->>HomeSuggestedPrompts: prompt chip list
  User->>HomeSuggestedPrompts: click chip
  HomeSuggestedPrompts->>VercelChatContext: setInput(prompt text)
Loading

Poem

A chip, a click, a prompt takes flight,
Hooks composed keep logic tight,
One responsibility, clean and clear,
TasksModule now has less to fear,
Suggested prompts hop into view — 🐇
SOLID bunny approves of you!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Solid & Clean Code ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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.

@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.

@cursor

cursor Bot commented Jul 7, 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.

@cursor

cursor Bot commented Jul 7, 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.

@cursor

cursor Bot commented Jul 7, 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.

@cursor

cursor Bot commented Jul 7, 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.

@cursor

cursor Bot commented Jul 7, 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.

@sweetmantech sweetmantech force-pushed the feat/home-tasks-module branch from e2af7d4 to befcadd Compare July 7, 2026 15:36
@sweetmantech sweetmantech force-pushed the feat/home-command-bar branch from 962e621 to c97e92f Compare July 7, 2026 18:59
@sweetmantech sweetmantech changed the base branch from feat/home-tasks-module to main July 7, 2026 18:59
@cursor

cursor Bot commented Jul 7, 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.

@sweetmantech

Copy link
Copy Markdown
Collaborator Author

Re-targeted to main + slimmed (c97e92fd)

With chat#1852 and chat#1853 merged, the hero and the tasks module now live inside ChatGreeting — so the modules prop this PR originally carried had no callers left. Deleted (YAGNI). What remains is this PR's genuine addition:

  1. suggestedPrompts chips above the empty-state input, wired to whichever homepage modules have data (getHomeSuggestedPrompts from valuation/tasks state — HomePage passes them, everywhere else renders unchanged).
  2. One unified empty-state layout: flex spacers inside a scrollable container — short content centers exactly as today; a tall header (hero + tasks) scrolls with the input docked beneath. This also fixes the clipping risk the taller merged header created in the fixed-height empty state.

This is now the only PR touching components/VercelChat/chat.tsx — the KISS/OCP question from chat#1852 applies here on its own merits: the layout unification arguably belongs to the chat component (it's its own empty-state geometry, not header content), and the chips are input-adjacent UI. Happy to debate either.

Gates: 126 tests, tsc 0 new, prettier clean.

🤖 Generated with Claude Code

@sweetmantech

Copy link
Copy Markdown
Collaborator Author

Live preview verification — c97e92fd (slimmed: chips + unified layout) ✅

Signed into the branch-alias preview as the multi-artist test account. This is the complete Catalog HQ assembled for the first time:

full Catalog HQ with prompt chips

Check Result
Page order ✅ hero ($8.1M · 154 tracks, Ana Bárbara scope) → YOUR LABEL AT WORK (5 runs) → prompt chips → docked input
Chips render + wiring ✅ all three, module-aware and artist-personalized: "Why did my valuation change?" (valuation has data), "What did my last task run do?" (runs exist), "What should Ana Bárbara do this week?"
Chip click → prefill, no auto-send ✅ clicking the valuation chip set the input to the full prompt ("Why did my catalog valuation change? Walk through the latest measurements…") via the existing setInput path; nothing sent
Unified empty-state layout ✅ scroll container present around header+input (engages when content exceeds the viewport; at 617px the full stack fits with scrollHeight 583), input fully visible, no clipping
No regressions ✅ hero + tasks module render identically to the merged 1853 behavior beneath them

Not exercised live: the short-content centering on the session-chat route (same component geometry, spacer-based — the centered case is the degenerate no-scroll case verified above) and narrow-viewport scrolling (mechanism structurally confirmed via the armed overflow-y-auto container).

The stack is complete with this PR — ready to merge.

🤖 Generated with Claude Code

…at changes (chat#1850)

Slimmed twice at review: the modules prop died when the hero/tasks moved
into ChatGreeting, and per the KISS review the chips now need no props
either — HomeSuggestedPrompts is fully self-contained (module relevance
from the same provider-backed hooks the header uses; prefill via the
VercelChatProvider's setInput the same way ?q= already works) and
renders inside ChatGreeting beneath the tasks module, self-hiding when
no module has data. chat.tsx, NewChatBootstrap and HomePage are
byte-identical to main; the empty-state layout hardening was dropped as
YAGNI (nothing clips at real viewports — if it ever does, that is its
own PR).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sweetmantech sweetmantech force-pushed the feat/home-command-bar branch from c97e92f to ba7b344 Compare July 7, 2026 21:06
@cursor

cursor Bot commented Jul 7, 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.

@sweetmantech

Copy link
Copy Markdown
Collaborator Author

Reworked per review: zero core chat changes (ba7b344e) — and re-verified live

Per sweetman's KISS constraint, the chips now need no props and no core-component modifications: HomeSuggestedPrompts is fully self-contained — module relevance from the same provider-backed hooks the header uses, prefill via useVercelChatContext().setInput (the same mechanism ?q= already uses), rendered inside ChatGreeting beneath the tasks module, self-hiding when no module has data.

chat.tsx, NewChatBootstrap and HomePage are byte-identical to main — same standard as chat#1852/#1853. The empty-state layout hardening was dropped as YAGNI (nothing clips at real viewports; if it ever does, that's its own PR with its own justification). Final diff: 6 files — the chips component, one ChatGreeting wiring line, the useHomeTasksModuleState DRY extraction, and getHomeSuggestedPrompts + tests.

Re-verified live on the ba7b344e preview (same signed-in session): DOM order hero → tasks → chips, all three chips render artist-personalized, chip click prefills the full prompt into the input with no auto-send.

chips, zero core changes

Gates: 126 tests, tsc 0 new, prettier clean. Ready to merge.

🤖 Generated with Claude Code

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
lib/home/getHomeSuggestedPrompts.ts (1)

19-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding unit tests for this pure function.

getHomeSuggestedPrompts is a small, pure, easily-testable function driving user-facing chip content across multiple gating combinations (valuation/no-valuation × runs × artist). No test file was included for it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/home/getHomeSuggestedPrompts.ts` around lines 19 - 60, Add unit tests for
getHomeSuggestedPrompts to cover the different gating combinations it supports,
since it is a pure function that determines user-facing prompt chips. Create
tests for hasValuation vs no valuation, hasRuns present/absent, and artistName
present/absent, and verify the returned labels/prompts and MAX_PROMPTS limiting
behavior. Use getHomeSuggestedPrompts and its parameter cases to locate the
function and keep the tests focused on its output shape.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@lib/home/getHomeSuggestedPrompts.ts`:
- Around line 19-60: Add unit tests for getHomeSuggestedPrompts to cover the
different gating combinations it supports, since it is a pure function that
determines user-facing prompt chips. Create tests for hasValuation vs no
valuation, hasRuns present/absent, and artistName present/absent, and verify the
returned labels/prompts and MAX_PROMPTS limiting behavior. Use
getHomeSuggestedPrompts and its parameter cases to locate the function and keep
the tests focused on its output shape.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e7ac0e8c-a6c6-4c6e-bb0c-7ed17789e397

📥 Commits

Reviewing files that changed from the base of the PR and between 4f58109 and ba7b344.

⛔ Files ignored due to path filters (1)
  • lib/home/__tests__/getHomeSuggestedPrompts.test.ts is excluded by !**/*.test.* and included by lib/**
📒 Files selected for processing (5)
  • components/Chat/ChatGreeting.tsx
  • components/Home/HomeSuggestedPrompts.tsx
  • components/Home/TasksModule.tsx
  • hooks/useHomeTasksModuleState.ts
  • lib/home/getHomeSuggestedPrompts.ts

@sweetmantech sweetmantech merged commit 8474780 into main Jul 7, 2026
3 checks passed
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