From 5a42af33ecfc5549e60d4aa840ae02fe950e3b83 Mon Sep 17 00:00:00 2001 From: SB Software Agent Date: Thu, 26 Feb 2026 23:50:39 +0100 Subject: [PATCH 1/6] CR-126 Add drop-in PWA install component with deferred prompt and iOS Safari fallback panel --- spec/pwa_install_component_spec.cr | 59 +++++++++ src/crumble.cr | 1 + src/pwa_install_component.cr | 198 +++++++++++++++++++++++++++++ 3 files changed, 258 insertions(+) create mode 100644 spec/pwa_install_component_spec.cr create mode 100644 src/pwa_install_component.cr diff --git a/spec/pwa_install_component_spec.cr b/spec/pwa_install_component_spec.cr new file mode 100644 index 0000000..77d2652 --- /dev/null +++ b/spec/pwa_install_component_spec.cr @@ -0,0 +1,59 @@ +require "./spec_helper" + +module Crumble::PwaInstallComponentSpec + class LayoutWithInstall < ToHtml::Layout + ToHtml.instance_template do + super do + Crumble::PwaInstallComponent.new(ctx: ctx).to_html + end + end + + def window_title + "Pwa Install Component Spec" + end + end +end + +describe Crumble::PwaInstallComponent do + it "renders as a drop-in layout component via #to_html" do + html = Crumble::PwaInstallComponentSpec::LayoutWithInstall.new(ctx: test_handler_context).to_html + + html.should contain(%(