Skip to content

Unify remaining presenters into decorators#6970

Merged
compwron merged 1 commit into
rubyforgood:mainfrom
hexdevs:unify-presenters-with-decorators
May 29, 2026
Merged

Unify remaining presenters into decorators#6970
compwron merged 1 commit into
rubyforgood:mainfrom
hexdevs:unify-presenters-with-decorators

Conversation

@stefannibrasil
Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

Closes #6909

What changed, and why?

The codebase has two parallel abstractions for view-layer logic:

1- 15 Draper decorators in app/decorators/ — the dominant pattern.
2- 2 presenters in app/presenters/ (BasePresenter, CaseContactPresenter).

Maintaining two abstractions for the same job creates choice paralysis for new contributors and a small amount of cognitive overhead reading the codebase.

This PR moves the remaining presenter logic into a collection decorator and unifies decorating/presenting into app/decorators to reduce cognitive overhead
when maintaining the codebase.

How is this tested? (please write rspec and jest tests!) 💖💪

  • tests pass
  • locally tested the case contacts page

Short video of the page after the changes:
https://github.com/user-attachments/assets/27f58792-f5d0-456e-9877-4647a12b97f6

@github-actions github-actions Bot added 🧪 Tests Tests ruby Touches Ruby code erb Touches ERB templates labels May 28, 2026
@stefannibrasil stefannibrasil force-pushed the unify-presenters-with-decorators branch 2 times, most recently from e44df43 to 95cc830 Compare May 28, 2026 17:35
The codebase has two parallel abstractions for view-layer logic:

1- 15 Draper decorators in app/decorators/ — the dominant pattern.
2- 2 presenters in app/presenters/ (BasePresenter, CaseContactPresenter).

Maintaining two abstractions for the same job creates choice paralysis
for new contributors and a small amount of cognitive overhead
reading the codebase.

This commit move the remaining presenter logic into a
collection decorator and unifies decorating/presenting
into app/decorators to reduce cognitive overhead
when maintaining the codebase.

More unifying work

better names
@stefannibrasil stefannibrasil force-pushed the unify-presenters-with-decorators branch from 95cc830 to b3ea568 Compare May 28, 2026 17:44
Copy link
Copy Markdown
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

nice :)

@compwron compwron merged commit 15b3db7 into rubyforgood:main May 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

erb Touches ERB templates ruby Touches Ruby code 🧪 Tests Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retire app/presenters in favor of Draper decorators

2 participants