Skip to content

fix(monocle-types,monocle-react): Fix issue where assessment wasn't set in MonocleProvider#38

Merged
jaredpiedt merged 2 commits intomainfrom
jaredpiedt/fix-assessment
Jul 2, 2025
Merged

fix(monocle-types,monocle-react): Fix issue where assessment wasn't set in MonocleProvider#38
jaredpiedt merged 2 commits intomainfrom
jaredpiedt/fix-assessment

Conversation

@jaredpiedt
Copy link
Copy Markdown
Collaborator

@jaredpiedt jaredpiedt commented Jul 2, 2025

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe)

Checklist

  • I have run pnpm test and all tests pass
  • I have run pnpm lint and there are no linting errors

@jaredpiedt jaredpiedt self-assigned this Jul 2, 2025
@jaredpiedt jaredpiedt requested a review from Copilot July 2, 2025 19:54
Copy link
Copy Markdown

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 ensures the assessment value is properly set in MonocleProvider by updating the handler signature, wiring the new callback into window.MCL.configure, and adjusting related logic.

  • Update onAssessment type to accept raw string assessments
  • Enhance MonocleProvider to configure MCL with the new callback and handle existing assessments
  • Clamp instance counts, restructure imports, and memoize context value

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/types/src/index.ts Changed onAssessment param type from MonocleAssessment to string
packages/monocle-react/src/utils/useMaxAllowedInstancesGuard.tsx Prevent negative counts when unmounting instances
packages/monocle-react/src/types.ts Added import React for type definitions
packages/monocle-react/src/contexts/MonocleProvider.tsx Configure MCL with onAssessment, check existing assessment, add useMemo for context, update effect deps
.changeset/pink-friends-invite.md Documented the signature fix and provider behavior correction

@jaredpiedt jaredpiedt merged commit 74d2cb6 into main Jul 2, 2025
2 checks passed
@jaredpiedt jaredpiedt deleted the jaredpiedt/fix-assessment branch July 2, 2025 20:11
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