feat(compliance): focused first-load — setup panel for empty orgs, two-block register - #251
Conversation
…o-block register For an org with zero obligations the landing page rendered four stacked mostly-empty blocks: a 4-metric hero of zeros, two uniform quick-link cards, a 3-select filter bar and an empty table with pagination. The page now branches server-side on the org's obligation count: - No obligations yet: a single centered setup panel with one primary action (Browse frameworks). Fail-open — any resolution/query error renders the full register. - Populated org: hero + register only. The Compliance health and Manual attestations quick-link cards fold into the hero's actions row as quiet links, so the page is two blocks instead of four. Reuses PageHero actions, the health page's empty-state pattern and StartHereCard's primary CTA styling — no new primitives or tokens. Keeps the 'Obligations Register' heading and compliance-health-link testid asserted/used by e2e.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 38 minutes and 36 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 399c37a327
ℹ️ 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".
| .select('id', { count: 'exact', head: true }) | ||
| .eq('organization_id', orgId); | ||
| if (error) return true; | ||
| return (count ?? 0) > 0; |
There was a problem hiding this comment.
Treat enabled frameworks as populated
When an org has just activated a framework, this gate can still return false because framework activation upserts org_frameworks and then starts provisionFrameworkControls(...).catch() without awaiting it in app/api/v1/frameworks/activate/route.ts, so org_tasks may be empty while the framework is already enabled. In that window, or if provisioning fails to create tasks, /app/compliance keeps showing the setup CTA instead of the populated compliance landing/health links, effectively sending users back to browse frameworks they already enabled.
Useful? React with 👍 / 👎.
♿ Accessibility Test Results✅ PASSED - No critical accessibility issues found Tests Performed:
Artifacts: Download the accessibility reports from the "Artifacts" section for detailed results. |
Summary
First-session density/IA pass on
/app/compliance(surface 1 of the remaining workstream; dashboard was PR #250).Before: every org — including a brand-new one — saw four stacked uniform blocks: a 4-metric hero (all zeros for new orgs), two equal quick-link cards (Health, Attestations), a 3-select filter bar, and an empty table with pagination.
After, branching server-side on the org's obligation count:
Notes
PageHeroactions, the health page's empty-state pattern, and StartHereCard's primary CTA styling — no new primitives, tokens, or affordancesObligations Registerheading (asserted bydeep-workflow-integrity.spec.tsafter seeding data) and thecompliance-health-linktestidenterprise-invariants.spec.ts's empty-state regex still matchesVerification
npm run typecheck— passnpx eslinton both touched files — cleanCompliancePageHerohas a single consumer (this page); change is surface-localhttps://claude.ai/code/session_01TyMddHGjcjofqS6K9H2MeW
Generated by Claude Code