Skip to content

DEV: Ensure the collapsed content of quoted posts is decorated #33740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 22, 2025

Conversation

megothss
Copy link
Contributor

@megothss megothss commented Jul 21, 2025

This PR refactors the PostCookedHtml and PostQuotedContent components to enhance how quoted posts are rendered and decorated. It introduces a new className prop for customizing the class of cooked HTML, and ensures collapsed quote content is consistently decorated with appropriate styles and structure.

Key changes:

  • Adds a className argument to PostCookedHtml, allowing quoted content to have a distinct class for easier styling.
  • Updates PostQuotedContent to render collapsed and expanded quoted content through PostCookedHtml, ensuring consistent decoration and disabling selection barriers for quoted posts.
  • Refines decorator application logic in PostCookedHtml to conditionally apply selection barriers.
  • Improves CSS by targeting quoted content within blockquotes, ensuring top and bottom margins are correctly removed from child elements.
  • Updates acceptance tests to support both classic and glimmer post stream modes, verifying composer actions and quoted content behavior across modes.

megothss added 3 commits July 21, 2025 19:05
- Refactored `blockquote` styles to include `.cooked` class adjustments for consistent padding and margin handling.
- Reintroduced conditional support for the `decorateSelectionBarrier` using a computed `shouldAddSelectionBarrier` property.
- Improved decorator management and cleanup logic in `decorateBeforeAdopt`.
… handling

- Removed `.cooked` class styles under `blockquote`.
- Replaced `.cooked` with `.quote-cooked` for improved specificity.
- Ensured proper margin adjustments for first and last child elements within `blockquote`.
- Introduced `@className` property in `PostCookedHtml` for flexible class assignment.
- Updated `blockquote` styles to replace `.quote-cooked` with `.post__contents-cooked-quote`.
- Expanded `Composer Actions` tests to ensure compatibility with `glimmer_post_stream_mode`.
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/category-and-tag-badges-are-misaligned-and-lose-their-colour-in-quotes/372897/12

@@ -173,7 +173,7 @@ export default class PostQuotedContent extends Component {
>
{{#if @wrapperElement}}
{{! `this.OptionalWrapperComponent` can be empty to render only the children while decorating cooked content.
we need to handle the attributtes below in the existing wrapper received as @wrapperElement in this case }}
we need to handle the attributtes below in the existing wrapper received as @wrapperElement in this case }}
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: looks like an unintentional indentation change?

Corrected a minor typo in the inline comment for better clarity and accuracy regarding the handling of `@wrapperElement`.
@megothss megothss merged commit 5d601d3 into main Jul 22, 2025
16 checks passed
@megothss megothss deleted the dev/decorate-quote-collapsed-content-properly branch July 22, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants