Skip to content

Disable project creation when user has 10 projects#469

Merged
AnthonyRonning merged 1 commit intomasterfrom
devin/1776139457-max-10-projects
Apr 14, 2026
Merged

Disable project creation when user has 10 projects#469
AnthonyRonning merged 1 commit intomasterfrom
devin/1776139457-max-10-projects

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 14, 2026

Summary

Enforces a maximum of 10 projects in the sidebar UI. When a user has 10 or more conversation projects, the "New project" button becomes disabled (grayed out with cursor-not-allowed) and shows a tooltip on hover explaining that the maximum has been reached.

Changes are limited to ChatHistoryList.tsx:

  • Added a MAX_PROJECTS = 10 module-level constant
  • Conditionally render the "New project" button: disabled with tooltip at the limit, normal clickable button otherwise
  • Uses the existing Tooltip component from shadcn/ui (provider is already mounted at the app level)

Review & Testing Checklist for Human

  • Verify tooltip appears on disabled button hover: Radix UI tooltips with asChild on a disabled HTML button can behave inconsistently across browsers — hover events may not fire on truly disabled elements. Test in Chrome, Safari, and Firefox.
  • Confirm no other UI paths bypass this limit: The sidebar "New project" button is the only guarded entry point. Check if projects can be created from any other UI surface (e.g., move-to-project dialogs, project picker, etc.) that should also enforce this limit.
  • Test boundary condition: Create exactly 10 projects and verify the button disables. Delete one and verify it re-enables.

Notes

  • This is client-side enforcement only. If server-side enforcement is also desired (rejecting API calls beyond 10 projects), that would be a separate backend change.
  • If the disabled button doesn't reliably show the tooltip in some browsers, a common workaround is wrapping it in a <span> so the tooltip trigger receives pointer events even when the child is disabled.

Link to Devin session: https://app.devin.ai/sessions/fd74c469a38d4cc79e8877d0e05fab2b
Requested by: @AnthonyRonning


Open with Devin

- Add MAX_PROJECTS constant (10)
- When at limit, disable 'New project' button with reduced opacity and cursor-not-allowed
- Show tooltip on hover explaining 'Maximum of 10 projects reached'
- Uses existing Tooltip component from shadcn/ui

Co-Authored-By: tony@opensecret.cloud <TonyGiorgio@protonmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying maple with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4af319f
Status: ✅  Deploy successful!
Preview URL: https://071b833a.maple-ca8.pages.dev
Branch Preview URL: https://devin-1776139457-max-10-proj.maple-ca8.pages.dev

View logs

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Testing Results

Tested locally on localhost:5173 against enclave.secretgpt.ai backend. Used React Query cache injection to simulate 10 projects (test account is on FREE PLAN which doesn't support project creation via API — unrelated to this PR).

Test Results (3/3 passed)
  • Test 1: Button enabled with <10 projects — PASSED — Dialog opens on click with 0 projects
  • Test 2: Button disabled at exactly 10 projects — PASSED — Button grayed out, cursor-not-allowed, tooltip "Maximum of 10 projects reached", click does nothing
  • Test 3: Button re-enables below 10 projects — PASSED — Button returns to normal at 9 projects, dialog opens on click
Evidence
Enabled (0 projects) Disabled (10 projects)
Enabled Disabled with tooltip
10 projects in sidebar Re-enabled (9 projects)
10 projects Re-enabled

Devin session

@AnthonyRonning AnthonyRonning merged commit 89192a7 into master Apr 14, 2026
12 checks passed
@AnthonyRonning AnthonyRonning deleted the devin/1776139457-max-10-projects branch April 14, 2026 05:00
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