Mothership workspace
| Owner | Ada Lovelace |
|---|---|
| Status | Active |
| Updated on |
Active Storage images with low-resolution previews and explicit lifecycle states.
app/components/nitro_kit/progressive_image.rbNitroKit::ProgressiveImage.new(attachment:, alt:, size: :md, decorative: false)A decorative low-resolution variant covers the full image until browser decoding succeeds.
test/dummy/app/components/gallery/components/progressive_image_page.rbrender NitroKit::ProgressiveImage.new(
attachment: image_attachment,
alt: "Abstract indigo workspace illustration",
size: :lg,
id: "gallery-progressive-image-loaded"
)Closed sizes request predictable one- and two-density Active Storage variants without accepting arbitrary processing options.
test/dummy/app/components/gallery/components/progressive_image_page.rbNitroKit::ProgressiveImage::SIZES.each do |size|
sample(size.to_s.upcase, slug: size) do
render NitroKit::ProgressiveImage.new(
attachment: image_attachment,
alt: "Abstract indigo workspace illustration",
size:,
id: "gallery-progressive-image-#{size}"
)
end
endEmpty markup is complete on the server; failed loads reveal the fallback while preserving informative alt text.
test/dummy/app/components/gallery/components/progressive_image_page.rbsample("Empty attachment", slug: "empty") do
render NitroKit::ProgressiveImage.new(
attachment: nil,
alt: "Workspace cover",
size: :sm,
id: "gallery-progressive-image-empty"
)
end
sample("Failed variant", slug: "error") do
render NitroKit::ProgressiveImage.new(
attachment: broken_attachment,
alt: "Unavailable workspace cover",
size: :sm,
id: "gallery-progressive-image-error"
)
endThe placeholder never enters the accessibility tree; decorative full images also use an empty alt.
test/dummy/app/components/gallery/components/progressive_image_page.rbrender NitroKit::ProgressiveImage.new(
attachment: image_attachment,
alt: nil,
decorative: true,
size: :md,
id: "gallery-progressive-image-decorative"
)Progressive media, a card, status, and record details compose without utility classes or helper registration.
| Owner | Ada Lovelace |
|---|---|
| Status | Active |
| Updated on |
test/dummy/app/components/gallery/components/progressive_image_page.rbrender NitroKit::Card.new(id: "gallery-progressive-image-card") do |card|
card.full_width do
render NitroKit::ProgressiveImage.new(
attachment: image_attachment,
alt: "Abstract indigo workspace illustration",
size: :lg,
id: "gallery-progressive-image-card-media"
)
end
card.title(SUMMARY.title, level: 3)
card.body do
render NitroKit::DetailsTable.new(SUMMARY, id: "gallery-progressive-image-card-details") do |details|
details.field(:owner)
details.field(:status) do |status|
render NitroKit::Badge.new(
status.to_s.humanize,
id: "gallery-progressive-image-card-status",
color: :success,
size: :sm
)
end
details.field(:updated_on)
end
end
end