Skip to content

fix(frontend): refine org switcher and dialog theme#1846

Merged
riderx merged 2 commits into
mainfrom
codex/org-dropdown-dialogv2-fixes
Mar 23, 2026
Merged

fix(frontend): refine org switcher and dialog theme#1846
riderx merged 2 commits into
mainfrom
codex/org-dropdown-dialogv2-fixes

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented Mar 23, 2026

Summary (AI generated)

  • add a direct organization settings action in the org switcher with a per-row settings icon
  • improve org switcher invite state styling so pending invites read as status, not as a stray alert dot
  • refresh organization settings inputs when switching orgs from the settings area
  • force DialogV2 onto the repository DaisyUI light theme so buttons render consistently on the white dialog surface

Motivation (AI generated)

Users expected the organization switcher to provide a direct path to organization settings, but the previous menu did not expose that action clearly. While adding it, the invite status presentation and dialog theme issues also surfaced as UX problems that made the interface harder to understand and use.

Business Impact (AI generated)

This reduces friction in a core navigation path for multi-organization users, lowers confusion around pending invites, and fixes dialog readability regressions. Together these changes improve usability in account and organization management flows, which directly supports activation and retention.

Test Plan (AI generated)

  • Run bunx eslint src/components/DialogV2.vue src/components/dashboard/DropdownOrganization.vue src/pages/settings/organization/index.vue
  • Verify the org switcher shows a settings icon next to each non-invite organization
  • Verify clicking a settings icon switches to that org and opens /settings/organization
  • Verify pending invites render with the new badge treatment and remain clearly distinguishable
  • Verify switching organizations while already on organization settings refreshes the form inputs immediately
  • Verify DialogV2 buttons remain visible and themed correctly on the forced light dialog surface

Generated with AI

Summary by CodeRabbit

  • New Features

    • Organization settings are now accessible directly from each organization row in the dropdown.
    • Invitation badge now shows the number of pending invitations.
  • Bug Fixes

    • Settings form reliably resets/recreates when switching organizations.
  • Style

    • Improved dialog button styling and disabled-link behavior for clearer affordance.
    • Enhanced organization dropdown layout and responsive sizing.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dd05ebe2-149b-4ce4-87ad-ce29e2ab69c5

📥 Commits

Reviewing files that changed from the base of the PR and between bb52374 and 82e10a6.

📒 Files selected for processing (1)
  • supabase/functions/_backend/files/uploadHandler.ts
✅ Files skipped from review due to trivial changes (1)
  • supabase/functions/_backend/files/uploadHandler.ts

📝 Walkthrough

Walkthrough

Centralized dialog button class logic and adjusted theme attribute; reworked organization dropdown to use computed invitation counts, separate selection from settings with new handlers and responsive layout; made the organization settings FormKit recreate when switching organizations; removed an unused Cloudflare type import in a Supabase upload handler.

Changes

Cohort / File(s) Summary
Dialog Button Styling & Theme
src/components/DialogV2.vue
Added getButtonClasses(button) to consolidate button/link class logic (role and disabled states). Updated both <button> and <a> render paths to use it. Moved data-theme="capgolight" to outer Teleport wrapper and removed data-theme="light" from inner dialog.
Organization Dropdown UI Restructuring
src/components/dashboard/DropdownOrganization.vue
Replaced mutable hasNewInvitation with computed invitationCount; added isInvitation() and openOrganizationSettings(org, e) handlers; changed main org item from <a> to <button> and split right-side control for settings/invitation badges; adjusted layout classes and responsive sizing (w-52w-full min-w-0).
Organization Form Recreation
src/pages/settings/organization/index.vue
Added dynamic :key="currentOrganization?.gid ?? 'no-org'" to the FormKit with id="update-org" to force component recreation when the selected organization changes.
Supabase Upload Handler (types)
supabase/functions/_backend/files/uploadHandler.ts
Removed unused R2HTTPMetadata from a type-only import, keeping R2UploadedPart, reducing an unused type dependency.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Fix org images and logo uploads #1531: Modifies organization item rendering in DropdownOrganization.vue (logo/initials handling) and may intersect with the dropdown item/controls restructuring in this PR.

Poem

🐰 I hopped in to tidy the rows,
Buttons dressed up in tidy clothes,
Badges peek where invites hide,
Forms refresh when orgs collide,
A little rabbit, gleeful, goes ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: org switcher refinements (settings action, invite styling) and dialog theme fixes. It is concise, specific, and directly reflects the changeset.
Description check ✅ Passed The description includes a well-structured summary, motivation, business impact, and a comprehensive test plan with manual verification steps. While some test items are unchecked, the required template sections are complete and informative.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 codex/org-dropdown-dialogv2-fixes

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/dashboard/DropdownOrganization.vue`:
- Around line 190-194: The badge rendering around {{ invitationCount }} and the
custom-styled buttons in DropdownOrganization.vue use raw Tailwind amber colors
and bespoke utility classes; replace the badge's classes (border-amber-400/30,
bg-amber-500/10, text-amber-200, bg-amber-300) with the approved project palette
tokens (e.g., use CSS variables like var(--color-warning) or the theme's
secondary token for border, background and text) and convert the buttons that
currently use custom inline utilities into DaisyUI primitives by swapping their
classes to appropriate d-btn variants (e.g., d-btn d-btn-ghost or d-btn
d-btn-sm) so the UI uses d-btn styling instead of bespoke Tailwind classes;
target the badge element that renders invitationCount and the button elements
around the dropdown actions in DropdownOrganization.vue to apply these
replacements.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0281589-6e45-4f0a-9b8f-7ac519a48472

📥 Commits

Reviewing files that changed from the base of the PR and between 68c6957 and bb52374.

📒 Files selected for processing (3)
  • src/components/DialogV2.vue
  • src/components/dashboard/DropdownOrganization.vue
  • src/pages/settings/organization/index.vue

Comment on lines +190 to +194
class="inline-flex items-center gap-1 px-2 py-0.5 ml-2 text-[11px] font-medium rounded-full border border-amber-400/30 bg-amber-500/10 text-amber-200 shrink-0"
>
<span class="w-1.5 h-1.5 rounded-full bg-amber-300" />
<span>{{ invitationCount }}</span>
</div>
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify interactive primitives and accent usage in DropdownOrganization.vue
rg -nP --type=vue '<button[^>]*class="[^"]*"' src/components/dashboard/DropdownOrganization.vue
rg -nP --type=vue 'd-btn' src/components/dashboard/DropdownOrganization.vue
rg -nP --type=vue '(bg|text|border)-amber-' src/components/dashboard/DropdownOrganization.vue

Repository: Cap-go/capgo

Length of output: 139


🏁 Script executed:

wc -l src/components/dashboard/DropdownOrganization.vue

Repository: Cap-go/capgo

Length of output: 109


🏁 Script executed:

cat -n src/components/dashboard/DropdownOrganization.vue | sed -n '180,250p'

Repository: Cap-go/capgo

Length of output: 4005


🏁 Script executed:

# Check the project's style palette
head -50 src/styles/style.css

Repository: Cap-go/capgo

Length of output: 1393


🏁 Script executed:

# Look for DaisyUI button usage patterns in other components
rg 'd-btn' src/components/ -A 1 -B 1 | head -30

Repository: Cap-go/capgo

Length of output: 2010


Replace custom button styles with d-btn primitives and update amber badges to project palette.

The buttons at lines 207–213 and 239 are styled without DaisyUI primitives, and the amber badges at lines 190–194 and 231–234 use custom Tailwind colors (amber-400, amber-500, amber-200, amber-300) instead of the approved palette from src/styles/style.css.

Update buttons to use d-btn classes (e.g., d-btn d-btn-ghost) and replace amber colors with project tokens (e.g., --color-warning or secondary accent from the theme).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/dashboard/DropdownOrganization.vue` around lines 190 - 194,
The badge rendering around {{ invitationCount }} and the custom-styled buttons
in DropdownOrganization.vue use raw Tailwind amber colors and bespoke utility
classes; replace the badge's classes (border-amber-400/30, bg-amber-500/10,
text-amber-200, bg-amber-300) with the approved project palette tokens (e.g.,
use CSS variables like var(--color-warning) or the theme's secondary token for
border, background and text) and convert the buttons that currently use custom
inline utilities into DaisyUI primitives by swapping their classes to
appropriate d-btn variants (e.g., d-btn d-btn-ghost or d-btn d-btn-sm) so the UI
uses d-btn styling instead of bespoke Tailwind classes; target the badge element
that renders invitationCount and the button elements around the dropdown actions
in DropdownOrganization.vue to apply these replacements.

@riderx riderx merged commit f84893d into main Mar 23, 2026
13 checks passed
@riderx riderx deleted the codex/org-dropdown-dialogv2-fixes branch March 23, 2026 23:20
@sonarqubecloud
Copy link
Copy Markdown

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