Bug-3672: ProjectGroupPicker on select issue for non dashboard#53
Conversation
Expose an optional id prop on ProjectGroupPicker and bind it to the internal input. Update usages across dashboard and workspace create/export pages to pass unique ids and restructure markup so labels use for="..." (replacing implicit label-wrapping with explicit labels and container divs). This improves accessibility by ensuring labels are correctly associated with the picker inputs; no functional behavior changes.
Introduce a rememberSelection prop to ProjectGroupPicker (default false) to control persisting and showing cached project-group names. Update scroll hint logic (showScrollHint computed) and related class bindings. Only persist/load cached names when rememberSelection is enabled and refine selection initialization when options are passed. Fix ServicePicker selection logic to keep the current service if it still exists, otherwise pick the first or null. Wire remember-selection in dashboard, add a :key to the service-picker in the TDEI exporter, and make the fetched workspace reactive to ensure proper updates.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughProjectGroupPicker adds optional ChangesProjectGroupPicker Enhancement and Page Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cyrossignol
left a comment
There was a problem hiding this comment.
Looks pretty good. Thanks for addressing some issues from the rebase of the roles branch. Just one question...
Remove the :key="workspace.tdeiProjectGroupId" binding from the service-picker in pages/workspace/[id]/export/tdei.vue. This prevents unnecessary component remounts when the project group id changes, preserving the picker's internal state and avoiding re-initialization or UI flicker.
Task
https://dev.azure.com/TDEI-UW/TDEI/_workitems/edit/3672/
Root Cause
On non-dashboard pages such as Create Workspace, the
ProjectGroupPickercomponent was wrapped inside a<label>element.When a user clicked a project group option:
<label>, the browser immediately redirected focus back to the associated input.Additional issues were also identified while fixing this flow:
ProjectGroupPickerwas persisting project group selection globally via session storage, even on non-dashboard pages.optionslist was already supplied.ServicePickerwas not reliably updating after project group selection because:workspaceobject instead of reactive form stateChanges Implemented
1. Added explicit input id support to
ProjectGroupPickerUpdated the component so an
idprop can be passed through to the internal<input>.Changes
id?: stringto component props:id="props.id"on the internal input2. Replaced nested label usage with explicit label association
Refactored pages that wrapped
ProjectGroupPickerinside<label>.Files Updated
pages/workspace/create/blank.vuepages/workspace/create/file.vuepages/workspace/create/tdei.vuepages/workspace/[id]/export/tdei.vue3. Scoped project group persistence to Dashboard only
Updated
ProjectGroupPickerso remembered selection is opt-in instead of always enabled.Changes
rememberSelection?: booleantoProjectGroupPickerremember-selectiononly onpages/dashboard.vue4. Fixed dashboard project group reset during initial load
Adjusted picker fallback behavior so a valid existing selection is not replaced just because it is not present in the first fetched page of results.
5. Corrected header text for static
optionsmodeUpdated the picker header logic for cases where a full project group list is passed in directly.
6. Fixed service picker refresh on Export to TDEI
Updated the export flow so service selection stays in sync with the selected project group.
Changes
workspacestate reactive inpages/workspace/[id]/export/tdei.vue:key="workspace.tdeiProjectGroupId"toServicePickeron the export page so the component fully refreshes when project group changescomponents/ServicePicker.vueso staletdeiServiceIdvalues are replaced when they do not exist in the refreshed service listAdditional Files Updated
components/ProjectGroupPicker.vuecomponents/ServicePicker.vuepages/dashboard.vueTest Cases Covered
v-model.ProjectGroupPickerremains unchanged.projectGroupIdbinding and downstream watchers were not changed.Changes
ProjectGroupPicker Component
idprop to support explicit label association viafor="id"binding.rememberSelectionprop (default: false) to make session-storage persistence opt-in.:id="props.id"on the internal input wrapper.showScrollHintcomputed and updated dropdown rendering/styling to use it.rememberSelection.onMountedand theprojectGroupswatcher to respectrememberSelection.ServicePicker Component
refreshServices()now verifies the currently selectedmodelstill exists in the newly loadedservices.modelto the first available service id ornullwhen none exist (avoids stale selections).modelwhen falsy.Dashboard Page
remember-selectiontoproject-group-picker.Workspace Creation Pages (blank.vue, file.vue, tdei.vue)
<div class="mb-3">) with:<label for="...">project-group-pickerwith correspondingidpropTDEI Export Page (pages/workspace/[id]/export/tdei.vue)
<label for="export_tdei_project_group">andproject-group-picker id="export_tdei_project_group", removing the previous nested-label pattern.workspaceobject (viareactive(...)) so export-page workspace state is reactive.:key="workspace.tdeiProjectGroupId"), preserve picker internal state, reconcile stale selected service ids, and clear selection when no services exist.Files touched
Impact
Tests / Coverage