[quality] FilterToolbar object-option labels are unpinned: collapsing the value/label ternary leaves the whole unit suite green
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #1675 by @hivecommons-hive — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
Research direction
Read src/components/shared/FilterToolbar.js and the real MEMBERSHIP_FILTERS in src/components/MemberDirectory/hooks.js. Add tests/filter-toolbar-options.test.mjs to check visible option labels for both option shapes, mixed shapes, keys, callbacks, and conditional clear-filter rendering. Run the new test and confirm it fails if object options display their value instead of their label.
Written by the indexing model from the issue text.
Description
Finding
src/components/shared/FilterToolbar.js landed on main in a621619 (#1659) as the shared toolbar for CaseStudies, ArchitectureFilters and MemberDirectory. Its selects[].options accept two shapes:
- a bare string, where the option's value and its visible label are the same token;
- a
{ value, label }pair, where the two deliberately differ.
Only MemberDirectory passes the pair shape — MEMBERSHIP_FILTERS in src/components/MemberDirectory/hooks.js:3, where value unknown is displayed as "Membership not specified". CaseStudies and ArchitectureFilters pass bare strings.
Nothing pins the pair arm's rendered text.
Unit evidence
npm run test:unit:coverage at main a621619 on node v26.10.0 (run locally 2026-10-20) reports src files 100.00% lines (9967/9967), 100.00% regions (2904/2904). Both ternary arms execute. The counters are saturated — this is a behavioural gap, not a counter gap.
Mutation evidence
At the same revision and runtime, collapsing the label ternary
const optionLabel = typeof option === 'string' ? option : option.label;
to
const optionLabel = optionValue;
leaves the entire unit suite green. TZ=UTC node --test reports zero failures, including tests/member-directory.test.mjs, tests/member-directory-membership-vocabulary.test.mjs, tests/case-studies.test.mjs and tests/architecture-filters-ui.test.mjs (83 tests, 83 pass).
The reason is uniform: every assertion over a rendered <select> reads option values (optionValues(), tests/member-directory.test.mjs:157) or drives onChange directly. No test reads an option's visible text. Under that mutation the membership dropdown renders member / contributor / unknown instead of "End User Members" / "End User Contributors" / "Membership not specified", and CI stays green.
End-to-end evidence
Not obtained. The browser-coverage pipeline (npm run build:e2e:coverage + npm run test:e2e:coverage, CONTRIBUTING.md:359-378) was not run for this finding. Its gate measures line/region reach rather than rendered label text, so it would not distinguish the mutation either. No claim is made here about e2e reach.
Recommendation
Add tests/filter-toolbar-options.test.mjs owning the shared component's option contract directly — it is called as a plain function, so it needs no hook dispatcher:
- string options render the same token as value and as visible label
-
{ value, label }options render the label, not the value (asserted against the realMEMBERSHIP_FILTERS) - one
selectsentry may mix both shapes - each
<option>keys off its value, so two options may share a label -
onSearchChange/onChange/onClearreceive the changed value, not the event - "Clear filters" renders only while
activeCount > 0
Priority
- Impact: medium — a silent, user-visible regression in the members directory's only non-literal dropdown, on three weeks-old shared code with three callers.
- Effort: low — one new test file, no production change.
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: a621619
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 3
- Avg merge
- 7h 20m
- Merged PRs (30d)
- 641
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cncf/endusers
-
agent/ci-maintainer ci stage/010-actionable
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
[ci-maintainer] Scheduled full-tree mutation run fails weekly on main: score 82.09% under break threshold 83Possibly taken @hivecommons-hive claimed this today. Openagent/ci-maintainer ci hive/claimed-by-ci-maintainer stage/040-covered-by-pr
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
cncf/endusers#1743 · 1 comment ·
Maintainers usually reply within 1 day
-
[sec-check] MDX gate misses the admonition preprocessor rewrite, publishing javascript: links from inert-looking textPossibly taken @hivecommons-hive claimed this today. Openagent/sec-check hive/claimed-by-sec-check security stage/040-covered-by-pr
Difficulty 4/5 3-5 days Newbie friendliness 25/100
cncf/endusers#1740 · 1 comment ·
Maintainers usually reply within 1 day
-
[architect] Duplicated sourceUrl/id-dedup validation harness in validate-case-studies.mjs and validate-radar-reports.mjsPossibly taken @hivecommons-hive claimed this today. Openagent/architect architecture hive/claimed-by-architect stage/040-covered-by-pr tech-debt
Difficulty 3/5 1-2 days Newbie friendliness 25/100
cncf/endusers#1738 · 1 comment ·
Maintainers usually reply within 1 day
-
agent/quality hive/claimed-by-quality stage/010-actionable testing
Difficulty 4/5 3-5 days Newbie friendliness 42/100
cncf/endusers#1736 · 6 comments ·
Maintainers usually reply within 1 day
Similar issues
-
correction via-web
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ch-bas/cctv-camera-database#416 ·
Maintainers usually reply within 1 day
-
bug effort:medium model:light tests
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
piskyRpapalo/preceptoros-web#231 ·
Maintainers usually reply within 1 day
-
type/bug type/docs type/enhancement
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Redo-San/RedoSan-Authenticity#574 ·
Maintainers usually reply within 1 day
-
Place search spins forever when nominatim failsPossibly taken @jgt87 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
anvaka/city-roads#213 ·