Conversation
|
32e65eb to
1a27da5
Compare
📚 Branch Preview Links🔍 Gen1 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
6a648af to
2e87504
Compare
2e87504 to
bd1669f
Compare
d77d383 to
9a4b03c
Compare
a18eba1 to
dff5e27
Compare
dff5e27 to
2d8fece
Compare
Description
Implements Phase 3 (API) and Phase 4 (accessibility) of the Thumbnail 1st-gen → 2nd-gen migration, on top of the Phase 2 file-structure scaffold (#6704).
ThumbnailBase(core): numericsizegetter/setter withwarnIfvalidation (12-value scale, default500), mirroringAvatarBase; afitgeontain', default'contain') replacing1st-gen'scoverboolean, matching Asset'sAssetFitnaming;decorativereflected property witharia-hiddensync.background,layer,dselectedare **not** implemented —they're dropped as documentedswc-thumbnail` attributes per the migration plan's decision log (C6, C7, C8), not deferred to a later phase.Thumbnail.types.ts(core, new file):THUMBNAIL_VALID_SIZES/THUMBNAIL_DEFAULT_SIZE/ThumbnailSize,THUMBNAIL_VALID_FITS/THUMBNAIL_DEFAULT_FIT/ThumbnailFit.Thumbnail(SWC):render()now emits a single fixed structure —<div class="swc-Thumbnail swc-OpacityCheckerboard"><slot></slot></di variant markup. Style changes forsize/fitare driven entirely by:host([size="..."])/:host([fit="..."])attribute selectors, not template branching. Alt-fallback (alt=""whendecorative) and the missing-altDEBUG warning are implemented here rather than in core, since they need aslotchangelistener on the renderedthat core has norender()` to provide (see decision log Q5Motivation and context
SWC-2199 (full S2 visual fidelity / CSS migration) can't proceed without real
render()markup and reflected properties for its stylelint-passing CSS to attach to. This PR closes that gap for SWC-2198's API and accessibility phases.Related issue(s)
Screenshots (if appropriate)
N/A — no CSS changes.
thumbnail.cssremains the Phase 2:host { display: block; }stub; visual styling lands in SWC-2199.Author's checklist
CONTRIBUTING and**PULL_REQUESTS** documents.
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Numeric size validation
sizeattribute to an invalid value (e.g.999) via devtoolssizeto fall back to500and a dev-mode consolewarnIfwarning naming the valid sizesFit validation
fitattribute to an invalidvia devtoolsfitto fall back tocontainand a dev-mode consolewarnIfwarning naming the valid valuesRender structure
<div class="swc-Thumbnail swc-OpacityCheckerboard">wrapping<slot>— nobackground/layer-specific markup, since those properties are droppedDecorative + alt fallback
<img>with noaltinside >`aria-hidden="true"and the image to getalt=""Missing-alt DEBUG warning
<img>with noaltinside orative`)altor setdecorativeBuild and lint
yarn buildin2nd-gen/packageses/swcDevice review
Accessibility testing checklist
Keyboard
Not applicable —
swc-thumbnailhas no focusable parts in any state (default ordecorative).<swc-thumbnail>entirely; confirm no regressions in surrounding Storybook examplesScreen reader
<img alt="Preview">to announce as an image named "Preview"; the host itself contributes no role or namedecorativeon via the Controls panel