Skip to content

Serialise flags value - #317

Merged
dubstar-04 merged 3 commits into
mainfrom
fixes/clipboard
May 3, 2026
Merged

Serialise flags value#317
dubstar-04 merged 3 commits into
mainfrom
fixes/clipboard

Conversation

@dubstar-04

Copy link
Copy Markdown
Owner

No description provided.

@dubstar-04 dubstar-04 linked an issue May 3, 2026 that may be closed by this pull request
@codecov

codecov Bot commented May 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.87%. Comparing base (2d5ccf4) to head (4724b81).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #317      +/-   ##
==========================================
+ Coverage   91.86%   91.87%   +0.01%     
==========================================
  Files         128      128              
  Lines        9350     9352       +2     
  Branches     1966     1966              
==========================================
+ Hits         8589     8592       +3     
+ Misses        685      684       -1     
  Partials       76       76              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dubstar-04
dubstar-04 requested a review from Copilot May 3, 2026 16:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 makes Flags serialise to a plain numeric value so JSON-based flows preserve bitmask state when entities are copied, stringified, and reconstructed. In the codebase, this is especially relevant to clipboard/import-style round trips where flagged entities such as polylines and text rely on numeric flag values during reconstruction.

Changes:

  • Add Flags.toJSON() so JSON.stringify() emits the numeric flag value instead of a nested { flags: ... } object.
  • Document why numeric serialisation is needed for clipboard-style round trips.
  • Add unit tests covering toJSON() directly and a basic JSON stringify/parse round trip for Flags.

Reviewed changes

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

File Description
core/properties/flags.js Adds numeric JSON serialisation for Flags instances.
test/properties/flags.test.js Adds unit tests for direct and JSON round-trip serialisation of Flags.

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

Comment thread core/properties/flags.js
Comment on lines +39 to +40
toJSON() {
return this.flags;
@dubstar-04
dubstar-04 marked this pull request as ready for review May 3, 2026 16:27
@dubstar-04
dubstar-04 merged commit 3a71513 into main May 3, 2026
3 checks passed
@dubstar-04
dubstar-04 deleted the fixes/clipboard branch May 3, 2026 16:27
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.

clipboard copying a polyline a second time loses closed flag

2 participants