Add defensive guards and refactor in PA - #2923
Open
maggie-li-yd wants to merge 4 commits into
Open
Conversation
maggie-li-yd
requested review from
LSriragavan,
brandantck,
jerome-ng,
khairul-syazwan and
p-hoffmann
as code owners
July 20, 2026 06:58
Open
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors and hardens constraint/value handling in the Vue MRI UI library, aiming to share one normalization path between the dashboard wizard flow and an upcoming WebMCP patch applier while preventing UI crashes from unexpected/missing values.
Changes:
- Extracted constraint value normalization + store dispatching into a shared
applyConstraintValueutility. - Added defensive guards in UI components to avoid runtime errors from unexpected null/number values.
- Updated dashboard flow to delegate normalization logic to the shared utility.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| plugins/ui/apps/vue-mri-ui-lib/src/utils/applyConstraintValue.ts | New shared constraint value normalizer/dispatcher used by dashboard flow (and future WebMCP applier). |
| plugins/ui/apps/vue-mri-ui-lib/src/lib/ui/BaseTagInput.vue | Coerces displayed tag value to string to avoid .replace() throwing on non-strings. |
| plugins/ui/apps/vue-mri-ui-lib/src/composables/useDashboardFlow.ts | Replaces inlined normalization logic with the shared applyConstraintValue utility. |
| plugins/ui/apps/vue-mri-ui-lib/src/components/StackBarChart.vue | Adds null-guard for missing filter-card names to prevent chart render crashes. |
Prerequisite refactor split out of maggie-li-yd/2872-webmcp-poc (PR A1). No
functional change to existing UI flows.
- Extract value normalization out of useDashboardFlow into
utils/applyConstraintValue.ts so the wizard flow and the (upcoming) WebMCP
patch applier share one normalizer. Reject objects that are neither a
{from,to} date range nor a numeric value instead of String()-ing them into
a broken '[object Object]' filter.
- StackBarChart: null-guard filterCard?.name so a category referencing a
no-longer-chartable filter card can't crash the whole chart render.
- BaseTagInput: coerce displayValue to String() so a numeric constraint value
doesn't throw in .replace().
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
maggie-li-yd
force-pushed
the
maggie-li-yd/2872-a1-ui-robustness
branch
from
July 24, 2026 02:13
a75acaf to
15c18d9
Compare
khairul-syazwan
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisite refactor split out of maggie-li-yd/2872-webmcp-poc. No functional change to existing UI flows.
Merge Checklist
Please cross check this list if additions / modifications needs to be done on top of your core changes and tick them off. Reviewer can as well glance through and help the developer if something is missed out.
developbranch)