chore(dropzone): S2 migration#6437
Conversation
|
📚 Branch Preview Links🔍 First Generation 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 |
Coverage Report for CI Build 28253319581Coverage remained the same at 96.246%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
42b0387 to
fce646e
Compare
* chore(dropzone): author migration plan * chore(dropzone): address feedback
fce646e to
2acf4ea
Compare
Description
Umbrella PR for the
swc-dropzone1st-gen → 2nd-gen Spectrum 2 migration. All phase PRs target this branch and are merged here before this PR lands onmain.Migration plan:
CONTRIBUTOR-DOCS/03_project-planning/03_components/dropzone/migration-plan.mdPhase PRs
Motivation and context
swc-dropzoneis part of the Spectrum 2 component migration workstream. Key changes from 1st-gen:sp-dropzone→swc-dropzoneswc-prefix (swc-dropzone-should-accept,swc-dropzone-dragover,swc-dropzone-dragleave,swc-dropzone-drop)role="group"handling: set inconnectedCallbackwith anhasAttributeguard so consumers can override with a different role; no longer hardcoded in the render templaterole="status"aria-live="polite"region announces drag state changes ("File ready to drop", "Drop to replace existing file", "File accepted") to screen readers — not present in 1st-gentabindex: 1st-gen required consumers to addtabindex="0"; 2nd-gen removes this — the browse control in the slot owns the Tab stopsizeattribute:s | m | l(defaultm) controls illustrated icon scale and container dimensions per Figma; additive and non-breaking for existing consumersdropEffectgetter/setter: validated against theDataTransferenum at runtime with a dev warning; intentionally not reflected as an attribute (controls browser chrome, not component state)dragleaveprevents flicker from child element drag eventsswc-dropzone-dropfires whiledraggedis stilltrueso listeners read the correct state;draggedtransitions tofalseafter dispatchOut of scope
The following are intentionally deferred and not part of this PR:
<rect>for accurate rounded-corner dashes. Spectrum CSS currently uses a CSSborder; team alignment is required before the SVG approach can land. Deferred to a follow-up; the styling phase ships a CSS dashed border as an interim.swc-illustrated-messagestyling strategy: howswc-dropzonepasses accent-color treatment to the slotted illustrated message in the dragged state is unresolved (Q8 in the migration plan). The--mod-illustrated-message-*passthrough pattern from 1st-gen does not carry forward; this requires a joint decision with theswc-illustrated-messageowners.swc-illustrated-messagebutton-groupslot: the recommended canonical slot pattern (swc-illustrated-messagewith browse control in itsbutton-groupslot) depends on a net-new slot that is additive in theswc-illustrated-messagemigration plan (A3). Examples use an interim pattern until that slot ships.sp-dropzone: the 1st-gen package remains; consumers get the consumer migration guide and deprecation guidance.Related issue(s)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Spot-check in the PR Storybook preview once CI generates it.
Default render and slot content
swc-illustrated-messagewith a browse button — verify both render correctly inside the zonedraggedattribute appears on the host when a file is dragged over and disappears on drop or leavefilledattribute persists after settingdropzone.filled = truein the consoleAll sizes render correctly
s,m, andlall render at the expected visual scale (illustration icon and container dimensions)mmatches the Figma default treatmentDrag-and-drop interaction
swc-dropzone-dropfires andevent.target.draggedistrueat the time of dispatchdropzone.filled = trueafter drop — verify the zone transitions to the filled visual stateDrag rejection (
swc-dropzone-should-accept)event.preventDefault()onswc-dropzone-should-acceptnone(rejection cursor) anddraggeddoes not becometrueConsumer role preserved
<swc-dropzone role="region" aria-label="Upload">to the pagerole="region"is not overwritten by the component on upgradeBreaking changes documented in the consumer migration guide
tabindexremoval is noted with the recommended browse-control patternsizeattribute is noted as additiveDevice review
Accessibility testing checklist
Keyboard (required — document steps below)
swc-dropzonehost (host has notabindex)Screen reader (required — document steps below)
aria-labelvalue (e.g. "Upload files, group")filled = true— verify the live region announces "File accepted"swc-dropzoneelement is announced once as a group; the shadow DOMrole="status"region is not surfaced as a separate interactive element