Posts and chat messages with inline oneboxes to GitHub PRs were being
unnecessarily rebaked when the PR status changed. This happened because
the check `cooked.include?("onebox")` matched both full oneboxes
(`class="onebox githubpullrequest"`) and inline oneboxes
(`class="inline-onebox"`).
Changed the check to match "githubpullrequest" specifically, which only
appears in full PR oneboxes that actually display the status.
Internal ref - t/169442
In #35409, a fix has been implemented to deal with the loading loop when
a topic is removed.
However, that PR hasn't fully solved that problem. In the Glimmer
Post Stream, the fetch API is `findPostsByIds`->`loadIntoIdentityMap`
rather than the original `fetchNextWindow`, causing a regression.
This PR adds the same logic to the `loadIntoIdentityMap` function, so
that the logic works as well in the post-stream.
Co-authored-by: Sérgio Saquetim <1108771+megothss@users.noreply.github.com>
This commit:
* cleans up some DOM structure for the chat channel icons
* adds more clear classes for --emoji and --icon type icons
* removes the different background for the chat index page
* aligns all channel icons, regardless of type
I'm also trying out some styling changes for mobile on the starred
channel index:
| BC | AC |
|--------|--------|
| <img width="668" height="1490" alt="CleanShot 2025-12-09 at 18 01
30@2x"
src="https://github.com/user-attachments/assets/8b589b23-851a-48d4-a96d-717cb37c3eee"
/> | <img width="668" height="1490" alt="CleanShot 2025-12-09 at 17 59
05@2x"
src="https://github.com/user-attachments/assets/b65278df-8cf2-437b-9827-8e68960d6038"
/> |
---------
Co-authored-by: zogstrip <regis@hanol.fr>
Commit f06fd595f6 introduced a regression where opening fullscreen chat
on desktop would show a broken UI with the starred channels panel
floating over the main chat view.
The issue was a circular redirect: `lastKnownChatURL` returned
`/chat/starred-channels` when users had starred channels, but this route
redirects away on desktop (since starred channels are shown in the
sidebar). The redirect used `lastKnownChatURL` again, causing a loop.
This fix ensures `lastKnownChatURL` only defaults to
`/chat/starred-channels` when in mobile view or drawer mode, where the
dedicated route is needed. On desktop fullscreen, it defaults to `/chat`
since starred channels are already visible in the sidebar.
Internal ref - t/170435
When rebaking a post with `invalidate_oneboxes: true`, the UI would
briefly show raw links before the full oneboxes appeared. This caused
a jarring visual shift as the post height changed.
The issue was that `rebake!` published a `:rebaked` message immediately
after clearing the onebox cache, before the background job had a chance
to fetch fresh oneboxes. This meant the UI received an update with just
the raw links, then a second update with the rendered oneboxes.
Skip publishing `:rebaked` when `invalidate_oneboxes: true` since the
`ProcessPost` job will publish `:revised` after fetching fresh oneboxes.
Internal ref - t/169442
Also includes
UX: use min-height to prevent layout shift when the status icon changes
When users click the chat icon without a previously known location, the
app now opens to "/chat/starred-channels" if the user has any starred
channels, otherwise falls back to "/chat".
This improves discoverability of the starred channels feature and
provides a more personalized default experience for users who have
organized their channels with stars.
Internal ref - t/170435
## Summary
- Loads initial 3 reports on page load, fetches more as user scrolls (at
70% scroll depth)
- Adds `GET /rewinds/:index` endpoint to fetch individual reports by
index
- Gracefully skips failed requests (network errors) and continues
loading subsequent reports
- Auto-loads more content when screen is tall enough to display all
reports without scrolling
## Test plan
- [x] Visit rewind page, verify initial 3 reports load
- [x] Scroll down, verify more reports load progressively
- [x] Block a request in DevTools, verify subsequent reports still load
- [x] Test on tall display, verify all reports eventually load without
scrolling
This allows the category template editing form to be reused from a
plugin, and I also fixed a bug with `form-template-chooser` throwing an
error on save.
Fix GitHub PR onebox updates not working for chat messages.
When a GitHub webhook triggered the `RebakeGithubPrPosts` job, chat
messages containing PR links were not being rebaked. The issue was
twofold:
1. `defined?(Chat::MessageLink)` doesn't trigger Rails autoloading - it
only checks if a constant is already loaded, so it would return `nil`
before the class was ever accessed
2. Inside `module Jobs`, Ruby's constant resolution would look for
`Jobs::Chat::MessageLink` before the global `::Chat::MessageLink`
- Replace `defined?(Chat)` check with `SiteSetting.chat_enabled` which
is the idiomatic Discourse pattern for checking plugin availability
- Remove the redundant `defined?(Chat::MessageLink)` guard since the
site setting check already handles this
- Add `::` prefix to `Chat::MessageLink` and `Chat::Message` references
to ensure they resolve to the global namespace
Internal ref - t/169442
Replies to topics linked to Zendesk were not being synced.
The `after_commit` callback used `topic.custom_fields[...]` which
returns memoized data. If a Zendesk ticket was linked by another process
after the topic was loaded, the stale cache would return empty and skip
the sync job.
Query `TopicCustomField.exists?` directly instead of relying on the
cached `custom_fields` hash.
Internal ref - t/169124
* Use channel slug instead of channel name for chat usage report,
since some channels don't have names, and the slug will have a
more consistent format.
* Fix wording for DM count so it's clear it includes group DMs.
* Introduce rewind header icon. This will be shown after the user
has dismissed rewind. It will show in the header until Rewind is
no longer active (any month not December/January) or until Rewind
is disabled by the user
<img width="471" height="457" alt="image"
src="https://github.com/user-attachments/assets/6cdb6106-017d-4954-b74c-5f5d9acd9ed8"
/>
* Add system specs and page object for rewind
This adds the ability to scrub personal information from rejected users
in the review queue when old moderator actions are enabled. After a
reviewable user is rejected, moderators can now use a "Scrub" action to
remove the user's personal data.
The implementation restructures the action building logic in
ReviewableUser to conditionally show different actions based on the
reviewable's status:
- Pending users see approve and delete actions
- Rejected users (not yet scrubbed) see the scrub action
This commit fixes an issue affecting all channels but
more obvious with DM ones. If you had starred a DM channel,
then unfollowed it, then someone messaged you, the channel
would reappear in your channel list in the starred section.
Assuming that unfollowing a channel means you no longer want
to see it, this commit makes unfollowing also unstar the channel.
- Adds help strings
- Scopes order:votes to categories supporting voting
- Adds votes-min and votes-max operators
---------
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
The reviewable timeline now displays specific action text based on the
review outcome instead of a generic "Reviewed by" message. This provides
a clearer context about what action was taken on the reviewable item.
When an author deletes their own post that has pending reviewables
(flags), those reviewables are now automatically transitioned to ignored
with a note indicating "Post was deleted by the author".
If the author later recovers their post, reviewables that were
automatically ignored by the system are restored to pending status with
a note "Post was undeleted by the author". This ensures flags remain
actionable when the original content is restored.
Reviewables manually ignored by moderators are not automatically
restored, preserving human moderation decisions.
Bulk select depends on adding 3em padding to each search result item in
order to shift them over and make room for the select inputs. There were
two places in the AI plugin that fine tune the padding for these items,
but override the padding needed for bulk select.
This PR scopes those changes to only happen when bulk select isn't
active.
<img width="1848" height="780" alt="image"
src="https://github.com/user-attachments/assets/3c58b651-40d3-4262-9029-cba00400fb74"
/>
Internal topic: t/-/169989
## 🔍 Overview
This update removes any dependence on settings or upcoming changes and
makes the starred chat channels feature a default enabled feature.
Previously `lookup_bot_llms` returned all LLM models with
`enabled_chat_bot` set to true, regardless of whether they were actually
assigned to any persona.
This change filters to only return LLMs that are both:
1. Enabled as chat bots (`enabled_chat_bot: true`)
2. Actually assigned as the default LLM to one of the enabled bot
personas
This prevents unused LLMs from appearing in bot-related features when
they aren't configured for any persona.
When restoring an empty backup, 'SiteIconManager.ensure_optimized!' is
triggered during 'reload_site_settings', before 'run_seed_fu' has
created the sketch logo upload (ID -6). This causes
'ActiveRecord::RecordNotFound'.
Use 'find_by' instead of 'find' to gracefully return 'nil' when the
sketch logo doesn't exist yet.
Internal ref - t/8308
## 🔍 Overview
This update fixes an issue where you are unable to filter usage reports
by seeded models. The regex identifying LLM models wasn't taking into
account negative IDs which are used for seeded models. As such, we
update the regex to also consider negative IDs which solves the issue.
## 🔍 Overview
This update fixes the chat sidebar keyboard navigation so it works
correctly for starred channels. It includes a refactor to use a unified
channel list instead of juggling separate public/DM lists. This will
ensure the ordering is correct when keyboard navigating chat channels.
Nameless attachments should be removed too,
now `` will be removed from deleted posts, when
using `Remove Upload Markup From Deleted Posts` automation.
Events edited to earlier dates weren't being found correctly because
the ordering logic for determining the "current" event date was
duplicated and inconsistent between the Event model and EventFinder.
Centralizes the ordering logic in EventDate.current_ordering_sql which
prioritizes pending dates (finished_at IS NULL) first, then orders by
starts_at DESC for pending dates or updated_at DESC for finished dates.
- Added `current_first` scope to EventDate using the shared ordering SQL
- Refactored `current_event_date` in Event to use the scope (with
in-memory fallback when association is loaded to avoid N+1 queries)
- Updated EventFinder to reference the same ordering SQL
- Updated database index to support the new ordering efficiently
Bug report - https://meta.discourse.org/t/date-range-seems-wrong/389891
When users manually typed date markup with dates missing leading zeros
(e.g., `2024-3-9` instead of `2024-03-09`), same-day ranges would show
redundant date information instead of the compact time-only format.
Dates are now normalized in the markdown parser using moment's flexible
parsing. Existing posts with non-padded dates will be fixed upon rebake.
Internal ref - t/170361
* Fixes ordering of reactions so it's in descending order
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/6e4b4590-e751-4f32-aa20-679506219537"
/>
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/6f4d091d-3df7-419c-a7e9-6372e8d40f49"
/>
* Puts avatar notification badges above the avatar shimmer
gif/notification
* Fixes an issue in dark mode where the banner in notifications had an
incorrect hover color
* Fixes an overflow issue with posts containing images on mobile
(removed a max-height)
* Disables animations for people with `prefers-reduced-motion` turned on
* Removes unused gif variant
This is a problematic set of styles because the selector `div.education`
is overly general and can easily bleed onto other elements. After a
thorough review, I've found that these style rules appear to target
elements that are no longer present in the app.
Relates to internal t/-/169618
Previously, GitHub PR oneboxes only showed: draft, open, approved,
merged, or closed. This left a gap when reviewers requested changes.
Additionally, the approval logic was stricter than GitHub's UI - it
required ALL reviewers to approve, so a PR with one approval and one
"changes requested" would show as "open" instead of reflecting the
actual review state.
Changes:
- Add new "changes_requested" status with orange icon (#f79939)
- Refactor review logic to extract each reviewer's latest state
- Prioritize "changes_requested" over "approved" (matches GitHub UI)
- When the same reviewer requests changes then later approves, the
latest review wins