2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-08-17 18:04:11 +08:00
discourse/lib/onebox
Kris 5ddd04fa0b
UX: improve quote title alignment, wrapping (#33796)
Reported here:
https://meta.discourse.org/t/expand-quote-arrow-new-line-creates-gap-in-quote-style/375067

In cases of long content and narrow viewports, sometimes quote content
can break the layout:

<img width="244" alt="image"
src="https://github.com/user-attachments/assets/3674cabb-e278-4bec-a9cf-48623dfdce6c"
/>


This improves the situation by adding an additional wrapper to the quote
onebox title and category. This allows text to wrap independently from
the avatar and controls, and in worst cases the text truncates:

<img width="500" alt="image"
src="https://github.com/user-attachments/assets/3e29bf52-0b36-4f70-8237-22ee3b9377b2"
/>

<img width="300" alt="image"
src="https://github.com/user-attachments/assets/8fbd83bf-dafd-42cc-a470-a928c252c183"
/>

Even without a post HTML rebuild for the quotes to get the new wrapper,
the new CSS prevents layout breakage through `text-overflow: ellipsis;`
alone

Old quote without the new wrapper, but with the new CSS:

<img width="350" alt="image"
src="https://github.com/user-attachments/assets/8922bce0-17a7-4731-a1de-33daad9d7b37"
/>
2025-07-23 16:21:55 -04:00
..
engine FIX: correctly unescape title for amazon oneboxes (#33010) 2025-06-02 17:50:13 +05:30
mixins UX: Improve git blob oneboxes (#30694) 2025-01-10 11:49:36 +00:00
templates UX: improve quote title alignment, wrapping (#33796) 2025-07-23 16:21:55 -04:00
domain_checker.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
engine.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
file_type_finder.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
helpers.rb DEV: Drop 'cache_onebox_response_body' feature (#32035) 2025-03-28 10:55:29 +00:00
json_ld.rb DEV: Replace custom Onebox blank implementation with ActiveSupport (#23827) 2023-10-07 19:54:26 +02:00
layout.rb DEV: Replace custom Onebox symbolize_keys implementation with ActiveSupport (#23828) 2023-10-09 09:32:09 +02:00
layout_support.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
matcher.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
movie.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
normalizer.rb DEV: Replace custom Onebox blank implementation with ActiveSupport (#23827) 2023-10-07 19:54:26 +02:00
oembed.rb DEV: Replace custom Onebox symbolize_keys implementation with ActiveSupport (#23828) 2023-10-09 09:32:09 +02:00
open_graph.rb DEV: Replace custom Onebox blank implementation with ActiveSupport (#23827) 2023-10-07 19:54:26 +02:00
preview.rb DEV: Remove logical OR assignment of constants (#29201) 2024-10-16 10:09:07 +08:00
sanitize_config.rb DEV: Bump rubocop_discourse (#29608) 2024-11-06 06:27:49 +08:00
status_check.rb SECURITY: Expand and improve SSRF Protections (#18815) 2022-11-01 16:33:17 +00:00
template_support.rb
view.rb