Repository navigation
fix(models): rank related models by the active main model in pickers - #10246
Pfannkuchensack wants to merge 4 commits into
Conversation
ModelSelect takes a `relatedTo` anchor instead of using its own value, which never had linkable candidates. Generate, Video and Upscale component, LoRA, VAE and reference pickers anchor on the active main model; model default settings anchor on the edited model. Linked models rank first in their base group with an icon naming the anchor model.
joshistoast
left a comment
There was a problem hiding this comment.
JK found an accessibility issue
| <Tooltip content={linkedLabel}> | ||
| <Icon as={LinkIcon} aria-label={linkedLabel} boxSize="3" color="accent.solid" flexShrink={0} /> |
There was a problem hiding this comment.
[P2] Make the linked-model hint readable by screen readers.
Chakra’s Icon defaults to aria-hidden="true", so the new “Linked to [model]” label is hidden despite having an aria-label. Chromium’s accessibility tree confirms that an option reads only “Beta VAE,” without its relationship information. Keyboard focus also stays in the search field, so the icon’s tooltip provides no keyboard alternative.
The hiding behavior predates this PR, but now affects the newly enabled relationship hints in concept pickers. Expose the relationship through the option’s accessible text or description, and test that output rather than just checking the label attribute.
There was a problem hiding this comment.
Fixed in bc13638. The link icon is now explicitly aria-hidden and keeps its tooltip for pointer users. The label goes into the option text as VisuallyHidden, so the option reads e.g. "Fixture Model 027, Linked to Fixture Model 006 …" (checked in the Chromium accessibility tree on the mock). The tests now assert the option's accessible name via toHaveAccessibleName, including that unlinked options carry no link text.
Chakra hides icons from assistive technology, so the link icon's label never reached screen readers, and the tooltip is unreachable while focus stays in the search field. Put the label into the option's text as visually hidden content and assert the option's accessible name.
Summary
Models linked in the Model Manager ("Related models") had no visible effect while generating. The picker loaded links for its own selected value. Main-to-main links are not allowed, LoRA pickers have no value, and single-slot types (VAE, encoders) cannot link to themselves, so the link hint practically never appeared.
ModelSelectnow takes arelatedToanchor:Before: select an SDXL main model linked to two LoRAs, open "Add concept". The LoRAs are listed alphabetically with no marker.
".After: the two linked LoRAs come first, each with a link icon and the tooltip "Linked to
QA Instructions
pnpm lint: passes.pnpm test:browser src/features/models/ui/components/ModelSelect.browser.test.tsx: 18/18. New tests cover three cases: a linked model ranks first and is labelled with the anchor's name, links of the picker's own value no longer mark anything, and the fallback label when the anchor is missing.pnpm dev:mock, with the relationships endpoint returning links for one SDXL main model:ModelSelecttests.Review
No material findings. A minor lookup cost was addressed: the anchor name is now read from the existing
modelsByKeymap. A test for the fallback label was added.Checklist
What's Newcopy (if doing a release after this PR)Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.