feat: [138] Backport: Views::TurboStream-Basisklasse + Notification-Komponenten + Card-Verallgemeinerung aus Centinel #143

Merged
forgejo-bot merged 2 commits from enhancement/138_turbo_stream_base_and_notification_components into main 2026-10-28 12:58:26 +00:00
Owner

Backport von rails-base_app Issue #138 – die in Centinel (PRs #54, #56, #63) gebauten Bausteine zurück in die Base-App.

Views::TurboStream-Basisklasse

  • app/views/turbo_stream.rb: Views::TurboStream < Views::Base mit layout(nil), class_attribute :_target/:_action, Klassen-DSL target/action (Proc-fähig) und Instanz-Readern turbo_target/turbo_action
  • PhlexRenderer: default_render rendert TurboStream-Views als turbo_stream-Response; resolve_phlex_class hängt Nicht-HTML-Formate als Modul an (::TurboStream)

Notification-Komponenten-Split

  • Layout::Flash → Layout::Notification (einzelne Toast-Card, type/title/message/debug, Keys components.layout.notification.*)
  • Layout::Notifications neu: Container mit id: "notifications", wird immer gerendert, damit Turbo-Streams andocken können
  • Navbar, Form und Application-Layout auf die neuen Keys umgestellt

Card-Verallgemeinerung

  • with_body-Attribut (default true) und öffentliche body(**options)-Methode
  • action_icon (konfigurierbarer Footer-Pfeil) und data-Attribute
  • pages/home.rb (Login-Karte) und registrations/new.rb auf das neue Muster umgestellt

Flash-Backport

  • 9 fehlende Flash-Keys ergänzt (aus Centinel 84aa058): admin.update.error, oauth_sessions.destroy.error, passwords.edit.error, passwords.update.error, sessions.destroy_all.success, sessions.passkeys.create.unknown, settings.profile.update.error, settings.security.update.error, settings.security.passkeys.create.error + .destroy.success
  • Unbenutzten helpers.flash.icons-Block entfernt (Icons liegen jetzt unter components.layout.notification.icons)
  • test/i18n/flash_translations_test.rb neu: parst alle Controller via Prism und prüft, dass jeder set_flash-Aufruf unter dem Laufzeit-Key helpers.flash.<controller>.<action>.<type>.message übersetzt ist

Tests

  • test/views/turbo_stream_test.rb neu (ProbeStream/ProcStream, Klassen-Prädikate, Symbol/Proc-Auflösung, Layout-los-Render)
  • test/views/base_test.rb um Klassen-Prädikate (_layout_class?/_layout_options?) ergänzt

Full Suite: 281 runs, 0 failures · Coverage 98.04 / 81.88 / 97.51 · Rubocop clean · i18n-tasks health grün

Closes #138

Backport von rails-base_app Issue #138 – die in Centinel (PRs #54, #56, #63) gebauten Bausteine zurück in die Base-App. ## Views::TurboStream-Basisklasse - `app/views/turbo_stream.rb`: `Views::TurboStream < Views::Base` mit `layout(nil)`, `class_attribute :_target/:_action`, Klassen-DSL `target`/`action` (Proc-fähig) und Instanz-Readern `turbo_target`/`turbo_action` - PhlexRenderer: `default_render` rendert TurboStream-Views als `turbo_stream`-Response; `resolve_phlex_class` hängt Nicht-HTML-Formate als Modul an (`::TurboStream`) ## Notification-Komponenten-Split - `Layout::Flash` → `Layout::Notification` (einzelne Toast-Card, `type/title/message/debug`, Keys `components.layout.notification.*`) - `Layout::Notifications` neu: Container mit `id: "notifications"`, wird immer gerendert, damit Turbo-Streams andocken können - Navbar, Form und Application-Layout auf die neuen Keys umgestellt ## Card-Verallgemeinerung - `with_body`-Attribut (default `true`) und öffentliche `body(**options)`-Methode - `action_icon` (konfigurierbarer Footer-Pfeil) und `data`-Attribute - `pages/home.rb` (Login-Karte) und `registrations/new.rb` auf das neue Muster umgestellt ## Flash-Backport - 9 fehlende Flash-Keys ergänzt (aus Centinel 84aa058): `admin.update.error`, `oauth_sessions.destroy.error`, `passwords.edit.error`, `passwords.update.error`, `sessions.destroy_all.success`, `sessions.passkeys.create.unknown`, `settings.profile.update.error`, `settings.security.update.error`, `settings.security.passkeys.create.error` + `.destroy.success` - Unbenutzten `helpers.flash.icons`-Block entfernt (Icons liegen jetzt unter `components.layout.notification.icons`) - `test/i18n/flash_translations_test.rb` neu: parst alle Controller via Prism und prüft, dass jeder `set_flash`-Aufruf unter dem Laufzeit-Key `helpers.flash.<controller>.<action>.<type>.message` übersetzt ist ## Tests - `test/views/turbo_stream_test.rb` neu (ProbeStream/ProcStream, Klassen-Prädikate, Symbol/Proc-Auflösung, Layout-los-Render) - `test/views/base_test.rb` um Klassen-Prädikate (`_layout_class?`/`_layout_options?`) ergänzt Full Suite: 281 runs, 0 failures · Coverage 98.04 / 81.88 / 97.51 · Rubocop clean · i18n-tasks health grün Closes #138
feat: [138] backport TurboStream base class, notification components and card generalization
Some checks failed
PR Triage / Triage pull request (pull_request) Successful in 0s
PR Triage / Triage pull request-1 (pull_request) Successful in 44s
CI / Quality / Bundler Audit (pull_request) Successful in 1m7s
CI / Quality / Brakeman (pull_request) Successful in 1m11s
CI / Quality / RuboCop (pull_request) Successful in 1m14s
CI / Quality (pull_request) Successful in 0s
CI / Tests / Unit (pull_request) Successful in 1m33s
CI / Tests / System (pull_request) Successful in 1m39s
CI / Tests / Coverage (pull_request) Failing after 28s
CI / Tests (pull_request) Failing after 0s
CI / Container / Build and push (pull_request) Has been skipped
CI / Container (pull_request) Failing after 0s
CI / Deploy (pull_request) Has been skipped
a4e3ca0154
- Views::TurboStream base class with target/action class DSL (proc-capable)
- PhlexRenderer renders TurboStream views as turbo_stream responses
- Flash component split into Layout::Notification (single toast) and
  Layout::Notifications (always-rendered container for stream anchoring)
- Card component: with_body attribute, public body method, action_icon
  and data attributes; home and registrations views use the new pattern
- Backport 9 missing flash translations from Centinel (84aa058)
- FlashTranslationsTest parses controllers via Prism and verifies every
  set_flash call has a runtime translation

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
forgejo-actions changed title from [138] Backport: Views::TurboStream-Basisklasse + Notification-Komponenten + Card-Verallgemeinerung aus Centinel to feat: [138] Backport: Views::TurboStream-Basisklasse + Notification-Komponenten + Card-Verallgemeinerung aus Centinel 2026-10-14 17:46:56 +00:00
forgejo-bot scheduled this pull request to auto merge when all checks succeed 2026-10-14 17:46:57 +00:00
forgejo-bot canceled auto merging this pull request when all checks succeed 2026-10-14 17:46:58 +00:00
forgejo-bot scheduled this pull request to auto merge when all checks succeed 2026-10-14 17:46:58 +00:00
forgejo-bot canceled auto merging this pull request when all checks succeed 2026-10-14 17:46:58 +00:00
forgejo-bot scheduled this pull request to auto merge when all checks succeed 2026-10-14 17:46:58 +00:00

📊 Coverage

Metrik Abdeckung
Zeilen 98.12% (2667/2718)
Branches 82.63% (666/806)
Methoden 97.52% (432/443)

Patch-Coverage: 92.96% (66/71 geänderte Zeilen)

Geänderte Dateien (schwach zuerst)

Datei Patch-Coverage Fehlende Zeilen
app/controllers/concerns/phlex_renderer.rb 80.0% (4/5) 21
app/components/layout/notification.rb 80.95% (17/21) 29-32
app/views/turbo_stream.rb 100.0% (14/14)
app/components/card.rb 100.0% (11/11)
app/components/layout/notifications.rb 100.0% (11/11)
app/views/pages/home.rb 100.0% (3/3)
app/views/registrations/new.rb 100.0% (3/3)
app/components/form.rb 100.0% (1/1)
app/components/layout/navbar.rb 100.0% (1/1)
app/views/layouts/application_layout.rb 100.0% (1/1)

Schwächste Dateien im Projekt

Datei Abdeckung
app/components/form/select.rb 72.41%
app/components/layout/notification.rb 80.95%
app/components/concerns/actionable.rb 86.67%
app/components/layout/sidebar.rb 89.47%
app/components/concerns/inferrable.rb 90.63%
app/models/concerns/has_uuid_v7.rb 90.91%
app/components/users/avatar.rb 91.23%
app/controllers/settings/security/otps_controller.rb 91.67%
app/components/base.rb 92.16%
app/controllers/settings/security/passkeys_controller.rb 92.31%

🔍 Report im Browser ansehen · 📄 Run-Artifact „coverage-report“

<!-- coverage-report --> ## 📊 Coverage | Metrik | Abdeckung | |---|---| | Zeilen | 98.12% (2667/2718) | | Branches | 82.63% (666/806) | | Methoden | 97.52% (432/443) | **Patch-Coverage**: 92.96% (66/71 geänderte Zeilen) **Geänderte Dateien (schwach zuerst)** | Datei | Patch-Coverage | Fehlende Zeilen | |---|---|---| | app/controllers/concerns/phlex_renderer.rb | 80.0% (4/5) | 21 | | app/components/layout/notification.rb | 80.95% (17/21) | 29-32 | | app/views/turbo_stream.rb | 100.0% (14/14) | | | app/components/card.rb | 100.0% (11/11) | | | app/components/layout/notifications.rb | 100.0% (11/11) | | | app/views/pages/home.rb | 100.0% (3/3) | | | app/views/registrations/new.rb | 100.0% (3/3) | | | app/components/form.rb | 100.0% (1/1) | | | app/components/layout/navbar.rb | 100.0% (1/1) | | | app/views/layouts/application_layout.rb | 100.0% (1/1) | | **Schwächste Dateien im Projekt** | Datei | Abdeckung | |---|---| | app/components/form/select.rb | 72.41% | | app/components/layout/notification.rb | 80.95% | | app/components/concerns/actionable.rb | 86.67% | | app/components/layout/sidebar.rb | 89.47% | | app/components/concerns/inferrable.rb | 90.63% | | app/models/concerns/has_uuid_v7.rb | 90.91% | | app/components/users/avatar.rb | 91.23% | | app/controllers/settings/security/otps_controller.rb | 91.67% | | app/components/base.rb | 92.16% | | app/controllers/settings/security/passkeys_controller.rb | 92.31% | [🔍 Report im Browser ansehen](https://pages.hoppe-dev.eu/hobbypunk-rails-base_app/pr-143/coverage) · [📄 Run-Artifact „coverage-report“](https://code.hoppe-dev.eu/hobbypunk/rails-base_app/actions/runs/3408/artifacts/coverage-report)
feat(omniauth): upgrade omniauth_oidc to version 1.1.0
All checks were successful
PR Triage / Triage pull request-1 (pull_request) Successful in 7s
PR Triage / Triage pull request (pull_request) Successful in 0s
CI / Quality / Bundler Audit (pull_request) Successful in 2m10s
CI / Quality / Brakeman (pull_request) Successful in 2m18s
CI / Quality / RuboCop (pull_request) Successful in 2m15s
CI / Quality (pull_request) Successful in 0s
CI / Tests / Unit (pull_request) Successful in 2m39s
CI / Tests / System (pull_request) Successful in 2m39s
CI / Tests / Coverage (pull_request) Successful in 50s
CI / Tests (pull_request) Successful in 0s
CI / Container / Build and push (pull_request) Successful in 7s
CI / Container (pull_request) Successful in 0s
CI / Deploy (pull_request) Has been skipped
87385eea29
forgejo-bot canceled auto merging this pull request when all checks succeed 2026-10-28 12:54:54 +00:00
forgejo-bot scheduled this pull request to auto merge when all checks succeed 2026-10-28 12:54:54 +00:00
forgejo-bot deleted branch enhancement/138_turbo_stream_base_and_notification_components 2026-10-28 12:58:26 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hobbypunk/rails-base_app!143
No description provided.