Skip to content

ProfileList - Add active profile indicator#804

Open
Sartoric wants to merge 1 commit into
jniebuhr:masterfrom
Sartoric:feature/sartoric-add-active-profile-indicator
Open

ProfileList - Add active profile indicator#804
Sartoric wants to merge 1 commit into
jniebuhr:masterfrom
Sartoric:feature/sartoric-add-active-profile-indicator

Conversation

@Sartoric

@Sartoric Sartoric commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Update ProfileList: add active profile indicator for extraction and utility tabs

  • Added visual indicators for selected profile to the "extraction" and "utility" tabs.

Summary by CodeRabbit

  • New Features

    • Profile tabs now show clearer status indicators for Extraction and Utility profiles.
    • Tab spacing and padding adjust based on whether a visible Utility profile is active.
  • Bug Fixes

    • Improved how profile visibility and selection are reflected in the tab UI.
    • Updated profile card formatting with no change to behavior.
dot

…tility tabs

- Added visual indicators for selected profile to the "extraction" and "utility" tabs.
@cla-bot cla-bot Bot added the cla-signed label Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

In ProfileList, a new boolean isUtilityProfileActive is derived from profilesToShow to indicate whether any visible utility profile is currently selected. The Extraction and Utility tab controls conditionally render a small colored dot indicator and adjust padding based on this value. ProfileCard prop destructuring is reformatted with no logic change.

Changes

Utility Profile Active Tab Indicator

Layer / File(s) Summary
isUtilityProfileActive state and tab dot indicators
web/src/pages/ProfileList/index.jsx
Derives isUtilityProfileActive from profilesToShow; uses it in Extraction/Utility tab controls to conditionally render a bg-primary rounded-full dot and toggle tab padding. Also reformats ProfileCard destructured props (no behavior change).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • jniebuhr/gaggimate#530: Introduced the Extraction/Utility tab structure in ProfileList that this PR now extends with active-state dot indicators.

Poem

🐰 A dot so small, a circle bright,
Upon the tab it glows with light,
When utility profiles are near,
A colored sign makes choices clear,
The rabbit stamps each tab with pride! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: adding active profile indicators in ProfileList.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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.

@sonarqubecloud

Copy link
Copy Markdown

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/pages/ProfileList/index.jsx`:
- Around line 661-662: The active-tab logic in ProfileList/index.jsx is using
isUtilityProfileActive as a proxy for the visible selected tab, which causes
Extraction to appear active when the selected profile is hidden by search.
Update the selection derivation in the ProfileList component to compute the
visible selected profile explicitly, or split the state into separate extraction
and utility booleans, and use that result where the tab active state is
determined. Keep the logic aligned with the profilesToShow filtering so only
visible selections drive the UI.
- Around line 1004-1019: The tab indicator dots in ProfileList are currently
rendered as separate children of the tablist, which breaks the intended tab
semantics. Update the tab rendering around the Extraction and Utility `<button
role='tab'>` elements so each decorative dot is moved inside the corresponding
tab button and marked `aria-hidden='true'`, keeping the indicator associated
with the active tab while preserving accessible tablist structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d7584675-35da-42f5-aac1-83d1299a6015

📥 Commits

Reviewing files that changed from the base of the PR and between 4cd2874 and 38e349d.

📒 Files selected for processing (1)
  • web/src/pages/ProfileList/index.jsx

Comment on lines +661 to +662
const isUtilityProfileActive = profilesToShow.filter(p => p.utility && p.selected).length > 0;

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Derive the visible selected tab explicitly.

Line 661 only answers “is a visible utility profile selected?”. The Extraction dot then falls back to !isUtilityProfileActive, which also becomes true when the current selected profile is hidden by search, so the UI can show Extraction as active even when no visible profile is selected. Derive the visible selected profile (or separate extraction/utility booleans) instead of negating the utility flag.

Suggested fix
-  const isUtilityProfileActive = profilesToShow.filter(p => p.utility && p.selected).length > 0;
+  const selectedVisibleProfile = profilesToShow.find(p => p.selected);
+  const isUtilityProfileActive = !!selectedVisibleProfile?.utility;
+  const isExtractionProfileActive = !!selectedVisibleProfile && !selectedVisibleProfile.utility;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/ProfileList/index.jsx` around lines 661 - 662, The active-tab
logic in ProfileList/index.jsx is using isUtilityProfileActive as a proxy for
the visible selected tab, which causes Extraction to appear active when the
selected profile is hidden by search. Update the selection derivation in the
ProfileList component to compute the visible selected profile explicitly, or
split the state into separate extraction and utility booleans, and use that
result where the tab active state is determined. Keep the logic aligned with the
profilesToShow filtering so only visible selections drive the UI.

Comment on lines +1004 to +1019
className={`tab ${activeTab === 'extraction' ? 'tab-active' : ''} ${!isUtilityProfileActive ? 'pr-[5px]' : ''}`}
onClick={() => setActiveTab('extraction')}
aria-label='Switch to extraction tab'
>
Extraction
</button>
{!isUtilityProfileActive && <div class='bg-primary mr-[7px] h-2 w-2 rounded-full' />}
<button
role='tab'
className={`tab ${activeTab === 'utility' ? 'tab-active' : ''}`}
className={`tab ${activeTab === 'utility' ? 'tab-active' : ''} ${isUtilityProfileActive ? 'pr-[5px]' : ''}`}
onClick={() => setActiveTab('utility')}
aria-label='Switch to utility tab'
>
Utility
</button>
{isUtilityProfileActive && <div class='bg-primary mr-[7px] h-2 w-2 rounded-full' />}

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the indicator inside the tab button.

The new dot elements are direct children of role='tablist' even though they are decorative, not tabs. That muddies the tablist semantics for assistive tech. Render the dot inside the corresponding <button role='tab'> and mark it aria-hidden='true'.

Suggested fix
-          <button
+          <button
             role='tab'
-            className={`tab ${activeTab === 'extraction' ? 'tab-active' : ''} ${!isUtilityProfileActive ? 'pr-[5px]' : ''}`}
+            className={`tab ${activeTab === 'extraction' ? 'tab-active' : ''}`}
             onClick={() => setActiveTab('extraction')}
             aria-label='Switch to extraction tab'
           >
             Extraction
+            {isExtractionProfileActive && (
+              <span aria-hidden='true' className='bg-primary ml-2 h-2 w-2 rounded-full' />
+            )}
           </button>
-          {!isUtilityProfileActive && <div class='bg-primary mr-[7px] h-2 w-2 rounded-full' />}
           <button
             role='tab'
-            className={`tab ${activeTab === 'utility' ? 'tab-active' : ''} ${isUtilityProfileActive ? 'pr-[5px]' : ''}`}
+            className={`tab ${activeTab === 'utility' ? 'tab-active' : ''}`}
             onClick={() => setActiveTab('utility')}
             aria-label='Switch to utility tab'
           >
             Utility
+            {isUtilityProfileActive && (
+              <span aria-hidden='true' className='bg-primary ml-2 h-2 w-2 rounded-full' />
+            )}
           </button>
-          {isUtilityProfileActive && <div class='bg-primary mr-[7px] h-2 w-2 rounded-full' />}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
className={`tab ${activeTab === 'extraction' ? 'tab-active' : ''} ${!isUtilityProfileActive ? 'pr-[5px]' : ''}`}
onClick={() => setActiveTab('extraction')}
aria-label='Switch to extraction tab'
>
Extraction
</button>
{!isUtilityProfileActive && <div class='bg-primary mr-[7px] h-2 w-2 rounded-full' />}
<button
role='tab'
className={`tab ${activeTab === 'utility' ? 'tab-active' : ''}`}
className={`tab ${activeTab === 'utility' ? 'tab-active' : ''} ${isUtilityProfileActive ? 'pr-[5px]' : ''}`}
onClick={() => setActiveTab('utility')}
aria-label='Switch to utility tab'
>
Utility
</button>
{isUtilityProfileActive && <div class='bg-primary mr-[7px] h-2 w-2 rounded-full' />}
<button
role='tab'
className={`tab ${activeTab === 'extraction' ? 'tab-active' : ''}`}
onClick={() => setActiveTab('extraction')}
aria-label='Switch to extraction tab'
>
Extraction
{isExtractionProfileActive && (
<span aria-hidden='true' className='bg-primary ml-2 h-2 w-2 rounded-full' />
)}
</button>
<button
role='tab'
className={`tab ${activeTab === 'utility' ? 'tab-active' : ''}`}
onClick={() => setActiveTab('utility')}
aria-label='Switch to utility tab'
>
Utility
{isUtilityProfileActive && (
<span aria-hidden='true' className='bg-primary ml-2 h-2 w-2 rounded-full' />
)}
</button>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/ProfileList/index.jsx` around lines 1004 - 1019, The tab
indicator dots in ProfileList are currently rendered as separate children of the
tablist, which breaks the intended tab semantics. Update the tab rendering
around the Extraction and Utility `<button role='tab'>` elements so each
decorative dot is moved inside the corresponding tab button and marked
`aria-hidden='true'`, keeping the indicator associated with the active tab while
preserving accessible tablist structure.

@oibind

oibind commented Jul 2, 2026

Copy link
Copy Markdown

Can we have this integrated into the statistics page too?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants