Bulk actions bar

On a branch in the app

Port of Ui::BulkActionsBarComponent from roastertools-app's origin/jon-dev-3250-shared-list-controls branch (app/components/ui/bulk_actions_bar_component.{rb,html.erb}). Bulk-action bar that swaps into the toolbar slot while table rows are selected. Bulk bar colour decision (conflict 1): the branch's light navy/5, not the workshop's dark stone or the mocks' mustard tint. It carries no bottom rule of its own (2026-10-05; the branch's navy/20, then 2px stone-dark from 2026-10-02) — ListChrome draws the strip's one rule, so the card's top edge keeps its weight whether the toolbar or the bar is showing. The navy/5 fill is what tells the bar from the white toolbar it replaces. Classes are the branch's verbatim, respelled: tw- stripped; border-0 border-solid dropped; sizes by pixel at the app's 14px root (conflict 13): text-base → text-ui-sm, text-sm → text-ui-xs; bg-opacity-5 → bg-navy/5, border-opacity-20 → border-navy/20, bg-opacity-10 → bg-stone-dark/10. Stimulus hooks kept as data attributes so the markup matches the app: the bar is data-selectable-target="selectAction" (shown while rows are selected), the count is data-selectable-target="selectedCount" (the controller writes the live number into it), and the Clear button's click->selectable#unSelectAll → onClear. Secondary actions use BULK_SECONDARY_BUTTON_CLASSES (≈ Button tertiary sm; conflict 12); the primary action is a Button primary sm.

App: Ui::BulkActionsBarComponent (origin/jon-dev-3250-shared-list-controls)

Three rows selected

#selection

visible with a live selected_count: the navy/5 bar with its navy/20 rule takes the toolbar's slot. Two secondary actions use BULK_SECONDARY_BUTTON_CLASSES and the primary one is a Button primary sm; a stone-dark/10 divider separates the Clear selection control (a light times icon). Wraps at 390.

3 selected

Summary instead of a count

#summary

summary replaces the live count with the page's copy, e.g. a queued bulk job's progress, and clearable={false} drops the Clear control because the state no longer tracks a selection.

Sending 3 receipts…

Hidden until a row is selected

#hidden

visible={false} (the default) renders the bar with the hidden class: it is in the DOM as the selectable controller's selectAction target but takes no space until a row is selected. Nothing shows below this line.

(BulkActionsBar rendered above with visible={false}; it takes no space.)

Props

NameTypeDefaultNotes
idstring—Required. The bar's id; pages replacing the bar (a queued-import message) reuse it
visiblebooleanfalsefalse leaves the bar hidden until a row is selected; previews and the composed list pass the live value
clearablebooleantruefalse drops the Clear selection control, for a state that no longer tracks a selection
selected_countnumber0The live "N selected" count
summaryReactNode—Replaces the live count, e.g. a queued bulk job's progress copy (the app's summary slot)
actionsReactNode—The page's action buttons (the app's actions slot). Secondary ones use BULK_SECONDARY_BUTTON_CLASSES
onClear() => void—Mock behaviour: the app's click->selectable#unSelectAll
stack_belowmd | lg—The list is a StackedList below this width (2026-10-15): there the bar floats at the foot of the screen — white, 2px stone-dark, brutalist shadow, z-40 — with the count, Select all and the clear on one line and the actions under it
onSelectAll() => void—Mock behaviour: the app's click->selectable#selectAll. Shown only while floating; the stacked list has no head row for the select-all box
all_selectedbooleanfalseHides Select all
classNamestring—On the bar <div>