Repository navigation
Conversation
aferd
left a comment
There was a problem hiding this comment.
Review scoped to the keyboard-add code in this PR. The existing drag-and-drop interaction remains available.
| icon={<PlusCircleIcon />} | ||
| aria-label={`Add ${config?.title || widgetType} widget to dashboard`} | ||
| isDisabled={isDisabled} | ||
| onClick={() => onAdd?.(widgetType)} |
There was a problem hiding this comment.
onAdd is optional, but this new button is rendered even when no handler is passed. A standalone WidgetDrawer then exposes a focusable ‘Add ... widget’ action that does nothing when activated. Could we render the button only when onAdd is provided?
| }, {} as ExtendedTemplateConfig); | ||
|
|
||
| handleTemplateChange(newTemplate); | ||
| setCurrentlyUsedWidgets(newTemplate.xl.map((item) => item.widgetType)); |
There was a problem hiding this comment.
This update filters the newly added widget out of the drawer, which unmounts the button that the keyboard user just activated. Focus then falls back to the document body, so adding another widget loses their place. Could we move focus to the next available add button, or to the drawer close button when none remain, and cover that sequence in a test?
| x: 0, | ||
| y: 0, | ||
| widgetType, | ||
| i: getWidgetIdentifier(widgetType), |
There was a problem hiding this comment.
getWidgetIdentifier runs once per breakpoint here, so one keyboard-added widget gets a different ID in each layout. GridLayout.removeWidget removes by ID, meaning a widget removed at one width remains in the other layouts and reappears after resizing. Could we generate one ID before this loop and reuse it for every breakpoint?
Issue
Right now a keyboard user has no way to easily add a widget onto a dashboard. Widgets inside the "add widgets" section don't receive focus. This means that for a keyboard users, they cannot add a new widget or add back a widget they accidentally removed. See video below
Screen.Recording.2026-11-12.at.1.42.48.PM.mov
Changes Summary
Video after changes
Screen.Recording.2026-11-12.at.1.34.30.PM.mov
Testing
yarn test --runInBandyarn lint:js./node_modules/.bin/tsc --build --force packages/module/tsconfig.json