Skip to content

Add standalone chats section to the sidebar#3981

Open
jakeleventhal wants to merge 5 commits into
pingdotgg:mainfrom
jakeleventhal:t3code/add-sidebar-chats-section-1
Open

Add standalone chats section to the sidebar#3981
jakeleventhal wants to merge 5 commits into
pingdotgg:mainfrom
jakeleventhal:t3code/add-sidebar-chats-section-1

Conversation

@jakeleventhal

@jakeleventhal jakeleventhal commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Screenshot 2026-07-14 at 8 01 36 PM
  • add a dedicated Chats section above Projects for ad hoc conversations
  • lazily provision the reserved ~/.t3/chats workspace and start local Codex chats there
  • keep the app-managed Chats project out of normal project pickers while retaining standard thread actions and navigation

Screenshot

Testing

  • pnpm exec vp check
  • pnpm exec vp run typecheck
  • pnpm exec vp test apps/web/src/generalChats.test.ts

Note

Add standalone Chats section to the web sidebar separate from Projects

  • Adds a dedicated 'Chats' section above 'Projects' in Sidebar.tsx with a 'New chat' button that auto-provisions the general chats project if it doesn't exist, then creates and navigates to a new thread.
  • Introduces generalChats.ts in client-runtime with constants (GENERAL_CHATS_PROJECT_ID, GENERAL_CHATS_PROJECT_TITLE) and helpers (isGeneralChatsProject, excludeGeneralChatsProject, excludeGeneralChatsThreads) used across web and mobile.
  • Hides project-specific header actions (git, scripts, open-in picker) in ChatHeader.tsx when the active project is the general chats project.
  • Excludes the general chats project and its threads from mobile home groups, archive lists, repository pickers, and the new-task flow.
  • Adds waitForProject to entities.ts to poll for project availability after creation, with a 2-second timeout.

Macroscope summarized d7a388a.


Note

Medium Risk
Touches sidebar navigation, lazy project provisioning, and new-thread defaults across web and mobile; incorrect filtering or provisioning could hide threads or mis-route drafts, but changes are scoped with tests and duplicate-create handling.

Overview
Adds standalone Chats for ad hoc conversations via a reserved project (t3code-general-chats, ~/.t3/chats), shared through @t3tools/client-runtime/general-chats helpers that identify and exclude it from regular project/thread lists.

On web, the sidebar gets a Chats section above Projects with New chat, which lazily creates that project on the primary environment (with waitForProject after create) and starts a thread with fixed local options—no branch/worktree seeding. The chats project stays out of the Projects list, command palette project actions, and default new-thread project ordering. Chat threads reuse normal sidebar row behavior in mode="chats" (always expanded, no project header, no copy-path, local env for new threads). ChatHeader hides git, scripts, and open-in actions for chats. Archiving a chat still opens a fresh local draft via getGeneralChatNewThreadOptions.

On mobile, the same project is omitted from home groups, archive, repository pickers, new-task flow, and deep-linked draft project selection.

Sidebar thread preview logic is refactored to getVisibleThreadsForProject so the active chat stays visible when folded under the preview limit.

Reviewed by Cursor Bugbot for commit d7a388a. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3617afd8-f89b-46b9-9582-4100deb95195

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

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 14, 2026
Comment thread apps/web/src/components/Sidebar.tsx
@jakeleventhal
jakeleventhal marked this pull request as ready for review July 15, 2026 00:03
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/components/Sidebar.tsx
Comment thread apps/web/src/hooks/useHandleNewThread.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new user-facing feature (standalone chats section in sidebar) with new UI components, new project creation logic, and cross-cutting filtering throughout mobile and web apps. New capabilities of this scope warrant human review.

You can customize Macroscope's approvability policy. Learn more.

Comment thread apps/web/src/components/Sidebar.tsx

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 04b25e9ad7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/src/components/Sidebar.tsx
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jul 15, 2026
@jakeleventhal
jakeleventhal force-pushed the t3code/add-sidebar-chats-section-1 branch from 8004340 to 8d7cf85 Compare July 15, 2026 02:04
Comment thread apps/web/src/hooks/useHandleNewThread.ts
Comment thread apps/web/src/components/Sidebar.tsx

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d7cf85806

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3480 to +3481
const provisionedProject = await waitForProject(projectRef);
if (provisionedProject === null) {

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 Badge Avoid failing successful chat creation on slow sync

When project.create succeeds but the shell snapshot/stream takes more than waitForProject's 2-second default to publish the new project, this branch reports "Could not create chat" and returns without opening the draft even though the Chats project was created. This is especially likely on slow or reconnecting remote environments; consider proceeding to handleNewThread or otherwise avoiding a short fixed sync timeout after a successful create.

Useful? React with 👍 / 👎.

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d7a388a. Configure here.

: threadVisibility.hiddenThreads;
return {
hasOverflowingThreads,
hasOverflowingThreads: threadVisibility.hasHiddenThreads,

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.

Spurious Show more control

Low Severity

hasOverflowingThreads now follows getVisibleThreadsForProject().hasHiddenThreads, which stays true whenever the list is longer than the preview limit even after the active thread is pinned into the visible set. When that pin leaves hiddenThreads empty, the sidebar still renders a no-op Show more control—easy to hit in Chats with the default preview count of 6 and 7 threads while viewing the oldest one.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d7a388a. Configure here.

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

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant