Skip to content

3d to svg upload download#6

Merged
Vilos92 merged 3 commits into
mainfrom
3d-to-svg-upload-download
Jul 1, 2026
Merged

3d to svg upload download#6
Vilos92 merged 3 commits into
mainfrom
3d-to-svg-upload-download

Conversation

@Vilos92

@Vilos92 Vilos92 commented Jul 1, 2026

Copy link
Copy Markdown
Owner
  • 🎨
  • 🎨

Summary by CodeRabbit

  • New Features

    • Improved the 3D-to-SVG tool layout with clearer separate areas for the model viewer and SVG preview.
    • Added more accessible status messaging for loading and error states.
    • Enhanced pose controls with direct X/Y/Z numeric input and a clearer snap-to-angle control.
  • Bug Fixes

    • Error messages now appear in the drop area and preview area when loading or export issues occur.
    • Loading indicators for the SVG snippet and model view now behave more consistently.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c52a3769-de95-4c0f-bfc2-6f1af390ca37

📥 Commits

Reviewing files that changed from the base of the PR and between 7b4aa88 and 83539b0.

📒 Files selected for processing (3)
  • src/pages/tools/3d-to-svg.astro
  • src/pages/tools/_3d-to-svg/studio.css.ts
  • src/pages/tools/_3d-to-svg/studio.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/pages/tools/_3d-to-svg/studio.ts
  • src/pages/tools/3d-to-svg.astro

📝 Walkthrough

Walkthrough

The 3D-to-SVG studio tool's UI is restructured into distinct pane sections (Model, SVG) with head buttons, updated CSS module classes/ids, and accessible drop-error/live-region status messaging replacing the previous status element, with corresponding wiring updates in the studio script.

Changes

Studio Layout, Styling, and Status Messaging

Layer / File(s) Summary
Style and id contract updates
src/pages/tools/_3d-to-svg/studio.css.ts
Adds dropError and live ids, removes status id; adds paneBlock, dropError, snapRow, sectionHead/sectionHeading, snippetSpinnerHost, headButton styles; removes buttonRow, loadButton, status, and old snippet heading styles; adjusts pane grid alignment.
Pane-based markup restructuring
src/pages/tools/3d-to-svg.astro
Rebuilds viewport/export sections into "Model"/"SVG" panes with head "Upload"/"Download" buttons, a drop zone with a dedicated error paragraph, a hidden ARIA live region, aria-labeled pose inputs, and a restructured snippet frame with spinner host.
Script wiring for drop-error and live-region messaging
src/pages/tools/_3d-to-svg/studio.ts
Captures dropErrorEl, liveEl, snippetFrameEl, snippetSpinnerEl; updates loading/error handlers and worker error handling to use these elements instead of setStatus; clears live region after mount; removes load-button pointerdown propagation stop.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant StudioUI as studio.ts
  participant Worker as SVG Worker
  participant DOM as DOM Elements

  User->>StudioUI: Drop/upload model file
  StudioUI->>DOM: Clear dropErrorEl, set liveEl "Loading model..."
  alt Model load fails
    StudioUI->>DOM: Write error to dropErrorEl, update liveEl
  else Model load succeeds
    StudioUI->>DOM: Mount model, clear liveEl
    StudioUI->>Worker: Request SVG generation
    alt Generation fails
      Worker-->>StudioUI: Error message
      StudioUI->>DOM: Render error in preview, stop snippetSpinnerEl, update liveEl
    else Generation succeeds
      Worker-->>StudioUI: SVG result
      StudioUI->>DOM: Update snippetFrameEl, hide snippetSpinnerEl
    end
  end
Loading

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and directly matches the main 3D-to-SVG tool changes, including the upload and download actions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 3d-to-svg-upload-download

Comment @coderabbitai help to get the list of available commands.

@Vilos92 Vilos92 marked this pull request as ready for review July 1, 2026 06:24

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/pages/tools/_3d-to-svg/studio.css.ts (1)

197-227: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

visuallyHidden duplicates the project's existing .sr-only utility with a legacy CSS property.

src/styles/global.css.ts already defines a canonical hidden-content pattern (.sr-only) using clipPath: 'inset(50%)'. The new visuallyHidden style reimplements the same technique with the deprecated clip: rect(0, 0, 0, 0) property and slightly different metrics (margin: '-1px' vs. no margin offset). Consider reusing the shared utility instead of introducing a second hidden-content pattern.

♻️ Reuse the existing sr-only pattern
-// Screen-reader-only live region for transient announcements (e.g. loading), so
-// they're conveyed without the visible layout shift a real status line causes.
-export const visuallyHidden = style({
-  position: 'absolute',
-  width: '1px',
-  height: '1px',
-  padding: 0,
-  margin: '-1px',
-  overflow: 'hidden',
-  clip: 'rect(0, 0, 0, 0)',
-  whiteSpace: 'nowrap',
-  border: 0
-});
+// Screen-reader-only live region for transient announcements (e.g. loading), so
+// they're conveyed without the visible layout shift a real status line causes.
+// Mirrors the shared `.sr-only` pattern in global.css.ts.
+export const visuallyHidden = style({
+  position: 'absolute',
+  width: '1px',
+  height: '1px',
+  padding: 0,
+  margin: 0,
+  overflow: 'hidden',
+  clipPath: 'inset(50%)',
+  whiteSpace: 'nowrap',
+  border: 0
+});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/tools/_3d-to-svg/studio.css.ts` around lines 197 - 227, The
`visuallyHidden` style duplicates the existing hidden-content utility and should
be replaced with the shared `.sr-only` pattern used in
`src/styles/global.css.ts`. Update the `visuallyHidden` export in
`studio.css.ts` to reuse that canonical accessibility helper (or mirror its
exact `clipPath: 'inset(50%)'`-based approach and spacing), instead of keeping a
separate `clip: rect(...)` implementation with different metrics.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/pages/tools/_3d-to-svg/studio.css.ts`:
- Around line 197-227: The `visuallyHidden` style duplicates the existing
hidden-content utility and should be replaced with the shared `.sr-only` pattern
used in `src/styles/global.css.ts`. Update the `visuallyHidden` export in
`studio.css.ts` to reuse that canonical accessibility helper (or mirror its
exact `clipPath: 'inset(50%)'`-based approach and spacing), instead of keeping a
separate `clip: rect(...)` implementation with different metrics.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa21cb6d-9fc8-4c35-9af3-0c1a8a998601

📥 Commits

Reviewing files that changed from the base of the PR and between babf0a6 and 7b4aa88.

📒 Files selected for processing (3)
  • src/pages/tools/3d-to-svg.astro
  • src/pages/tools/_3d-to-svg/studio.css.ts
  • src/pages/tools/_3d-to-svg/studio.ts

@Vilos92 Vilos92 merged commit f4f1f70 into main Jul 1, 2026
11 checks passed
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.

1 participant