Skip to content

feat(workspace): add expandable sidebar navigation - #1185

Open
SalemOurabi wants to merge 2 commits into
4gray:masterfrom
SalemOurabi:workspace-sidebar-navigation
Open

feat(workspace): add expandable sidebar navigation#1185
SalemOurabi wants to merge 2 commits into
4gray:masterfrom
SalemOurabi:workspace-sidebar-navigation

Conversation

@SalemOurabi

Copy link
Copy Markdown
Contributor

What changed

  • replace the duplicate Dashboard entry with a dedicated sidebar expansion toggle
  • show the IPTVnator brand and localized navigation labels while the rail is expanded
  • support LTR and RTL label alignment across all shipped locales
  • add a Dock-inspired icon magnification effect for the hovered item only, while keeping the toggle and labels stable
  • keep the navigation rail responsive and preserve the compact mobile layout
  • document the workspace shell behavior and add unit/E2E regression coverage

Why

The workspace rail previously used a second Dashboard-looking control for expansion, did not expose navigation labels, and lacked clear hover feedback. The dedicated toggle and expanded labels make the navigation easier to understand without changing the compact default layout.

User impact

Users can expand the sidebar to see translated destination names, collapse it back to icon-only navigation, and get stronger hover feedback without neighboring icons or text scaling. RTL locales align the expanded navigation correctly.

Validation

  • pnpm nx test workspace-shell-feature (117 tests passed)
  • pnpm nx lint workspace-shell-feature
  • pnpm nx lint electron-backend-e2e (0 errors; existing warnings only)
  • pnpm nx run electron-backend-e2e:e2e-ci--src/smoke.e2e.ts (4 passed)
  • verified translation JSON validity and key parity across 18 locales
  • git diff --check

Copy link
Copy Markdown
Contributor Author

@greptileai Please review this pull request, with particular attention to sidebar expansion/collapse behavior, LTR/RTL layout, hover and icon magnification states, responsive behavior, and navigation regressions.

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown

Greptile Summary

This follow-up revision specifically addresses the two previously flagged concerns: the prefers-reduced-motion specificity gap that let the hover scale fire as an instant size jump, and the insufficient gap between a scaled icon and its expanded-rail label.

  • Reduced-motion fix: Both SCSS files now include :hover mat-icon selectors inside @media (prefers-reduced-motion: reduce), matching the specificity of the hover animation rule (0,2,1). Because the reduced-motion block appears later in each file, transform: none now wins when both media queries match simultaneously — the scale cannot fire even as an instant jump.
  • Overflow clearance fix: The gap in .rail-links.is-expanded .portal-rail-link is now calc(12px + var(--rail-dock-hover-overhang)) (= 23 px), placing the label's left edge at ≈ 55 px while the scaled icon's painted right edge reaches only ≈ 43 px — roughly 12 px of clearance. The same corrected gap is applied to the footer settings shortcut.
  • Structural changes: The old brand <a> link is replaced by a dedicated <button class="rail-toggle"> with two-way model binding, compact-breakpoint auto-collapse via MediaQueryList, and RTL direction logic keyed on the active translation language.

Confidence Score: 5/5

The follow-up revision correctly addresses both previously flagged concerns; no new functional defects were found.

Both the reduced-motion specificity gap and the label-overlap gap have been closed. The hover scale can no longer fire for users who prefer reduced motion, and the expanded-mode gap is large enough (≈12 px clearance) to prevent icon-label paint overlap. The compact-breakpoint auto-collapse, RTL detection, and two-way model binding are all correctly implemented and well-tested.

No files require special attention.

Important Files Changed

Filename Overview
libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-rail-links/workspace-shell-rail-links.component.scss Adds expanded-rail layout with calc(12px + var(--rail-dock-hover-overhang)) gap; reduced-motion block now includes :hover mat-icon at matching specificity — previous scale-on-reduced-motion bug is resolved.
libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-rail/workspace-shell-rail.component.scss Updated prefers-reduced-motion block now includes both a:hover mat-icon and button:hover mat-icon at specificity 0,2,1; appears after the hover animation block so transform: none wins when both media queries match.
libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-rail/workspace-shell-rail.component.ts Replaces brand-link inputs with expanded model; adds compact-state detection via MediaQueryList with proper cleanup in DestroyRef; RTL detection and two-way binding are correctly implemented.
libs/workspace/shell/feature/src/lib/workspace-shell/workspace-shell.component.ts Adds railExpanded signal wired to the rail's expandedChange output; clean and minimal change.
libs/workspace/shell/feature/src/lib/workspace-shell/components/workspace-shell-rail/workspace-shell-rail.component.spec.ts New tests cover toggle semantics, compact-mode rejection of expanded state, and RTL direction switching; good coverage of the new behavior.
apps/electron-backend-e2e/src/smoke.e2e.ts New E2E smoke test validates expand/collapse round-trip, icon scale value (≈2.1), label no-scale, neighbor icon no-scale, and bounding-box containment; comprehensive regression coverage.
libs/workspace/shell/feature/src/lib/workspace-shell/workspace-shell-layout.constants.ts New file; exports the compact breakpoint as a TypeScript constant aligned with _breakpoints.scss — comment reminds maintainers to keep both in sync.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User clicks rail-toggle button] --> B{isCompact?}
    B -- Yes --> C[toggleExpanded returns early\nno state change]
    B -- No --> D[expanded.update toggled]
    D --> E[expandedChange emits new value]
    E --> F[Parent: railExpanded.set value]
    F --> G{New value true?}
    G -- Yes --> H[rail gets .is-expanded class\nLabels rendered\nTooltips disabled\nGrid column: max-content]
    G -- No --> I[rail collapses to 60 px icon-only\nLabels hidden\nTooltips re-enabled]

    J[isCompact signal changes to true] --> K{expanded currently true?}
    K -- Yes --> L[effect sets expanded false]
    L --> E
    K -- No --> M[No action needed]

    subgraph CSS Motion
        N[hover: hover AND pointer: fine] --> O[mat-icon scale 2.1x\nspecificity 0,2,1]
        P[prefers-reduced-motion: reduce\nspecificity 0,2,1 — later in file] --> Q[transform: none wins\ntransition: none]
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[User clicks rail-toggle button] --> B{isCompact?}
    B -- Yes --> C[toggleExpanded returns early\nno state change]
    B -- No --> D[expanded.update toggled]
    D --> E[expandedChange emits new value]
    E --> F[Parent: railExpanded.set value]
    F --> G{New value true?}
    G -- Yes --> H[rail gets .is-expanded class\nLabels rendered\nTooltips disabled\nGrid column: max-content]
    G -- No --> I[rail collapses to 60 px icon-only\nLabels hidden\nTooltips re-enabled]

    J[isCompact signal changes to true] --> K{expanded currently true?}
    K -- Yes --> L[effect sets expanded false]
    L --> E
    K -- No --> M[No action needed]

    subgraph CSS Motion
        N[hover: hover AND pointer: fine] --> O[mat-icon scale 2.1x\nspecificity 0,2,1]
        P[prefers-reduced-motion: reduce\nspecificity 0,2,1 — later in file] --> Q[transform: none wins\ntransition: none]
    end
Loading

Reviews (3): Last reviewed commit: "fix(workspace): harden sidebar magnifica..." | Re-trigger Greptile

@SalemOurabi
SalemOurabi marked this pull request as ready for review July 15, 2026 03:11
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 78.43137% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.07%. Comparing base (e91cbd5) to head (79fa051).
⚠️ Report is 1992 commits behind head on master.

Files with missing lines Patch % Lines
...space-shell-rail/workspace-shell-rail.component.ts 72.50% 6 Missing and 5 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

❗ There is a different number of reports uploaded between BASE (e91cbd5) and HEAD (79fa051). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (e91cbd5) HEAD (79fa051)
4 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1185       +/-   ##
===========================================
- Coverage   71.05%   59.07%   -11.99%     
===========================================
  Files          40      594      +554     
  Lines         691    34303    +33612     
  Branches       87     7751     +7664     
===========================================
+ Hits          491    20263    +19772     
- Misses        176    11088    +10912     
- Partials       24     2952     +2928     
Flag Coverage Δ
unit 59.07% <78.43%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SalemOurabi

Copy link
Copy Markdown
Contributor Author

@greptileai please re-review the latest sidebar follow-up, especially reduced-motion hover behavior and expanded-label overflow containment.

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.

2 participants