Skip to content

Migrate first admin mailer and navigation views to ERB#4

Closed
mfo wants to merge 1 commit into
US/haml-to-herbfrom
codex/migrate-haml-to-html-erb-views
Closed

Migrate first admin mailer and navigation views to ERB#4
mfo wants to merge 1 commit into
US/haml-to-herbfrom
codex/migrate-haml-to-html-erb-views

Conversation

@mfo

@mfo mfo commented Sep 17, 2025

Copy link
Copy Markdown
Owner

Summary

  • add missing view specs for admin pagination, mailers, and navigation components to support snapshotting
  • capture baseline HTML snapshots with deterministic filenames for the migrated views
  • convert the first batch of HAML templates (admin alerts, pagination, admin mailers, and navigation partials) to ERB while preserving layout and helpers

Testing

  • bundle exec herb analyze . (fails: herb analyze raises "negative argument" inside Herb::Project#progress_bar)
  • bin/rake lint (fails: bun lint:herb cannot find the herb-lint executable)
  • bundle exec rspec spec/views (fails: many legacy view specs depend on asset pipeline artefacts such as pictograms and fail without them)

https://chatgpt.com/codex/tasks/task_e_68c90957c8388321aac532ec9c9102f8

@mfo
mfo requested a review from Copilot September 17, 2025 07:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the first batch of HAML templates to ERB format while preserving layout and helpers, alongside adding comprehensive view specs with baseline HTML snapshots for the converted templates.

  • Convert admin alert, navigation, and mailer views from HAML to ERB
  • Add missing view specs for pagination, mailers, and navigation components
  • Generate deterministic HTML snapshots to support future comparison testing

Reviewed Changes

Copilot reviewed 43 out of 47 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/views/administrateurs/_*.html.{haml,erb} Convert navigation, breadcrumbs, login banner, and groups header partials from HAML to ERB
app/views/administrateur_mailer/*.html.{haml,erb} Migrate mailer templates for service notifications, API token expiration, and account activation
app/views/administrate/application/_pagination.html.{haml,erb} Convert pagination partial from HAML to ERB
app/views/admin/_closed_mail_template_attestation_inconsistency_alert.html.{haml,erb} Migrate alert template from HAML to ERB
spec/views/**/*_spec.rb Add comprehensive view specs for all migrated templates
spec/views/**/*.html Generate baseline HTML snapshots for regression testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +4 to +5
<% alert_classes = ['alert', flash_class('alert')].compact.join(' ') %>
<div class="<%= alert_classes %>">

Copilot AI Sep 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alert_classes variable is defined and used only once. Consider inlining this logic directly in the class attribute: <div class=\"alert <%= flash_class('alert') %>\">

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +21
<% alert_classes = ['alert', flash_class('alert')].compact.join(' ') %>
<div class="<%= alert_classes %>">

Copilot AI Sep 17, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated logic for building alert classes. This is repeated from lines 4-5. Consider extracting this into a helper method or using the same inline approach consistently.

Copilot uses AI. Check for mistakes.
@mfo

mfo commented Sep 17, 2025

Copy link
Copy Markdown
Owner Author

je veux les commits propres.

@mfo mfo closed this Sep 17, 2025
mfo added a commit that referenced this pull request Mar 5, 2026
Create a single component that replaces UniqueComponent and
MultipleComponent:
- Handles both single (max=1) and multiple (max>1) files
- Automatically deduces max from has_one vs has_many
- Explicit drop_zone parameter (:none or :integrated)
- Shows uploader OR file for single, uploader AND files for multiple

This simplifies the architecture by eliminating the Unique/Multiple
distinction and making behavior more predictable.

Includes comprehensive specs.

Part of attachment components refactoring (#4/7)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
mfo added a commit that referenced this pull request Mar 6, 2026
Create a single component that replaces UniqueComponent and
MultipleComponent:
- Handles both single (max=1) and multiple (max>1) files
- Automatically deduces max from has_one vs has_many
- Explicit drop_zone parameter (:none or :integrated)
- Shows uploader OR file for single, uploader AND files for multiple

This simplifies the architecture by eliminating the Unique/Multiple
distinction and making behavior more predictable.

Includes comprehensive specs.

Part of attachment components refactoring (#4/7)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
mfo added a commit that referenced this pull request Mar 6, 2026
Create a single component that replaces UniqueComponent and
MultipleComponent:
- Handles both single (max=1) and multiple (max>1) files
- Automatically deduces max from has_one vs has_many
- Explicit drop_zone parameter (:none or :integrated)
- Shows uploader OR file for single, uploader AND files for multiple

This simplifies the architecture by eliminating the Unique/Multiple
distinction and making behavior more predictable.

Includes comprehensive specs.

Part of attachment components refactoring (#4/7)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
mfo added a commit that referenced this pull request Mar 6, 2026
Create a single component that replaces UniqueComponent and
MultipleComponent:
- Handles both single (max=1) and multiple (max>1) files
- Automatically deduces max from has_one vs has_many
- Explicit drop_zone parameter (:none or :integrated)
- Shows uploader OR file for single, uploader AND files for multiple

This simplifies the architecture by eliminating the Unique/Multiple
distinction and making behavior more predictable.

Includes comprehensive specs.

Part of attachment components refactoring (#4/7)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
mfo added a commit that referenced this pull request Mar 16, 2026
Create a single component that replaces UniqueComponent and
MultipleComponent:
- Handles both single (max=1) and multiple (max>1) files
- Automatically deduces max from has_one vs has_many
- Explicit drop_zone parameter (:none or :integrated)
- Shows uploader OR file for single, uploader AND files for multiple

This simplifies the architecture by eliminating the Unique/Multiple
distinction and making behavior more predictable.

Includes comprehensive specs.

Part of attachment components refactoring (#4/7)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
mfo added a commit that referenced this pull request Mar 16, 2026
Create a single component that replaces UniqueComponent and
MultipleComponent:
- Handles both single (max=1) and multiple (max>1) files
- Automatically deduces max from has_one vs has_many
- Explicit drop_zone parameter (:none or :integrated)
- Shows uploader OR file for single, uploader AND files for multiple

This simplifies the architecture by eliminating the Unique/Multiple
distinction and making behavior more predictable.

Includes comprehensive specs.

Part of attachment components refactoring (#4/7)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
mfo added a commit that referenced this pull request Mar 16, 2026
Create a single component that replaces UniqueComponent and
MultipleComponent:
- Handles both single (max=1) and multiple (max>1) files
- Automatically deduces max from has_one vs has_many
- Explicit drop_zone parameter (:none or :integrated)
- Shows uploader OR file for single, uploader AND files for multiple

This simplifies the architecture by eliminating the Unique/Multiple
distinction and making behavior more predictable.

Includes comprehensive specs.

Part of attachment components refactoring (#4/7)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants