Skip to content

FEATURE: Show event description in calendar popup#39076

Merged
ZogStriP merged 2 commits intomainfrom
calendar-event-description-in-popup
Apr 8, 2026
Merged

FEATURE: Show event description in calendar popup#39076
ZogStriP merged 2 commits intomainfrom
calendar-event-description-in-popup

Conversation

@ZogStriP
Copy link
Copy Markdown
Member

@ZogStriP ZogStriP commented Apr 2, 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

Calendar popup
2026-04-02 @ 14 40 48
2026-04-02 @ 14 40 53

Topic
2026-04-02 @ 14 41 01

Ref - t/180829

@github-actions github-actions Bot added i18n PRs which update English locale files or i18n related code discourse-calendar labels Apr 2, 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we can test with some malicious text here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Malicious in like using markdown / html / JS / XSS? Or something else?

ZogStriP added 2 commits April 3, 2026 14:57
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
@ZogStriP ZogStriP force-pushed the calendar-event-description-in-popup branch from ad6f43f to 5e0c55b Compare April 3, 2026 13:36
@ZogStriP ZogStriP merged commit 40ea3cf into main Apr 8, 2026
19 checks passed
@ZogStriP ZogStriP deleted the calendar-event-description-in-popup branch April 8, 2026 14:50
@discoursebot
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discourse-calendar i18n PRs which update English locale files or i18n related code

Development

Successfully merging this pull request may close these issues.

3 participants