Skip to content

Conversation

@aprendendofelipe
Copy link
Owner

No description provided.

@vercel
Copy link

vercel bot commented Jan 5, 2026

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

Project Deployment Review Updated (UTC)
react-form Ready Ready Preview, Comment Jan 5, 2026 6:06pm
react-markdown Ready Ready Preview, Comment Jan 5, 2026 6:06pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 5, 2026

Open in StackBlitz

@barso/forms

npm i https://pkg.pr.new/@barso/forms@91

@barso/helpers

npm i https://pkg.pr.new/@barso/helpers@91

@barso/hooks

npm i https://pkg.pr.new/@barso/hooks@91

@barso/infra

npm i https://pkg.pr.new/@barso/infra@91

@barso/ui

npm i https://pkg.pr.new/@barso/ui@91

commit: fdcca07

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors multiple files across the codebase to improve code quality and maintainability. The changes include updating test assertions to use more concise Vitest matchers, converting mock functions to proper constructor functions, simplifying React components by removing unnecessary state management, and replacing mutations with immutable patterns.

Key changes:

  • Converted arrow function mocks to constructor functions for proper class instantiation behavior
  • Updated test assertions to use toHaveBeenCalledOnce() and toHaveBeenCalledExactlyOnceWith() for improved readability
  • Refactored useTreeCollapse hook from useState to useReducer for better state management
  • Simplified MarkdownViewer by removing unnecessary state management
  • Replaced object mutation with immutable spread operator in SubmittedFields
  • Added adoptedStyleSheets polyfill for jsdom compatibility

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/setup.js Added adoptedStyleSheets polyfill for jsdom environment to fix compatibility issue
packages/ui/src/_document.test.js Converted ServerStyleSheet mock from arrow function to constructor function for proper instantiation
packages/ui/src/Notifications/NotificationMenu.test.jsx Updated test assertion to use toHaveBeenCalledOnce()
packages/ui/src/Notifications/NotificationList.test.jsx Updated test assertions to use toHaveBeenCalledOnce()
packages/ui/src/Markdown/Markdown.jsx Removed unnecessary state management in MarkdownViewer, replaced Box with div, removed unused imports
packages/ui/src/GoToTopButton/GoToTopButton.test.jsx Updated mock to constructor function and test assertions to use toHaveBeenCalledExactlyOnceWith()
packages/ui/src/FormField/FormField.test.js Updated test assertion to use toHaveBeenCalledOnce()
packages/ui/src/FormField/FormField.jsx Moved ref assignment after spread operator to prevent accidental override
packages/infra/src/logger/logger.test.js Converted Axiom mock from arrow function to constructor function and hoisted flush mock
packages/infra/src/logger/axiom-transport.test.js Converted Axiom mocks to constructor functions and updated test assertions
packages/hooks/src/useTreeCollapse/useTreeCollapse.js Refactored from useState/useCallback to useReducer for cleaner state management
packages/helpers/src/dom.test.js Updated test assertion to use toHaveBeenCalledOnce()
examples/form/components/SubmittedFields.jsx Replaced delete mutation with immutable spread operator pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aprendendofelipe aprendendofelipe merged commit 7a6560a into main Jan 5, 2026
15 checks passed
@aprendendofelipe aprendendofelipe deleted the refactoring branch January 5, 2026 18:13
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