Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

feat(ui): Normalize typography hierarchy and improve sidebar active indicator#548

Merged
LucasSantana-Dev merged 1 commit intomainfrom
feat/typography-sidebar-polish
Mar 16, 2026
Merged

feat(ui): Normalize typography hierarchy and improve sidebar active indicator#548
LucasSantana-Dev merged 1 commit intomainfrom
feat/typography-sidebar-polish

Conversation

@LucasSantana-Dev
Copy link
Copy Markdown
Member

@LucasSantana-Dev LucasSantana-Dev commented Mar 16, 2026

Summary

  • Typography hierarchy: Normalize H2/H3 styles across landing sections for visual consistency
    • EcosystemSection H2: font-bold tracking-tightfont-extrabold tracking-[-0.02em] (matches CapabilitiesSection and CTASection)
    • CapabilitiesSection H3: text-basetext-lg for better visual weight on capability cards
  • Sidebar active indicator: Fix false-positive active state and polish transitions
    • Exact match for /dashboard route (previously matched all sub-routes like /dashboard/settings)
    • Conditionally hide left-border pseudo-element when sidebar is collapsed (prevents overlap with icon)
    • Add transition-colors duration-150 to both active/inactive states for smooth animation
    • Add scale-110 to active icon for visual weight in collapsed mode

Tasks covered

  • task_siza_typography_hierarchy
  • task_siza_sidebar_active_indicator

Summary by CodeRabbit

Release Notes

  • Style
    • Refined sidebar navigation active state styling with improved visual feedback and transitions
    • Increased heading font size in the Capabilities section for better readability
    • Enhanced heading styling in the Ecosystem section with bolder, more prominent typography

…ndicator

- EcosystemSection H2: font-bold tracking-tight → font-extrabold tracking-[-0.02em]
- CapabilitiesSection H3: text-base → text-lg for better visual hierarchy
- Sidebar: exact match for /dashboard route to prevent false-positive active state
- Sidebar: hide left-border pseudo-element when collapsed to prevent overlap
- Sidebar: add transition-colors duration-150 for smooth active state animation
- Sidebar: scale-110 on active icon for visual weight in collapsed mode
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
siza-web Ready Ready Preview, Comment Mar 16, 2026 8:09pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 16, 2026

Walkthrough

Three components were modified: Sidebar.tsx now uses specialized active state detection with exact match for dashboard and conditional transition styling; CapabilitiesSection.tsx increased heading font size from text-base to text-lg; EcosystemSection.tsx updated h2 styling from font-bold to font-extrabold with adjusted tracking.

Changes

Cohort / File(s) Summary
Dashboard Navigation
apps/web/src/components/dashboard/Sidebar.tsx
Active state detection now uses exact pathname match for "/dashboard" items and startsWith check for others; added scale-110 transform to active icons; consolidated styling with conditional before-element injection when sidebar not collapsed.
Landing Page Sections
apps/web/src/components/landing/CapabilitiesSection.tsx, apps/web/src/components/landing/EcosystemSection.tsx
Heading font sizes updated: CapabilitiesSection.tsx increased from text-base to text-lg; EcosystemSection.tsx changed h2 from font-bold tracking-tight to font-extrabold tracking-[-0.02em].

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the two main changes: typography hierarchy normalization and sidebar active indicator improvements.

✏️ 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/typography-sidebar-polish
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.16.4)
apps/web/src/components/dashboard/Sidebar.tsx

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m

apps/web/src/components/landing/CapabilitiesSection.tsx

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m

apps/web/src/components/landing/EcosystemSection.tsx

┌──────────────┐
│ Opengrep CLI │
└──────────────┘

�[32m✔�[39m �[1mOpengrep OSS�[0m
�[32m✔�[39m Basic security coverage for first-party code vulnerabilities.

�[1m Loading rules from local config...�[0m


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.

@github-actions
Copy link
Copy Markdown

Project Scorecard


Scorecard: 84/100 (B)
────────────────────────────────────────
  security: 100/100 (A)
  quality: 80/100 (B) — 1 violations
  performance: 67/100 (D) — 1 violations
  compliance: 75/100 (C) — 1 violations
  dependency: 100/100 (A)

Recommendations:
  - Increase test coverage to meet the 80% threshold
  - Extend log retention to at least 90 days for compliance

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@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

🧹 Nitpick comments (2)
apps/web/src/components/dashboard/Sidebar.tsx (2)

73-75: Prefer clsx for this active-class composition.

Lines 73-75 are getting difficult to maintain due to nested template composition. This is a good spot to switch to clsx.

Refactor sketch
+import clsx from 'clsx';
...
-const activeCls = isActive
-  ? `bg-brand/15 text-brand-light hover:bg-brand/20 transition-colors duration-150${collapsed ? '' : ' before:absolute before:left-0 before:top-1.5 before:bottom-1.5 before:w-0.5 before:rounded-full before:bg-brand'}`
-  : 'text-text-secondary hover:bg-surface-2 hover:text-text-primary transition-colors duration-150';
+const activeCls = clsx(
+  'transition-colors duration-150',
+  isActive
+    ? 'bg-brand/15 text-brand-light hover:bg-brand/20'
+    : 'text-text-secondary hover:bg-surface-2 hover:text-text-primary',
+  isActive &&
+    !collapsed &&
+    'before:absolute before:left-0 before:top-1.5 before:bottom-1.5 before:w-0.5 before:rounded-full before:bg-brand'
+);

As per coding guidelines, apps/web/src/components/**/*.{ts,tsx}: Use Radix UI + Tailwind CSS + shadcn/ui component pattern with class-variance-authority and clsx for styling.

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

In `@apps/web/src/components/dashboard/Sidebar.tsx` around lines 73 - 75, The
inline template for activeCls is brittle; refactor it to use clsx: import clsx
from 'clsx' and replace the template string assigned to activeCls with a clsx
call that conditionally includes the base classes, the active state classes
(bg-brand/15 text-brand-light hover:bg-brand/20 transition-colors duration-150),
the hover/secondary/default classes when not active, and the before:... utility
classes only when isActive && !collapsed; reference the activeCls variable, and
the isActive and collapsed booleans to build the conditional class list so the
composition is clearer and maintainable.

88-88: Smooth the active icon scale animation.

Line 88 applies scale-110 but only transitions color; adding transform transition will avoid a snap effect.

Optional polish
-className={`h-[18px] w-[18px] flex-shrink-0 transition-colors ${isActive ? 'text-brand-light scale-110' : ''}`}
+className={`h-[18px] w-[18px] flex-shrink-0 transition-colors transition-transform duration-150 ${isActive ? 'text-brand-light scale-110' : ''}`}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/components/dashboard/Sidebar.tsx` at line 88, The active icon
currently only transitions colors, causing the `scale-110` to snap; update the
className used for the icon (the JSX that builds the icon element in Sidebar.tsx
where className includes `transition-colors` and `${isActive ? 'text-brand-light
scale-110' : ''}`) to also transition transforms (e.g., add
`transition-transform` or replace with `transition-colors transition-transform`
/ `transition-all` and optionally set a duration like `duration-150`) so the
scale change animates smoothly when `isActive` toggles.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web/src/components/dashboard/Sidebar.tsx`:
- Around line 69-72: The current isActive check in Sidebar.tsx uses
pathname.startsWith(item.href) which can falsely match prefixes (e.g., /admin
matching /admin-something); update the logic around the isActive calculation to
perform a segment-boundary-safe check: consider a route active only if pathname
=== item.href or pathname starts with item.href followed by a slash (i.e.,
item.href + '/'), so use that boundary-aware condition when computing isActive
for the nav item (refer to the isActive variable, item.href, and pathname).

---

Nitpick comments:
In `@apps/web/src/components/dashboard/Sidebar.tsx`:
- Around line 73-75: The inline template for activeCls is brittle; refactor it
to use clsx: import clsx from 'clsx' and replace the template string assigned to
activeCls with a clsx call that conditionally includes the base classes, the
active state classes (bg-brand/15 text-brand-light hover:bg-brand/20
transition-colors duration-150), the hover/secondary/default classes when not
active, and the before:... utility classes only when isActive && !collapsed;
reference the activeCls variable, and the isActive and collapsed booleans to
build the conditional class list so the composition is clearer and maintainable.
- Line 88: The active icon currently only transitions colors, causing the
`scale-110` to snap; update the className used for the icon (the JSX that builds
the icon element in Sidebar.tsx where className includes `transition-colors` and
`${isActive ? 'text-brand-light scale-110' : ''}`) to also transition transforms
(e.g., add `transition-transform` or replace with `transition-colors
transition-transform` / `transition-all` and optionally set a duration like
`duration-150`) so the scale change animates smoothly when `isActive` toggles.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27056ed0-01bd-47b8-8daf-28da6fbdc00b

📥 Commits

Reviewing files that changed from the base of the PR and between 44eb25a and 21a8036.

📒 Files selected for processing (3)
  • apps/web/src/components/dashboard/Sidebar.tsx
  • apps/web/src/components/landing/CapabilitiesSection.tsx
  • apps/web/src/components/landing/EcosystemSection.tsx

Comment on lines +69 to +72
const isActive =
item.href === '/dashboard'
? pathname === item.href
: pathname.startsWith(item.href);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

nav_file="$(fd -a 'navigation\.(ts|tsx)$' apps/web/src/components/dashboard | head -n1)"
echo "Navigation file: $nav_file"

# Inspect dashboard href declarations
rg -nP "href\s*:\s*['\"]/dashboard[^'\"]*['\"]" "$nav_file"

# Detect potential prefix-collision pairs in declared hrefs
python - "$nav_file" <<'PY'
import re, sys, pathlib
p = pathlib.Path(sys.argv[1])
text = p.read_text(encoding="utf-8")
hrefs = sorted(set(re.findall(r"href\s*:\s*['\"]([^'\"]+)['\"]", text)))

print("\nFound hrefs:")
for h in hrefs:
    print(" -", h)

print("\nPotential prefix collisions (a is prefix of b without '/' boundary):")
found = False
for a in hrefs:
    for b in hrefs:
        if a == b:
            continue
        if b.startswith(a) and not b.startswith(a + "/"):
            found = True
            print(f" - {a} vs {b}")
if not found:
    print(" - none")
PY

Repository: Forge-Space/siza

Length of output: 487


🏁 Script executed:

#!/bin/bash
# Get the file size first
wc -l apps/web/src/components/dashboard/Sidebar.tsx

# Show the relevant section with more context
sed -n '60,80p' apps/web/src/components/dashboard/Sidebar.tsx

# Check if there are any nested sub-routes beyond top-level in the router/app config
fd -e 'tsx' -e 'ts' apps/web/src/app | head -20

Repository: Forge-Space/siza

Length of output: 1534


🏁 Script executed:

#!/bin/bash
# Check app directory structure for nested routes
fd . apps/web/src/app --type f -e tsx -e ts | head -30

# Also check if there are any dynamic route segments or nested structure
find apps/web/src/app -type d 2>/dev/null | head -20

Repository: Forge-Space/siza

Length of output: 2345


Refactor active route matching to segment-boundary safe approach.

No prefix collisions exist in the current navigation structure, but the route matching should be hardened to prevent false positives in future additions. Line 72 currently uses pathname.startsWith(item.href), which would incorrectly activate a /admin item if a route like /admin-something were added. Use a segment-boundary check instead.

Proposed fix
 const isActive =
   item.href === '/dashboard'
     ? pathname === item.href
-    : pathname.startsWith(item.href);
+    : pathname === item.href || pathname.startsWith(`${item.href}/`);
📝 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
const isActive =
item.href === '/dashboard'
? pathname === item.href
: pathname.startsWith(item.href);
const isActive =
item.href === '/dashboard'
? pathname === item.href
: pathname === item.href || pathname.startsWith(`${item.href}/`);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/components/dashboard/Sidebar.tsx` around lines 69 - 72, The
current isActive check in Sidebar.tsx uses pathname.startsWith(item.href) which
can falsely match prefixes (e.g., /admin matching /admin-something); update the
logic around the isActive calculation to perform a segment-boundary-safe check:
consider a route active only if pathname === item.href or pathname starts with
item.href followed by a slash (i.e., item.href + '/'), so use that
boundary-aware condition when computing isActive for the nav item (refer to the
isActive variable, item.href, and pathname).

@LucasSantana-Dev LucasSantana-Dev merged commit 6fe8f80 into main Mar 16, 2026
45 of 46 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant