Skip to content

Eliminate chip rendering duplication in SInputDropdown inline search#666

Merged
brc-dd merged 2 commits into
feat/inline-search-dropdownfrom
copilot/sub-pr-661
Dec 8, 2025
Merged

Eliminate chip rendering duplication in SInputDropdown inline search#666
brc-dd merged 2 commits into
feat/inline-search-dropdownfrom
copilot/sub-pr-661

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 8, 2025

Addresses code duplication between array and single-value chip rendering in the inline search feature (lines 391-440). The two template blocks were nearly identical, differing only in iteration and variable naming.

Changes:

  • Added selectedChips computed property that normalizes both single and array values to always return an array, eliminating the need for separate rendering logic
  • Unified chip rendering into a single v-for loop that handles both single-select and multi-select modes

Before:

<template v-if="Array.isArray(selected)">
  <div v-for="(item, i) in selected">
    <!-- chip markup -->
  </div>
</template>
<template v-else-if="selected">
  <div class="inline-chip">
    <!-- identical chip markup -->
  </div>
</template>

After:

<div v-for="(item, i) in selectedChips">
  <!-- chip markup (single implementation) -->
</div>

Reduces code by ~40 lines while preserving all functionality.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…d to array

Co-authored-by: brc-dd <40380293+brc-dd@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on inline search functionality Eliminate chip rendering duplication in SInputDropdown inline search Dec 8, 2025
Copilot AI requested a review from brc-dd December 8, 2025 02:23
@brc-dd brc-dd marked this pull request as ready for review December 8, 2025 02:23
@brc-dd brc-dd requested a review from kiaking as a code owner December 8, 2025 02:23
@brc-dd brc-dd merged commit 18510fc into feat/inline-search-dropdown Dec 8, 2025
1 check passed
@brc-dd brc-dd deleted the copilot/sub-pr-661 branch December 8, 2025 02:25
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