Skip to content

Conversation

@Ragura
Copy link
Contributor

@Ragura Ragura commented Nov 11, 2025

🔗 Linked issue

resolves #33659

📚 Description

First Nuxt contribution, fingers crossed!

This PR adds dragging and minimizing to the Error Overlay added in Nuxt 4.2. Dragging snaps around the edges and the PiP window's position is stored via localstorage.

The window can be "closed", which will minimize it into a small pill-shaped non-intrusive button to reopen it. This preference is also stored in localstorage.

I didn't know how to write an actual test for this, but I'm willing to put effort into it with some guidance!

In the meanwhile, testing this is simple: throw an error in the playground app.vue and try dragging the pip window around!

@Ragura Ragura requested a review from danielroe as a code owner November 11, 2025 16:55
@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Walkthrough

Reworks the Nuxt error overlay UI and runtime utilities to add an edge-based docking system, draggable Pip and Preview, and persistent dock/hidden state via storage sync. Introduces new DOM controls (pip-close, pip-restore), replaces the toggle button with a custom toggle element, and reorders shadow DOM appends to satisfy adjacency rules. Adds CSS custom properties for dock offsets and transform-origin, viewport-clamping and snapping logic, unified repaint on resize/scroll, pointer-event drag handlers, and live preview snapshot update logic. No exported/public function signatures were changed.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45–60 minutes

  • Docking, clamping and edge-nearest snapping logic across viewport sizes
  • Pointer-event drag start/move/end handlers and state transitions for Pip and Preview
  • Persistence and storage-sync interactions (localStorage + postMessage bridge)
  • CSS custom properties and transform-origin calculations affecting layout and animations
  • DOM reordering and new elements (#pip-close, #pip-restore, custom toggle) and ARIA/state updates

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarises the main changes in the pull request: adding dragging and minimizing functionality to the error overlay.
Description check ✅ Passed The description is directly related to the changeset, explaining the dragging and minimizing features implemented, localStorage persistence, and how to test.
Linked Issues check ✅ Passed The PR implements the primary objectives from issue #33659: enabling moving and closing the error overlay, with localStorage persistence for both position and closed state.
Out of Scope Changes check ✅ Passed All changes are directly scoped to error overlay improvements requested in issue #33659, including dragging, minimizing, edge-snapping, and state persistence.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a877e7 and 88c64a3.

📒 Files selected for processing (1)
  • packages/nitro-server/src/runtime/utils/dev.ts (8 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Follow standard TypeScript conventions and best practices

Files:

  • packages/nitro-server/src/runtime/utils/dev.ts

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.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9d0e0a and 2a877e7.

📒 Files selected for processing (1)
  • packages/nitro-server/src/runtime/utils/dev.ts (8 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Follow standard TypeScript conventions and best practices

Files:

  • packages/nitro-server/src/runtime/utils/dev.ts

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 11, 2025

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@33695

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@33695

nuxt

npm i https://pkg.pr.new/nuxt@33695

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@33695

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@33695

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@33695

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@33695

commit: 5c808b2

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 11, 2025

CodSpeed Performance Report

Merging #33695 will not alter performance

Comparing Ragura:error-overlay-improvements (5c808b2) with main (5d97498)

Summary

✅ 10 untouched

@danielroe danielroe added this to the 4.3 milestone Dec 16, 2025
@danielroe
Copy link
Member

I think:

  1. we should be able to hide either error page. (pretty or user-supplied)
  2. the error overlay button should also be draggable and position saved in localstorage
  3. if we have hidden the 'pretty' error page then when we hard refresh, we should not see it - it should auto-minimise based on the value saved in local storage.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

thank you ❤️

@danielroe danielroe merged commit 8b75e46 into nuxt:main Dec 24, 2025
99 of 100 checks passed
@github-actions github-actions bot mentioned this pull request Dec 23, 2025
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.

error overlay enhancements

2 participants