Skip to content

UN-3240 [FEAT] Add HITL navigation to sidebar and remove from profile dropdown#1804

Merged
vishnuszipstack merged 4 commits intomainfrom
feat/hitl-sidebar-nav-tabs
Feb 27, 2026
Merged

UN-3240 [FEAT] Add HITL navigation to sidebar and remove from profile dropdown#1804
vishnuszipstack merged 4 commits intomainfrom
feat/hitl-sidebar-nav-tabs

Conversation

@vishnuszipstack
Copy link
Contributor

@vishnuszipstack vishnuszipstack commented Feb 24, 2026

What

  • Add HITL navigation to the left sidebar with a hover popover showing role-based menu items
  • Remove Review, Approve, and Download & Sync items from the profile dropdown menu
  • Clean up unused state variables and icon imports in TopNavBar

Why

  • HITL navigation was buried in the profile dropdown (UN-3240), making it hard to discover
  • Sidebar placement makes HITL a first-class navigation item alongside Build, Manage, and Settings

How

  • SideNavBar.jsx: Added HITLPopoverContent component with role-based menu items (Review for all HITL roles, Approve and Download & Sync for supervisor/admin). Added conditional "REVIEW" section between MANAGE and SETTINGS using FileProtectOutlined icon. Uses same Popover pattern as Platform settings.
  • TopNavBar.jsx: Removed menu items key 4 (Review), 5 (Approve), 6 (Download & Sync). Removed unused approverStatus/reviewerStatus state and UNSTRACT_ADMIN, DownloadOutlined, FileProtectOutlined, LikeOutlined imports.
  • SideNavBar.css: Added .sidebar-antd-icon styles for Ant Design icon in sidebar with hover/active color transitions.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

  • No. Navigation paths are unchanged — only the location of the links moved from dropdown to sidebar. The reviewPageHeader logic in TopNavBar is preserved for page context display.

Database Migrations

  • None

Env Config

  • None

Relevant Docs

  • None

Related Issues or PRs

Dependencies Versions

  • None

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

Summary by CodeRabbit

  • New Features

    • Integrated Human-in-the-Loop (HITL) review capabilities into the side navigation with role-based visibility and contextual menus.
  • Refactor

    • Reorganized navigation structure by moving review-related features from the top navigation to the side navigation for improved information hierarchy.
  • Style

    • Enhanced sidebar icon styling with improved sizing and color scheme.

Walkthrough

Relocates Human-in-the-Loop (HITL) review UI from the top nav to the side nav, adding side-menu HITL items with hover popover and role-based visibility, introduces sidebar icon CSS, and removes review-related code from the top navigation.

Changes

Cohort / File(s) Summary
Sidebar Icon Styling
frontend/src/components/navigations/side-nav-bar/SideNavBar.css
Added .sidebar-antd-icon class (font-size, color, width, flex centering) and color override rules for active/hover states to render icons white when active/hovered.
HITL Navigation Integration
frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx
Introduced HITL helpers (HITL_MENU_ITEMS, getHITLMenuItems, getActiveHITLKey), HITLPopoverContent for hoverable submenu, role-based visibility and active-state logic, and conditional injection of a "REVIEW" HITL section with navigation paths and disabled handling.
Top Nav Review Removal
frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
Removed admin/review-related imports and state (approverStatus, reviewerStatus), deleted Review/Approve/Download menu items and associated logic/side-effects, and simplified effect dependencies/catch naming.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~55 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main changes: adding HITL navigation to sidebar and removing it from profile dropdown, matching the primary objectives of the PR.
Description check ✅ Passed The description is well-structured and covers all required sections: What, Why, How, impact analysis, database/env changes, related issues, and testing notes. All critical information is present and detailed.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/hitl-sidebar-nav-tabs

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 and usage tips.

Copy link
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: 2

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

Inline comments:
In `@frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx`:
- Around line 407-435: The code may insert duplicate "REVIEW" entries on
re-renders because it unconditionally splices into the shared data array; before
splicing, check whether data already contains an item with mainTitle "REVIEW"
(or an item with isHITL true) and only insert if none exists; update the block
that computes isHITLRole and the conditional using manualReviewSettingsEnabled
&& isHITLRole && isUnstract to also verify e.g. !data.some(item =>
item.mainTitle === "REVIEW" || (item.subMenu && item.subMenu.some(sm =>
sm.isHITL))) before performing data.splice (use the same identifiers: data,
settingsIndex, splice, isHITL).
- Around line 153-209: getActiveHITLKey currently uses includes("/review") which
incorrectly matches other routes (e.g. /settings/review); update
getActiveHITLKey to scope checks to the org review base path by using the
orgName parameter: compute currentPath = globalThis.location.pathname and test
using startsWith or a regex against `/${orgName}/review` (and the more specific
`/${orgName}/review/approve` and `/${orgName}/review/download_and_sync`) so the
function returns "approve", "download" or "review" only when the path actually
belongs to that org's review routes; this ensures HITLPopoverContent and
getHITLMenuItems reflect the correct active key.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to Reviews > Disable Cache setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between d7babec and cde0f07.

📒 Files selected for processing (3)
  • frontend/src/components/navigations/side-nav-bar/SideNavBar.css
  • frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx
  • frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
💤 Files with no reviewable changes (1)
  • frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx

@vishnuszipstack vishnuszipstack changed the title feat: Add HITL sidebar navigation (UN-3240, UN-3241, UN-3242) UN-3240 [FEAT] Add HITL navigation to sidebar and remove from profile dropdown Feb 24, 2026
@jagadeeswaran-zipstack
Copy link
Contributor

@vishnuszipstack Please resolve the conflicts. Seems like code rabbit comment is valid address that too

vishnuszipstack and others added 2 commits February 27, 2026 10:16
… (UN-3240)

Move HITL navigation from the profile dropdown menu to the left sidebar
with a hover popover showing role-based menu items (Review for all HITL
roles, Approve and Download & Sync for supervisor/admin). Remove the
now-redundant Review, Approve, and Download & Sync items from the
TopNavBar profile dropdown. Clean up unused state and icon imports.

Note: Companion changes for in-page tabs (ReviewHeader), queue deletion
(UN-3241), and nested table support (UN-3242) are in the enterprise
plugin layer (gitignored).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused isAdmin variable in TopNavBar useEffect
- Remove unused UNSTRACT_ADMIN import in TopNavBar
- Remove unused Modal import from ReviewHeader (used in ManualReviewPage)
- Fix prettier formatting in ReviewHeader antd import
- Fix prettier formatting in ManualReviewPage delete handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@chandrasekharan-zipstack chandrasekharan-zipstack left a comment

Choose a reason for hiding this comment

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

Drop a screenshot in the PR, also was the design review done?

- Scope getActiveHITLKey to org review routes using startsWith instead of includes
- Guard against duplicate REVIEW section insertion on re-render
- Extract HITL menu items into a constant array
- Remove unused icon imports from TopNavBar
- Fix biome lint issues (block statements, unused variable)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vishnuszipstack vishnuszipstack force-pushed the feat/hitl-sidebar-nav-tabs branch from cde0f07 to b8ac20f Compare February 27, 2026 04:52
@vishnuszipstack
Copy link
Contributor Author

Addressed all review comments and resolved merge conflicts (rebased onto latest main):

  1. @coderabbitai - getActiveHITLKey scoping: Changed from includes("/review") to startsWith(\/${orgName}/review`)so it won't match/settings/review`.

  2. @coderabbitai - Duplicate REVIEW section guard: Added hasReviewSection check before splice to prevent duplicate REVIEW entries on re-render.

  3. @athul-rs - Extract paths into array: Refactored to use a HITL_MENU_ITEMS constant array with supervisorOnly flag, and getHITLMenuItems now filters and maps from this array.

Also fixed biome lint issues (block statements, unused variable) and removed unused icon imports from TopNavBar.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the current implementation of getActiveHITLKey and related HITL logic in SideNavBar.jsx
cat frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx | grep -A 10 "getActiveHITLKey\|hasReviewSection\|HITL_MENU_ITEMS" | head -60

Length of output: 1678


@vishnuszipstack Thank you for addressing all the review comments! I've verified the changes and can confirm:

getActiveHITLKey scoping - Now correctly uses startsWith(\/${orgName}/review`)to avoid false matches with/settings/review`

Duplicate REVIEW section guard - The hasReviewSection check properly prevents duplicate entries on re-render

HITL_MENU_ITEMS refactoring - Clean constant array with supervisorOnly flag and proper filtering logic

All fixes look great, and the code is much more maintainable now. Nice work resolving the merge conflicts and addressing the lint issues as well! 🎉


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@vishnuszipstack
Copy link
Contributor Author

Drop a screenshot in the PR, also was the design review done?

screenshot added in cloud pr @chandrasekharan-zipstack also design review done.

Copy link
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.

🧹 Nitpick comments (1)
frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx (1)

184-196: Consider extracting role constants to reduce duplication.

The role arrays ["unstract_supervisor", "unstract_admin"] (line 185-188) and ["unstract_reviewer", "unstract_supervisor", "unstract_admin"] (lines 463-466) are defined inline in multiple places. Extracting these to named constants would improve maintainability.

♻️ Optional: Extract role constants
+const HITL_SUPERVISOR_ROLES = ["unstract_supervisor", "unstract_admin"];
+const HITL_ALL_ROLES = ["unstract_reviewer", ...HITL_SUPERVISOR_ROLES];
+
 const HITL_MENU_ITEMS = [
   // ...
 ];

 const getHITLMenuItems = (orgName, role) => {
-  const isSupervisorOrAdmin = [
-    "unstract_supervisor",
-    "unstract_admin",
-  ].includes(role);
+  const isSupervisorOrAdmin = HITL_SUPERVISOR_ROLES.includes(role);
   // ...
 };

Then at line 462:

-  const isHITLRole = [
-    "unstract_reviewer",
-    "unstract_supervisor",
-    "unstract_admin",
-  ].includes(role);
+  const isHITLRole = HITL_ALL_ROLES.includes(role);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx` around lines
184 - 196, Extract the repeated role arrays into named constants (e.g., const
ROLE_SUPERVISORS = ["unstract_supervisor", "unstract_admin"]; const
ROLE_REVIEWERS = ["unstract_reviewer", ...ROLE_SUPERVISORS]) and replace the
inline arrays in getHITLMenuItems and the other place that checks
["unstract_reviewer","unstract_supervisor","unstract_admin"] with these
constants; update references in getHITLMenuItems (isSupervisorOrAdmin) and the
reviewer/supervisor checks so the logic is unchanged but duplication is removed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx`:
- Around line 184-196: Extract the repeated role arrays into named constants
(e.g., const ROLE_SUPERVISORS = ["unstract_supervisor", "unstract_admin"]; const
ROLE_REVIEWERS = ["unstract_reviewer", ...ROLE_SUPERVISORS]) and replace the
inline arrays in getHITLMenuItems and the other place that checks
["unstract_reviewer","unstract_supervisor","unstract_admin"] with these
constants; update references in getHITLMenuItems (isSupervisorOrAdmin) and the
reviewer/supervisor checks so the logic is unchanged but duplication is removed.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to Reviews > Disable Cache setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between cde0f07 and b8ac20f.

📒 Files selected for processing (3)
  • frontend/src/components/navigations/side-nav-bar/SideNavBar.css
  • frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx
  • frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx

@github-actions
Copy link
Contributor

Frontend Lint Report (Biome)

All checks passed! No linting or formatting issues found.

@sonarqubecloud
Copy link

@vishnuszipstack vishnuszipstack merged commit 983af92 into main Feb 27, 2026
7 checks passed
@vishnuszipstack vishnuszipstack deleted the feat/hitl-sidebar-nav-tabs branch February 27, 2026 05:52
vishnuszipstack added a commit that referenced this pull request Feb 27, 2026
The sidebar hover UX refactor in #1768 inadvertently removed all HITL
navigation code that was added in #1804 (UN-3240). This restores the
REVIEW section with role-based popover menu items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deepak-Kesavan pushed a commit that referenced this pull request Feb 27, 2026
)

* [FIX] Restore HITL sidebar navigation removed by sidebar refactor

The sidebar hover UX refactor in #1768 inadvertently removed all HITL
navigation code that was added in #1804 (UN-3240). This restores the
REVIEW section with role-based popover menu items.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [FIX] Restore HITL sidebar icon styling removed by sidebar refactor

Add back .sidebar-antd-icon CSS that was also removed by #1768. This
styles the antd FileProtectOutlined icon to match the sidebar theme
(grey by default, white on hover/active).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

5 participants