Repository navigation
Description
Summary
getByRole('option', { name: … }) cannot match any NcSelect option whose label is 10 characters or longer, in any app in the fleet. The option's accessible name has a space injected into the middle of it.
Measured on openbuild (NC 34, @nextcloud/vue 9.9.0) while fixing tests/e2e/automations-rbac.spec.ts. The application is called "RBAC Automations App". Playwright's page snapshot:
- option "RBAC Autom ations App" # <- space inside "Automations"
- generic "RBAC Automations App" # correct, but only via title=
- generic: RBAC Autom
- generic: ations AppCause
NcEllipsisedOption implements middle-ellipsis by splitting the label into two <span>s:
needsTruncate() { return this.name && this.name.length >= 10 }
split() { return this.name.length - Math.min(Math.floor(this.name.length / 2), 10) }
part1 = name.slice(0, split)
part2 = name.slice(split)The wrapper <span class="name-parts" title="{full name}"> carries the correct name, so the inner node's accessible name is right. But the option role computes its name from contents, and the accessible-name algorithm inserts a space at each element boundary — so the option announces the mangled form.
Every label of 10+ characters is affected, at index len - min(floor(len/2), 10):
| label | len | announced as |
|---|---|---|
RBAC Automations App |
20 | RBAC Autom ations App |
PW Version Lifecycle |
20 | PW Version Lifecycle (splits at a real space, so invisible) |
production |
10 | produ ction |
development |
11 | develo pment |
Note the third row: short, ordinary values like production are affected too, which is easy to miss.
Why this is worth a fleet-level issue
Accessibility. A screen reader reads the mangled name. WCAG 2.2 AA 4.1.2 (Name, Role, Value); arguably 2.5.3 (Label in Name) too, since the accessible name no longer contains the visible label as a contiguous string.
It has already produced two wrong issues. In openbuild the locator timed out, the timeout was read as "the fixture is missing / the editor cannot see the application", and that inference became ConductionNL/buildiq#171 and the second comment on ConductionNL/buildiq#173 — the latter an architecture issue. Both are now retracted; the API was measured directly and works. A locator that finds nothing says nothing about the API underneath it, and this is a locator that finds nothing for a reason that has no connection to the app at all.
Six other agents are writing Playwright role queries against NcSelect right now.
The honest workaround
Target the component's own record of the full name:
function selectOption(page: Page, label: string) {
return page.getByRole('option').filter({ has: page.locator(`[title="${label}"]`) })
}Do not relax the regex to tolerate arbitrary whitespace: that hides a real a11y defect and will match the wrong option in a longer list.
Where the fix belongs
NcEllipsisedOption is upstream @nextcloud/vue, not @conduction/nextcloud-vue, so we cannot fix it by cutting one of our own releases. The upstream fix is small — give the split wrapper an explicit aria-label (or role="text"/aria-hidden on the parts) so the accessible name is computed from the whole name rather than from the two fragments. This issue tracks (a) the fleet-wide test-authoring guidance above and (b) raising it upstream.
Confirmed by: Playwright page snapshot on a live instance, plus reading node_modules/@nextcloud/vue/dist/chunks/NcEllipsisedOption-*.mjs.
Activity
rubenvdlinde commentedon Aug 11, 2026
Two things from the nldesign/a11y side: the exact mechanism, and an ownership correction that
changes where the fix has to go.
Ownership — this is NOT in the nc-vue we can release
I was asked to fix this in nc-vue "which you can now merge and release". The release authority and
the defect are in different repositories:
ConductionNL/nextcloud-vueis@conduction/nextcloud-vueand shipsCn*components.Its only
Nc*tracked files aresrc/components/NcSelectTags/*.js. It declares@nextcloud/vueas a peerDependency (^9.0.0).NcEllipsisedOptionbelongs to@nextcloud/vue, whosepackage.jsongivesrepository: https://github.com/nextcloud-libraries/nextcloud-vue— upstream, not ours.Confirmed by
git ls-files | grep -i EllipsisedOptioninConductionNL/nextcloud-vuereturningnothing; the component exists only under
node_modules/@nextcloud/vue/dist/.So a release of
@conduction/nextcloud-vuewould not change what any app renders — apps getNcSelect, and theNcEllipsisedOptionit uses internally, from@nextcloud/vue. It would move adist-tag and fix nothing, while looking exactly like a shipped fix. I did not make that release.
The mechanism, read from the shipped component (8.39.0)
The arithmetic reproduces both reported strings exactly:
productionproductionRBAC Automations AppRBAC Automations AppSo this is deterministic and not environmental, and it affects every label of ≥10 characters.
The truncation is done by splitting the DOM, not by CSS
text-overflow, which is why theaccessible name is mangled rather than merely visually clipped.
Suggested fix (upstream)
The split is purely presentational, so it should not reach the accessibility tree: mark both parts
aria-hidden="true"and expose the fullnameonce on the wrapper (aria-label, or avisually-hidden span). That repairs the screen-reader announcement and restores
getByRole(..., { name })locators, with no change to the visual behaviour.Please keep the workaround as a workaround
The
[title]matching used in openbuild is the right interim call precisely because it does notloosen name matching — a relaxed regex would have made this defect invisible fleet-wide while the
screen-reader experience stayed broken. Worth not adopting that as the fleet's answer.
Also worth flagging for anyone reading the linked openbuild issues: a role/name locator cannot match
a mangled name, so it times out, and the timeout reads as a missing feature. openbuild#171 and #173
both rest on that inference, and a direct HTTP probe reportedly contradicts it — those should be
re-checked against the API before any product conclusion is drawn.
rubenvdlinde commentedon Aug 11, 2026
Correction to my earlier comment — I quoted the wrong version
My previous comment quoted
@nextcloud/vue8.39.0. That was the wrong layer, and in one respectit would have misled you: in 8.39.0
NcSelectdoes not referenceNcEllipsisedOptionat all(
grep -c→ 0). Had anyone tried to reproduce this against a v8 tree they would have found thecomponent unreachable from
NcSelectand might reasonably have concluded the report was wrong.Re-checked against 9.8.0, which is the line Nextcloud 34 apps actually run (this repo declares
@nextcloud/vueas a peerDependency^9.0.0):dist/chunks/NcSelect-*.mjs→ 5 references toNcEllipsisedOption.stands:
"production"→produ/ction,"RBAC Automations App"→RBAC Autom/ations App.aria-hidden,aria-label, or visually-hidden markup — grepcount 0. There is no accessible-name mitigation in it at all.
How it is reached — it is the DEFAULT SLOT CONTENT, not a prop
Two consequences worth having explicit:
NcSelecton v9 mangles every option label of ≥10characters, in both the dropdown and the selected value.
#option/#selected-optionand render the label plainly. That is the only mitigationavailable below the upstream fix — at the cost of losing the search-term highlighting
(
NcHighlight) that the default provides.Suggested upstream patch (unchanged)
The split is presentational, so keep it out of the a11y tree:
aria-hidden="true"on both spans andthe full
nameexposed once on the wrapper. Repairs the announcement and restoresgetByRole(..., { name }), with no visual change.Why I have not shipped a fix, and what I am asking for
I was asked to fix this in nc-vue "which you can now merge and release". The release authority and
the defect are in different repositories, and I want to be precise rather than ship something
inert:
ConductionNL/nextcloud-vue=@conduction/nextcloud-vue, shipsCn*components.I searched all 729 remote refs with
git ls-tree -rforEllipsisedOption: zero hits.Positive control on the same loop:
CnActionButtonsappears in 22 of the first 40 refs, so thesearch works.
NcEllipsisedOptionbelongs to@nextcloud/vue→repository: https://github.com/nextcloud-libraries/nextcloud-vue.A release of
@conduction/nextcloud-vuetherefore cannot change what any app renders for thisdefect. It would move a dist-tag and fix nothing while looking exactly like a shipped fix, so I did
not make one. Verified nothing was published:
npm view @conduction/nextcloud-vue dist-tagsstillreads
latest 1.0.0-beta.3 · beta 1.0.0-beta.229 · vue3 2.2.0-vue3.13, last publish 2026-08-10.The one thing I could ship here I do not think we should do blind: 101 components in
@conduction/nextcloud-vueuseNcSelect, so slot overrides across all of them would work — butthat is 101 call sites in a library shipping to the whole fleet, it silently drops search
highlighting everywhere, and it is a heavier workaround than the
[title]one it would replace.That needs a deliberate decision, not a drive-by from the nldesign task.
Recommendation: file upstream at
nextcloud-libraries/nextcloud-vuewith the patch shape above,keep openbuild's
[title]locator as the interim, and do not relax name matching fleet-wide — aloosened regex would make this invisible while the screen-reader experience stayed broken.
rubenvdlinde commentedon Aug 11, 2026
Filed upstream: nextcloud-libraries/nextcloud-vue#8840.
Two corrections to this issue's premise, both measured:
NcEllipsisedOptionis not ours to fix.ConductionNL/nextcloud-vueis@conduction/nextcloud-vueand shipsCn*components; it declares@nextcloud/vueas a peer dependency. A search of all 729 remote refs forEllipsisedOptionreturned zero hits, with a positive control (CnActionButtons, found in 22 of 40 refs). Publishing@conduction/nextcloud-vuefor this would move a dist-tag and change nothing any app renders.It is reached by default, not opt-in.
NcSelectrendersNcEllipsisedOptionas the fallback content of both theoptionandselected-optionslots, confirmed in the shipped9.9.0bundle (and 9.8.0, and 8.39.0 — so both the Vue 2 and Vue 3 lines).Mechanism, from the shipped component:
The wrapper is
display: flex, so the two parts are flex items and accessible-name computation joins them with a space:production→produ ction,RBAC Automations App→RBAC Autom ations App. Deterministic, not environmental.The wrapper does carry
title="{{ name }}", buttitleis only a fallback name source — the descendant text wins, so it does not repair the announcement. It does make[title="…"]a reliable locator.Interim guidance for the fleet is unchanged: match with
[title]. Do not loosen role/name matching — that hides a real WCAG 4.1.2 defect rather than working around it.