feat(web): company brain entitlement helper, hook + ?org deep-link activation#1110
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | 5049404 | Jun 22 2026, 06:11 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 5049404 | Commit Preview URL Branch Preview URL |
Jun 22 2026, 06:13 PM |
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
fdb69fa to
5377aa3
Compare
5377aa3 to
b5e5337
Compare
b5e5337 to
2d8845e
Compare
003c758 to
ecbb048
Compare
|
Claude finished @MaheshtheDev's task in 1m 28s —— View job Re-review complete
Summary: Re-reviewed after fixes to the two P2 issues from the previous review. Both fixes are correctly implemented — |
There was a problem hiding this comment.
Overview: Adds hasCompanyBrain helper and useHasCompanyBrain hook to gate Company Brain UI based on org metadata, plus a ?org=<slug> deep-link mechanism for org activation.
Issues found: None — this looks good to ship.
The implementation handles edge cases well:
hasCompanyBraincorrectly handles both string and object metadata (better-auth returns JSON strings), with proper try/catch on JSON.parse- Feature overrides take precedence over
activeProductsarray — correct priority useHasCompanyBrainalso checksbrainMode === "team"to cover the async webhook delay — good defensive codingconsumeRequestedOrgSlugproperly checks for SSR (typeof window === "undefined"), strips the param withreplaceStateto prevent re-triggering on refresh/back-navigation- The
cancelledflag in the auth effect correctly prevents stale state updates - All schema/type additions are optional, so no breaking changes
Score: 10/10
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ecbb048209
ℹ️ 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".
ecbb048 to
bd3a8f1
Compare
There was a problem hiding this comment.
Overview: Adds hasCompanyBrain helper and useHasCompanyBrain hook to gate Company Brain UI based on org metadata, plus a ?org=<slug> deep-link mechanism for org activation.
Issues found: None — the previous feedback has been correctly addressed.
The fixes look good:
useHasCompanyBrainnow checksgetCompanyBrainOverridefirst and returns it directly when set, so an explicitallow: falseproperly bypasses thebrainMode: "team"fallbackuseProjectnow returnsnormalizedProjectsasselectedProjects, so the selector, counts, and queries all use the same default tag
Other implementation details are solid:
hasCompanyBrainhandles both string and object metadata with proper try/catchconsumeRequestedOrgSlugchecks for SSR and strips the param withreplaceState- The
cancelledflag correctly prevents stale state updates - All schema/type additions are optional — no breaking changes
Score: 10/10
Merge activity
|
…tivation (#1110) Add hasCompanyBrain helper + useHasCompanyBrain hook reading the company_brain add-on from org metadata to gate Company Brain UI. Fixes ENG-806
bd3a8f1 to
5049404
Compare

Add hasCompanyBrain helper + useHasCompanyBrain hook reading the company_brain add-on from org metadata to gate Company Brain UI.
Fixes ENG-806