FEATURE: Show event description in calendar popup#39076
Merged
Conversation
nattsw
reviewed
Apr 3, 2026
nattsw
reviewed
Apr 3, 2026
| let(:post_event_page) { PageObjects::Pages::DiscourseCalendar::PostEvent.new } | ||
|
|
||
| it "shows clamped description with expand toggle", time: Time.utc(2025, 9, 10, 12, 0) do | ||
| long_description = "This is a long event description. " * 20 |
Contributor
There was a problem hiding this comment.
Maybe we can test with some malicious text here.
Member
Author
There was a problem hiding this comment.
Malicious in like using markdown / html / JS / XSS? Or something else?
nattsw
approved these changes
Apr 3, 2026
When clicking an event in the calendar (upcoming events or category calendar), the popup showed event details like dates, recurrence, and invitees — but not the description. Users had to click through to the topic to see it, which was a common customer complaint. This enables the description in the calendar popup by flipping `@withDescription` to `true` in the `PostEventMenu` component and introducing a `@clampDescription` arg that controls whether the description is truncated. In the popup, descriptions are clamped to 3 lines using the existing `line-clamp` mixin with a "Show more"/"Show less" toggle. A `ResizeObserver` detects whether the text actually overflows, so the toggle only appears when needed. In the topic view, the full description is shown without clamping. The description is stored as plain text (the event parser extracts it via `doc.text.strip` from the cooked HTML), so it's rendered as a plain `<p>` element rather than through `CookText`. This also makes overflow detection straightforward since there's no async rendering. Other changes: - Added a `file-lines` icon and grid layout to the description section to match the visual pattern of other event sections (dates, location, recurrence) - Increased the event loader `min-height` from 100px to 200px to reduce layout shift while the event widget loads - Removed the pre-existing assertion that descriptions auto-link URLs, since descriptions are plain text Ref - t/180829
ad6f43f to
5e0c55b
Compare
|
This pull request has been mentioned on Discourse Meta. There might be relevant details there: https://meta.discourse.org/t/question-include-event-details-when-saving-to-calendar/384713/5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When clicking an event in the calendar (upcoming events or category calendar), the popup showed event details like dates, recurrence, and invitees — but not the description. Users had to click through to the topic to see it, which was a common customer complaint.
This enables the description in the calendar popup by flipping
@withDescriptiontotruein thePostEventMenucomponent and introducing a@clampDescriptionarg that controls whether the description is truncated.In the popup, descriptions are clamped to 3 lines using the existing
line-clampmixin with a "Show more"/"Show less" toggle. AResizeObserverdetects whether the text actually overflows, so the toggle only appears when needed. In the topic view, the full description is shown without clamping.The description is stored as plain text (the event parser extracts it via
doc.text.stripfrom the cooked HTML), so it's rendered as a plain<p>element rather than throughCookText. This also makes overflow detection straightforward since there's no async rendering.Other changes:
file-linesicon and grid layout to the description section to match the visual pattern of other event sections (dates, location, recurrence)min-heightfrom 100px to 200px to reduce layout shift while the event widget loadsCalendar popup


Topic

Ref - t/180829