Skip to content

Conversation

ryanzhangofficial
Copy link
Member

@ryanzhangofficial ryanzhangofficial commented Jul 11, 2025

Task

Allow users to choose and cache/export where scoring zones are positioned.
AARD-1894

Symptom

Benefits of having direct user editing: bulk edits and reuse, version control and diffs, schema validation

Solution

  • Include pre select scoring zones in-simulator as part of the new Developer Tool.
  • Create a framework for caching devtool keys
  • Allow users to export mira files with edited UserData and import them for use cases such as cleared cache
Screenshot 2025-07-11 150237 Screenshot 2025-07-11 104009

Verification

  • Added new tests in FieldMiraEditor.test.ts and all passed
  • Cached ScoringZonePreferences are loaded after refresh

@ryanzhangofficial ryanzhangofficial requested review from a team as code owners July 11, 2025 17:41
@ryanzhangofficial ryanzhangofficial self-assigned this Jul 11, 2025
@ryanzhangofficial ryanzhangofficial added ui/ux Relating to user interface, or in general, user experience mirabuf Relating to the mirabuf format labels Jul 11, 2025
@rutmanz rutmanz changed the title Support Fields Having Pre Select Scoring Zones Support Fields Having Pre Select Scoring Zones [AARD-1894] Jul 11, 2025
Copy link
Member

@rutmanz rutmanz left a comment

Choose a reason for hiding this comment

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

I'm trying to test this but it doesn't actually seem to persist the changes? These are the steps I'm taking:

  1. Import field
  2. Add scoring zone
  3. Go to devtool editor and click "save" (I see the toast that says they've been persisted)
  4. Clear preferences (because scoring zone data is already scored here; I think part of this PR would also be ending the storage of scoring zones in the preferences cache so it can stay with the mirabuf file)
  5. Reload
  6. Import same field
  7. No scoring zones are present

I'm not seeing any console errors

@AlexD717
Copy link
Member

  1. Clear preferences (because scoring zone data is already scored here; I think part of this PR would also be ending the storage of scoring zones in the preferences cache so it can stay with the mirabuf file)

Wouldn't saving data back to the mira file require us to store the mira files for each individual users? The way I understood the PR (I might be wrong) the goal was to allow fields to come with pre-selected scoring zones. Meaning that in the exporter a new tab would be added saving this data to the mira file, that way when the user comes and tries to load a field all the scoring zones are already pre-configured.

@ryanzhangofficial
Copy link
Member Author

ryanzhangofficial commented Jul 11, 2025

I'm trying to test this but it doesn't actually seem to persist the changes? These are the steps I'm taking:

  1. Import field
  2. Add scoring zone
  3. Go to devtool editor and click "save" (I see the toast that says they've been persisted)
  4. Clear preferences (because scoring zone data is already scored here; I think part of this PR would also be ending the storage of scoring zones in the preferences cache so it can stay with the mirabuf file)
  5. Reload
  6. Import same field
  7. No scoring zones are present

I'm not seeing any console errors

Ah I didn't incorporate the "clear preferences" step on my interpretation of the caching deliverable of this ticket. The changes do persist after reloading if the preferences aren't cleared. However, I don't think it makes sense for the changes to still persist after preferences are cleared especially for default fields. I think your suggestion in AARD-1914 on making the edited mira files exportable makes a lot of sense though (currently working on it). The other route would to be make it similar to the custom input panel, but I think that's out of the scope for this ticket.

@rutmanz
Copy link
Member

rutmanz commented Jul 11, 2025

As the current behavior on dev is to save and restore scoring zones automatically, I don't know what feature this pull request would be adding if it doesn't load the scoring zones from the saved cached mirabuf files

@ryanzhangofficial
Copy link
Member Author

The issues should all be addressed.

Copy link
Member

@rutmanz rutmanz left a comment

Choose a reason for hiding this comment

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

it looks like you didn't update the type for DevtoolMiraData (it's still unknown), but other than that looks good

Copy link
Member

@rutmanz rutmanz left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@BrandonPacewic BrandonPacewic left a comment

Choose a reason for hiding this comment

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

Well done getting the integration of everything all lined up. Nice work.

* dev: (90 commits)
  Delete `disableClickAway` + formatting
  Update modal clickaway logic
  Race condition removed
  code cleanup and formatting
  feat: adding export of tags into assembly data
  isort formatting
  Scores Reset on Match Completed
  Disable Default Key Functions
  formatting
  feat: added blank icon to allow users to select rows
  fix(snyk): update version requirements
  globalAddToast Chaining Removed
  Default Configs in Typescript File
  reorder dependencies
  chore(installer): update python packages to avoid vulerabilities
  fix: cleaning dead code and fixing spelling error
  Unused Imports Removed
  Merge Fix
  fix: clean up workflow spacing, use latest checkout and setup-node steps
  fix: use correct package.json path
  ...
@BrandonPacewic BrandonPacewic mentioned this pull request Jul 15, 2025
@BrandonPacewic BrandonPacewic dismissed azaleacolburn’s stale review July 15, 2025 00:21

Partial requested changes made. Remaining issues can be addressed at a later date but not worth delaying PR for said changes.

@BrandonPacewic BrandonPacewic merged commit 4a71f60 into dev Jul 15, 2025
16 checks passed
@BrandonPacewic BrandonPacewic deleted the ryan/1894/support-fields-having-pre-select-scoring-zones branch July 15, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mirabuf Relating to the mirabuf format ui/ux Relating to user interface, or in general, user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants