Tabs ( Header Navigation )

View 2: Header Navigation – Tabs
 

This version is written as official product + technical documentation, with clear flow, conceptual explanation, and visual anchoring, while fully preserving your logic and implementation details.

 

Overview
 

The Header Navigation is the primary filtering layer of the Tabs system.
It appears as a top horizontal navigation bar and allows users to instantly filter the customer list by clicking on tabs.
 

Each tab in the header represents a customer segmentation rule:
 

“Show me only customers that have records in this tab.”


This view transforms tabs from simple data containers into real-time filtering tools that drive daily workflow and navigation.
 



Purpose of Header Tab Filtering
 

The Header Navigation exists to:
 

  • Provide one-click customer segmentation

  • Allow users to switch contexts instantly

  • Reduce manual filtering and searching

  • Surface operational data directly in navigation

  • Make tab-based workflows accessible without entering customer profiles
     

This is the fastest way to answer questions like:
 

  • “Which customers have open tasks?”

  • “Which customers are in this workflow stage?”

  • “Which customers have onboarding records?”
     



Location and Visibility
 

  • UI Location: Top horizontal header

  • Visibility: Always visible when logged in
     

The header is loaded on every authenticated page, making tab filtering globally accessible.
 



Access and Display Conditions
 

A tab appears in the header only when all conditions are met:
 

  1. Header Visibility Enabled
     

    • show_in_header = 1 in Tab Settings
       

  2. User Has Access
     

    • User is owner or admin

    • OR tab is shared with the user via shard_with
       

  3. Folder Compatibility
     

    • Tab is assigned to at least one folder

    • User has access to at least one of those folders
       

  4. Not Already Rendered
     

    • Prevents duplicate display

    • Tabs inside groups are not rendered again as standalone items
       

This ensures the header remains:
 

  • Clean

  • Relevant

  • Permission-safe



Visual Structure of the Header
 

The header contains three visual zones:
 

  1. Brand / Logo Area – Left

  2. Tabs Navigation Area – Center / Right

  3. User Controls – Right

    • Notifications

    • Time tracking

    • Profile menu

Tabs live in the navigation area, where they act as interactive filters.
 



Tab Display Types
 

Individual Tabs
 

  • Displayed as horizontal list items

  • Blue text color (#5864ff)

  • Clickable

  • Tooltip on hover

  • Active tab shows a red underline

Each individual tab filters customers directly.
 



Tab Groups (Dropdowns)
 

Tab Groups are used to organize related tabs.
 

  • Group name shown in bold blue (#0214ff)

  • Dropdown expands on click

  • Child tabs listed inside

  • Child tabs behave exactly like individual tabs
     

Groups improve usability when the number of tabs grows.
 



How Tabs Are Rendered (Execution Logic)
 

Rendering Flow
 

  1. Initialize HTML containers

  2. Load tab group definitions

  3. Render grouped tabs first

  4. Track rendered tab IDs

  5. Render remaining individual tabs

  6. Output combined HTML
     

This ensures:
 

  • Correct ordering

  • No duplicates

  • Group priority respected
     



Tab Click Behavior (User Interaction)
 

When a user clicks a tab:
 

  1. Clear Previous Active State
     

    • Remove active_tab from all tabs
       

  2. Set Active Tab
     

    • Add active_tab class

    • Show red underline
       

  3. Capture Tab ID
     

    • Read data_tab_setting_id
       

  4. Trigger Customer Reload
     

    • Pass tab ID as filter parameter

    • Refresh customer list
       

  5. Persist State
     

    • Stored in session

    • Survives page refresh
       

The UI responds instantly, giving immediate feedback.
 



How Customer Filtering Works
 

Backend Filtering Logic
 

  1. Identify active tab ID

  2. Query tabs table:

    • Find all records with tab_id = active_tab

  3. Extract unique cust_id values

  4. Filter customer list by these IDs

  5. Return filtered dataset to UI
     

Only customers with at least one record in the selected tab are displayed.



Tab Groups – Structure and Behavior
 

Tab groups are stored as JSON and define:
 

  • Group names (multi-language)

  • Order in header

  • Tabs inside each group

  • Position of each tab within group
     

Behavior:
 

  • Click group → expand/collapse

  • Click child tab → apply filter

  • Groups do not filter on their own
     



Performance & Optimization
 

  • Tabs loaded in a single query

  • Indexed by ID for fast lookup

  • Group structure cached

  • Minimal DOM updates on click
     

This ensures:
 

  • Fast header rendering

  • Smooth filtering experience

  • Scalability for many tabs
     



Integration with Other Views
 

With Settings
 

  • Header visibility controlled from Tab Settings

  • Changes apply immediately
     

With Customer View
 

  • Active tab context preserved

  • Seamless navigation
     

With Tab Groups
 

  • Groups created in settings

  • Reflected dynamically in header
     



Common Issues & Troubleshooting
 

Tab Not Visible
 

  • Check show_in_header

  • Verify sharing permissions

  • Confirm folder assignment

  • Check group configuration
     

Click Does Nothing
 

  • Verify JS loaded

  • Check console errors

  • Ensure valid tab ID
     

Active State Missing
 

  • CSS not loaded

  • Class override issue
     

Group Not Expanding
 

  • Invalid JSON structure

  • JS conflict

  • CSS missing
     



Final Conceptual Summary
 

The Header Navigation is not just a menu.
 

It is:
 

  • A real-time filtering engine

  • A visual workflow selector

  • A customer segmentation tool

  • A navigation accelerator
     



Final One-Line Understanding
 

The Header Navigation is the real-time filtering layer that transforms tab data into instant customer segmentation through clickable tabs in the top navigation bar.

 

 

 

information_img