Skip to content

feat: establish UI/UX foundation with Tailwind CSS, shadcn, Recharts and d3#29

Open
Sarthakkad05 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Sarthakkad05:feat/ui-foundation-v3
Open

feat: establish UI/UX foundation with Tailwind CSS, shadcn, Recharts and d3#29
Sarthakkad05 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Sarthakkad05:feat/ui-foundation-v3

Conversation

@Sarthakkad05
Copy link
Copy Markdown
Contributor

@Sarthakkad05 Sarthakkad05 commented Feb 26, 2026

closes #17

UI Foundation Setup for Org Explorer

This PR establishes the foundational UI stack for Org Explorer, enabling consistent, scalable, and maintainable frontend development moving forward.

Screenshot 2026-02-17 at 6 43 30 PM

What This PR Introduces

1. Tailwind CSS Setup

  • Utility-first styling for rapid and consistent UI development
  • Centralized theme tokens in index.css
  • Basic design tokens aligned with AOSSIE branding (green + yellow)

2. shadcn/ui

  • Added core reusable components:
    • Button
    • Card
    • Badge
  • We can add this components with just one command now

3. Recharts Integration

  • Installed and configured for data visualization
  • Added a small TestChart component to validate chart rendering
  • Confirms compatibility with Tailwind and layout system

4. D3 Integration (Low-Level Visualization Support)

  • Installed and configured D3 with TypeScript support
  • Added a D3Demo component to demonstrate raw SVG rendering.

5. Added clear, structured comments across demo components to:

  • Explain architectural intent
  • Help future contributors understand visualization setup
  • Maintain consistency when extending charts or UI primitives

Why This Matters

Org Explorer is a UI-driven platform (dashboards, charts, repo cards, governance views).
This PR creates a scalable design system foundation before introducing business logic.

Checklist

  • [x ] My code follows the project's code style and conventions
  • [ x] I have made corresponding changes to the documentation
  • [ x] My changes generate no new warnings or errors
  • [x ] I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • [ x] I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

Release Notes

New Features

  • Added UI component library with Button, Badge, and Card components for building user interfaces
  • Introduced charting capabilities with interactive chart visualizations
  • Created demo showcase displaying chart examples and features

Style

  • Integrated Tailwind CSS with CSS variable-based theming system
  • Implemented light and dark mode support

Chores

  • Configured project styling framework and module resolution
  • Added charting and UI component dependencies

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 26, 2026

Walkthrough

A comprehensive UI and styling foundation is established for the project. This includes Tailwind CSS and PostCSS configuration, shadcn/ui component patterns (button, badge, card), chart components using Recharts and D3, a DemoShowcase component displaying demo implementations, utility functions for class name merging, and TypeScript/Vite module path aliases for improved imports.

Changes

Cohort / File(s) Summary
Framework & Build Configuration
components.json, tailwind.config.js, postcss.config.js, vite.config.ts
Introduces Tailwind CSS with PostCSS, shadcn/ui framework config with tsx/tailwind enabled, animations plugin, and Vite path aliasing for "@" imports to src directory.
TypeScript Configuration
tsconfig.json, tsconfig.app.json
Adds baseUrl and path aliases mapping "@/\" to "src/\" for absolute imports across TypeScript compilation contexts.
Dependencies
package.json
Adds UI/component libraries (@radix-ui/react-slot, class-variance-authority), visualization libraries (d3, recharts), styling utilities (clsx, tailwind-merge, tailwindcss-animate), and dev dependencies (tailwindcss, postcss, autoprefixer, type definitions).
Global Styling & Root Layout
src/index.css, src/App.css
Replaces vanilla CSS with Tailwind directives; introduces CSS variable-based theming system (HSL tokens for colors, radius); changes root layout to full-viewport height instead of centered container.
Utility Functions
src/lib/utils.ts
Adds cn utility function that merges and deduplicates Tailwind class names by composing clsx with tailwind-merge.
UI Component Library
src/components/ui/button.tsx, src/components/ui/badge.tsx, src/components/ui/card.tsx
Implements reusable UI primitives using class-variance-authority for variant styling and Radix Slot for polymorphic composition; Button, Badge, and Card (with subcomponents) exported as unstyled, composable bases.
Chart Demo Components
src/components/charts/TestChart.tsx, src/components/charts/D3Demo.tsx
Creates two demo chart implementations: TestChart uses Recharts for a responsive line chart; D3Demo implements D3-based line chart with scales, axes, and SVG rendering via useEffect.
Demo Showcase & App Entry
src/components/common/DemoShowcase.tsx, src/App.tsx
DemoShowcase component orchestrates demo layout with header, Recharts demo card, and D3 demo card; App refactored to render DemoShowcase instead of inline JSX.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

Typescript Lang

Suggested reviewers

  • Zahnentferner

Poem

🐰 Hop, hop, components take their place,
Tailwind colors paint the space,
Charts will dance and buttons glow,
A foundation's bloom—let visions flow!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'establish UI/UX foundation with Tailwind CSS, shadcn, Recharts and d3' clearly and accurately summarizes the main changes throughout the changeset.
Linked Issues check ✅ Passed All objectives from issue #17 are met: Tailwind CSS configured with design tokens in index.css and tailwind.config.js; shadcn/ui integrated with Button, Card, Badge components; Recharts integrated with TestChart demo; D3 integrated with D3Demo component; DemoShowcase page consolidates all demos.
Out of Scope Changes check ✅ Passed All changes align with issue #17 objectives. Configuration files (postcss.config.js, tsconfig updates, vite.config.ts) support the UI foundation setup. Demo components and UI utilities directly serve the visualization and styling goals.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 github-actions bot added size/XL and removed size/XL labels Feb 26, 2026
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: 14

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

Inline comments:
In `@src/App.css`:
- Line 2: Replace the static mobile-unfriendly min-height declaration
"min-height: 100vh;" in src/App.css with a dynamic viewport height pattern:
provide "min-height: 100dvh" and keep "min-height: 100vh" as a fallback so
browsers that don't support dvh still work; update the rule where "min-height:
100vh" appears to use the fallback-first pattern (100vh) then override with
100dvh for supporting browsers.

In `@src/components/charts/D3Demo.tsx`:
- Around line 18-24: The array "data" in D3Demo.tsx uses hardcoded English month
strings (DataPoint[] with month values "Jan", "Feb", etc.); add a concise inline
comment above the "data" declaration noting these are demo-only hardcoded
English strings and should be externalized or provided via props/intl for i18n
in production, and optionally update D3Demo to accept month labels through props
or a localization function (e.g., a "labels" prop or using an i18n utility) so
future contributors know how to replace the hardcoded months.
- Around line 82-86: The SVG rendered by the D3Demo component lacks
accessibility attributes; update the JSX for the <svg ref={svgRef} /> in D3Demo
to include role="img" and an aria-label (or aria-labelledby) and render a
<title> element inside the SVG (use a stable id and reference it via
aria-labelledby) so screen readers can announce the chart; source the title text
from a prop or an internal accessibleTitle variable and ensure svgRef usage
remains unchanged.
- Around line 29-80: The useEffect in D3Demo.tsx that manipulates the DOM via
svgRef should return a cleanup function that removes D3-added elements and
clears any event listeners to avoid stale DOM references on unmount or
re-render; inside the effect (where svg is created via
d3.select(svgRef.current)) add and return () => { svg.selectAll("*").remove();
/* also remove any listeners if added, e.g. svg.on(..., null) */ } so the svg
and its handlers are explicitly cleaned up on unmount.
- Around line 60-66: The hardcoded stroke color in the D3 path (.attr("stroke",
"#2e8b57") in D3Demo.tsx) should be replaced with a theme token; update the path
creation to use a CSS variable or Tailwind token instead of the hex literal
(e.g., read a CSS var like --aossie-green or apply a class that defines stroke),
ensure the D3 attr uses that variable or class name so the path stroke is driven
by centralized theme tokens rather than the hardcoded "#2e8b57".

In `@src/components/charts/TestChart.tsx`:
- Around line 18-24: The hard-coded month labels in the TestChart component's
data array should be replaced with localized strings; edit the const data in
src/components/charts/TestChart.tsx to use your i18n lookup instead of literal
"Jan"/"Feb"/... (for example, import your translation hook/function such as
useTranslation or t and replace each month with t('months.jan'),
t('months.feb'), etc., or build data from an array of month keys mapped through
the translator); ensure the chart still receives the same shape ({ month:
<localized string>, value: number }) so rendering code (the TestChart component)
is unchanged.
- Line 34: Replace the hard-coded stroke="#2e8b57" on the Line element in
TestChart with a theme token value: read the app theme via your project's theme
hook (e.g., useTheme in TestChart) and pass the token path (for example
theme.colors.chart.stroke or theme.palette.success/main depending on your theme
shape) into stroke as a JS expression; add the necessary import for the theme
hook and use that token in the Line component so the chart color follows
centralized design tokens.

In `@src/components/common/DemoShowcase.tsx`:
- Around line 24-44: Replace hardcoded user-facing strings in the DemoShowcase
component (the <h1> "Org Explorer", the Button label "Ready to Explore", and the
section <h2> headings "Recharts Example" and "D3 Example (Raw SVG)") with
localization keys from your i18n resource; import and use the app's translation
helper (e.g., t or useTranslation) at the top of the component, add meaningful
keys like demo.title, demo.cta, demo.rechartsTitle, demo.d3Title to the language
JSON/resource files, and update the JSX to render those translated values
instead of literal strings so the UI uses externalized resources.
- Around line 19-50: Replace the top-level non-semantic div wrapper in the
DemoShowcase component with a semantic landmark element: change the outermost
<div className="min-h-screen bg-background text-foreground px-6 py-10"> to a
<main> element with the same className so the DOM uses a proper page landmark;
ensure the component (DemoShowcase) preserves all children (the inner container,
demo sections, TestChart and D3Demo) and their className props exactly while
only swapping the wrapper element to <main>.

In `@src/components/ui/badge.tsx`:
- Line 4: Update the import in Badge component to use the project's path alias
instead of a relative path: replace the relative import of the utility function
cn (import { cn } from "../../lib/utils.ts") with the configured alias import
(import { cn } from "@/lib/utils") so the Badge component consistently uses the
project's path aliases.

In `@src/components/ui/button.tsx`:
- Line 5: Replace the relative import of the `cn` utility in
src/components/ui/button.tsx (currently imported from "../../lib/utils.ts") with
the project path alias import (e.g., "@/lib/utils") to match other components
like Badge and keep imports consistent across the codebase; update the import
statement that references `cn` accordingly.

In `@src/index.css`:
- Around line 20-55: The theme is missing several CSS variables used by
shadcn/ui (add definitions for --ring, --input, --secondary,
--secondary-foreground, --destructive, and --destructive-foreground) in both
:root and the .dark scope so Button/Badge variants render correctly; update the
:root block to define those variables (using HSL or matching semantic tones to
your existing --primary/--accent/--background choices) and add corresponding
dark-mode values inside the .dark selector to ensure consistent colors for focus
rings, inputs, secondary and destructive variants.

In `@tailwind.config.js`:
- Around line 17-38: theme.extend.colors is missing the color tokens used by
Button/Badge (secondary, destructive, ring, input); update the colors object in
tailwind.config.js to add entries for secondary (with DEFAULT and foreground),
destructive (with DEFAULT and foreground), ring, and input (with DEFAULT and
foreground) following the same structure as primary and accent and the existing
chart tokens so the Tailwind classes used by Button and Badge resolve correctly.

In `@vite.config.ts`:
- Around line 3-12: The config uses __dirname in the ESM Vite file causing
ReferenceError; replace that pattern by deriving the directory from
import.meta.url using fileURLToPath to compute the project root before calling
path.resolve for the alias. Update the vite config where resolve.alias is set
(the alias block referencing path.resolve(__dirname, "./src")) to compute a
const like projectDir = path.dirname(fileURLToPath(import.meta.url)) and then
use path.resolve(projectDir, "./src") so alias resolution works in ESM.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cfc3e7 and 8324a8c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (17)
  • components.json
  • package.json
  • postcss.config.js
  • src/App.css
  • src/App.tsx
  • src/components/charts/D3Demo.tsx
  • src/components/charts/TestChart.tsx
  • src/components/common/DemoShowcase.tsx
  • src/components/ui/badge.tsx
  • src/components/ui/button.tsx
  • src/components/ui/card.tsx
  • src/index.css
  • src/lib/utils.ts
  • tailwind.config.js
  • tsconfig.app.json
  • tsconfig.json
  • vite.config.ts

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.

[FEATURE]: Establish UI & Visualization Foundation for Org Explorer

1 participant