Skip to content

feat: background Shape component#40

Merged
lorenzocorallo merged 8 commits intomainfrom
toto04/shapes
Mar 17, 2026
Merged

feat: background Shape component#40
lorenzocorallo merged 8 commits intomainfrom
toto04/shapes

Conversation

@toto04
Copy link
Contributor

@toto04 toto04 commented Mar 5, 2026

SVGs where taken from figma and optimized for distribution with svgo

I figured having a single component for all shapes would be easier for quick UI iterations, but we might consider other options for this

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9371e6b4-c4cb-4d34-8699-c7787ff535c5

📥 Commits

Reviewing files that changed from the base of the PR and between 806de80 and e336f0c.

📒 Files selected for processing (3)
  • .github/workflows/test.yml
  • package.json
  • src/components/shapes.tsx

Walkthrough

Adds a new Shape component for rendering decorative SVG graphics, updates formatter and linter configurations to enforce class ordering, reorders existing Tailwind classes for consistency, removes the baseUrl from TypeScript config, updates the pnpm version, and modifies the CI workflow to run builds earlier.

Changes

Cohort / File(s) Summary
Shape Component Addition
src/app/layout.tsx, src/components/shapes.tsx
Introduces Shape component module with four SVG variants (big-blue, big-teal, small-blue, looper) and injects instances into the layout for decorative positioning behind content.
Tailwind Class Reordering
src/app/not-found.tsx, src/components/glass.tsx, src/components/header.tsx, src/components/ui/input.tsx, src/components/ui/select.tsx
Reorders CSS utility classes across multiple components to enforce consistent class sequencing without altering visual styling or behavior.
Formatter and Linter Configuration
.vscode/settings.json, biome.jsonc
Adds JSONC-specific formatter mapping in VSCode settings and introduces linter.useSortedClasses configuration with "info" level and "safe" fix mode in Biome.
TypeScript Configuration
tsconfig.json
Removes the baseUrl property from compilerOptions while preserving all other configuration settings.
Dependency and Workflow Updates
package.json, .github/workflows/test.yml
Updates pnpm package manager from version 10.17.1 to 10.32.1 with checksum, upgrades actions/setup-node to v6, and relocates the Build step earlier in the CI pipeline.
🚥 Pre-merge checks | ✅ 1 | ❌ 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 (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: background Shape component' directly and clearly describes the main change: introducing a new Shape component for background styling.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can generate walkthrough in a markdown collapsible section to save space.

Enable the reviews.collapse_walkthrough setting to generate walkthrough in a markdown collapsible section.

Copy link

@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: 3

🤖 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/layout.tsx`:
- Around line 64-67: The absolute-positioned Shape components are rendered
without a positioned ancestor, causing their negative z-index (e.g., -z-10) to
behave unpredictably; wrap the group of Shape elements in a positioned stacking
context (e.g., add a wrapper element with position set, such as
className="relative z-0" or equivalent) so Shape (from
src/components/shapes.tsx) has a positioned ancestor and its z-index and
placement behave consistently across viewports and the page root.

In `@src/components/shapes.tsx`:
- Around line 34-35: The image is marked aria-hidden but still uses a
descriptive alt={`${variant} shape`}; update the component's image element so
that when aria-hidden is present the alt prop is an empty string (alt="")
instead of using variant text—locate the image JSX in src/components/shapes.tsx
(the element with aria-hidden and alt props referencing `variant`) and change
the alt assignment accordingly so decorative shapes don't expose
redundant/incorrect alt text to assistive tech.
- Around line 2-5: Add a TypeScript module declaration for "*.svg" (e.g., create
src/types/svg.d.ts) that exports StaticImageData so imports like bigBlueSvg,
bigTealSvg, looperSvg, and smallBlueSvg are type-safe; then fix the decorative
image accessibility in the component where the Image element is absolutely
positioned and uses both aria-hidden and a descriptive alt: choose either to
keep a meaningful alt and remove aria-hidden, or set alt="" and keep aria-hidden
to mark it decorative (update the Image usage accordingly).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2f03b2bb-9dc7-42f0-b5ca-e2d3b4da5489

📥 Commits

Reviewing files that changed from the base of the PR and between 26f93aa and 0a1dbc5.

⛔ Files ignored due to path filters (4)
  • src/assets/shapes/big-blue.svg is excluded by !**/*.svg
  • src/assets/shapes/big-teal.svg is excluded by !**/*.svg
  • src/assets/shapes/looper.svg is excluded by !**/*.svg
  • src/assets/shapes/small-blue.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • src/app/layout.tsx
  • src/components/shapes.tsx

Copy link

@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 (1)
src/components/shapes.tsx (1)

26-28: Consider exhaustive type checking instead of unreachable default.

The default case returns "" which would produce an invalid Image src. While TypeScript's type system ensures this branch is unreachable at runtime, you could make this explicit:

♻️ Proposed refactor using exhaustive check
       case "looper":
         return looperSvg
       default:
-        return ""
+        variant satisfies never
+        throw new Error(`Unknown shape variant: ${variant}`)
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/shapes.tsx` around lines 26 - 28, The switch that currently
falls back to `default: return ""` (producing an invalid Image src) should use
an exhaustive type check instead: remove the default returning empty string and
add an assertion for unreachable cases (e.g., an `assertUnreachable` helper
taking a `never` or `throw new Error("Unsupported shape: " + shape)`) so the
compiler verifies all shape cases are handled and any unexpected value fails
loudly; update the function that maps shape/type to Image src (the switch in
components/shapes.tsx) to use this pattern and ensure the Image `src` never
receives an empty string.
🤖 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/page.tsx`:
- Line 8: The h2 element with className "typo-headline-large bg mb-4 font-bold"
contains an invalid/incomplete Tailwind utility `bg`; remove `bg` or replace it
with a complete background utility (for example `bg-background-blur`,
`bg-button-primary`, or `bg-red-500`) to match the project's naming conventions
and other usages; update the className on the h2 element in page.tsx
accordingly.

---

Nitpick comments:
In `@src/components/shapes.tsx`:
- Around line 26-28: The switch that currently falls back to `default: return
""` (producing an invalid Image src) should use an exhaustive type check
instead: remove the default returning empty string and add an assertion for
unreachable cases (e.g., an `assertUnreachable` helper taking a `never` or
`throw new Error("Unsupported shape: " + shape)`) so the compiler verifies all
shape cases are handled and any unexpected value fails loudly; update the
function that maps shape/type to Image src (the switch in components/shapes.tsx)
to use this pattern and ensure the Image `src` never receives an empty string.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 54733417-a0ae-4eac-aabd-4e0df9401b96

📥 Commits

Reviewing files that changed from the base of the PR and between 0a1dbc5 and 97fbdea.

📒 Files selected for processing (12)
  • .vscode/settings.json
  • biome.jsonc
  • package.json
  • src/app/layout.tsx
  • src/app/not-found.tsx
  • src/app/page.tsx
  • src/components/glass.tsx
  • src/components/header.tsx
  • src/components/shapes.tsx
  • src/components/ui/input.tsx
  • src/components/ui/select.tsx
  • tsconfig.json
✅ Files skipped from review due to trivial changes (3)
  • src/components/header.tsx
  • tsconfig.json
  • src/components/glass.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/layout.tsx

Copy link

@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)
.github/workflows/test.yml (1)

24-25: Remove the duplicate build step.

This runs pnpm run build here and again on Lines 30-31, so every CI run pays for the same build twice. Keep one of them unless the two steps are meant to validate different build modes.

♻️ Proposed fix
-      - name: Build with Next.js
-        run: pnpm run build
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/test.yml around lines 24 - 25, Remove the duplicate CI
build step that runs "pnpm run build" — locate the workflow step with name
"Build with Next.js" and the run command "pnpm run build" and delete one of the
two identical steps (or consolidate if they were meant to run different build
modes), leaving a single build invocation to avoid running the same build twice.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/test.yml:
- Around line 24-25: Remove the duplicate CI build step that runs "pnpm run
build" — locate the workflow step with name "Build with Next.js" and the run
command "pnpm run build" and delete one of the two identical steps (or
consolidate if they were meant to run different build modes), leaving a single
build invocation to avoid running the same build twice.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ee7ba893-e1b9-4df3-8049-a84fdc9980b4

📥 Commits

Reviewing files that changed from the base of the PR and between 7423e29 and 806de80.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

@lorenzocorallo lorenzocorallo merged commit 4289a4d into main Mar 17, 2026
1 of 2 checks passed
@lorenzocorallo lorenzocorallo deleted the toto04/shapes branch March 17, 2026 22:28
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