1
0
mirror of synced 2026-08-05 17:56:58 +00:00
Commit Graph

618 Commits

Author SHA1 Message Date
Sérgio Saquetim 5b1d57d392 UX: Add spacing adjustment in solutions.scss
- Add a newline for better code readability and spacing consistency within the `solutions.scss` file.
- No functional changes made.
2025-07-22 00:44:41 -03:00
Sérgio Saquetim 75b4eef73a UX: Improve appearance and handling of accepted answers without excerpts
- Hide blockquote for accepted answers without excerpts to avoid unnecessary visual elements.
- Adjust title padding for better alignment when excerpts are absent.
- Ensure no content fallback (`""`) when excerpts are not provided.
- Add `accepted-answer--has-excerpt` class for proper styling differentiation.
2025-07-22 00:29:34 -03:00
Sérgio Saquetim fe6934e1b0 DEV: Update compatibility for discourse-solved plugin to < 3.5.0.beta8-dev
Updated `.discourse-compatibility` to reflect compatibility with core version `< 3.5.0.beta8-dev`.
2025-07-21 23:30:55 -03:00
Sérgio Saquetim 23515467bd Merge branch 'main' into dev/post-quoted-content-component 2025-07-21 23:25:41 -03:00
Jarek Radosz e7b882d0d3 DEV: Re-add about.json (#385) 2025-07-21 17:20:10 +01:00
Jarek Radosz fca9d22750 DEV: Remove bundled plugins from about.json (#384) 2025-07-15 16:15:15 +01:00
Jarek Radosz 4f490c6d61 Revert "DEV: Deprecate the plugin (#382)" (#383)
This reverts commit 0ab400221d.
2025-07-15 10:25:35 +01:00
Jarek Radosz 0ab400221d DEV: Deprecate the plugin (#382) 2025-07-14 15:09:53 +01:00
Kris 0f03ec45c8 A11Y: improve expand/collapse labeling on embedded solution post (#381) 2025-07-10 16:21:49 -04:00
Kris e4b4a97d9e DEV: re-enable and update empty state tests (#380) 2025-07-09 13:58:35 -04:00
Kris 1d038963fd TEMP: skip tests due to core change (#379) 2025-07-09 10:24:06 -04:00
Natalie Tay f96aceb5f4 FIX: Use SolvedTopics to list posts in /activity/solved instead of user actions (#376)
In https://github.com/discourse/discourse-solved/pull/342 we moved solutions away from topic_custom_fields into proper tables, with the tables as the proper source of truth to a topic's solution.

The user's /my/activity/solved route uses user_actions which is not accurate, and a user has reported a bug where their solution is not reflected there (user actions are not a good representation of what a topic's solution is). 

This commit introduces 
- a new route to get solutions, and is mindful `hide_user_profiles_from_public` and such settings
- also mindful of PMs and private categories
- a new template that makes use of the `<UserStream>` to load posts safely and avoid reimplementation
2025-07-02 16:56:12 +08:00
Natalie Tay 041b58eed1 FIX: Exclude the first post itself when checking if an existing solution from the user exists (#378)
This commit makes sure to exclude the first solution when checking for an existing solution and has better tests -- the existing test does not accept the post prior to making the check.
2025-07-02 11:45:14 +08:00
Natalie Tay 0350b46bda FIX: Check if user has existing solution despite trust_level=any for first accepted solution validator used in automation (#377)
There exists a bug in the following trigger (see screenshot) where if the user has an existing solution already, they will still pass validation for "first accepted solution" due to the trust level being "any".
2025-06-30 15:40:16 +08:00
Sérgio Saquetim 47d24da9a7 DEV: Update has_accepted_answer property to track solution state 2025-06-24 16:23:18 -03:00
Sérgio Saquetim 0365e44a33 FIx failing tests 2025-06-24 16:21:40 -03:00
Discourse Translator Bot cee0ffc199 Update translations (#375) 2025-06-24 16:29:51 +02:00
Sérgio Saquetim 25920252f3 Fix linting issues 2025-06-24 01:31:09 -03:00
Sérgio Saquetim ea194b1f4f DEV: Update tests to use topic_with_op fabrication for topic consistency
This ensures tests work with topics that include an original post by default, improving test reliability and coverage. Adjustments were made to guardian_extensions_spec and solved_spec to reflect this.
2025-06-24 01:28:59 -03:00
Sérgio Saquetim 5aed0b41c5 FEATURE: Real-time updates for accepted and unaccepted solutions
Introduce real-time message bus updates for accepted and unaccepted solutions, ensuring live synchronization across users.

Key changes:
- Publish solution acceptance/unacceptance updates via MessageBus.
- Refactor `accepted_answer_post_info` and related logic for cleaner handling of accepted answer data.
- Update both backend and frontend to support reactive updates when solutions are toggled.
- Add loading states for Accept/Unaccept buttons to enhance UX during async operations.
2025-06-24 01:08:02 -03:00
dependabot[bot] adba4d9d6e Bump rack from 3.1.12 to 3.1.16 (#371)
Bumps [rack](https://github.com/rack/rack) from 3.1.12 to 3.1.16.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/v3.1.12...v3.1.16)

---
updated-dependencies:
- dependency-name: rack
  dependency-version: 3.1.16
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-21 18:00:04 +02:00
Sérgio Saquetim 436ee57801 DEV: Refactor spec to improve readability of accepted answer tests
Refactored `solved_spec.rb` to make `accepted answer` assertions more explicit and structured. Consolidated selector handling and clarified expectation of the expanded quote behavior.
2025-06-20 19:07:55 -03:00
Sérgio Saquetim f03f64a33c DEV: Refactor topic model to use tracked properties for accepted answer logic
Refactored the `topic` model to replace legacy Ember property access (`get/set`) with modern tracked properties. Updated related logic in `add-topic-list-class` and `solved-unaccept-answer-button` to align with these changes.
2025-06-20 19:07:35 -03:00
Sérgio Saquetim 855745b4f8 DEV: Use the PostQuotedContent component to render the accepted answer
Refactored the `solved-accepted-answer` component to utilize the `PostQuotedContent` component, simplifying the structure and removing redundant code. Updated system tests to verify behavior of expandable accepted answer quotes. Added new compatibility entry for version `< 3.5.0.beta7-dev` and included TODO comments regarding event handling for Glimmer Post Stream.
2025-06-20 18:45:07 -03:00
Discourse Translator Bot 03804e1065 Update translations (#373) 2025-06-17 23:08:17 +02:00
Natalie Tay 4d20d83374 FIX: User directory for solutions should update when value changes from positive value to zero (#372)
# bug
If John created a post which is a solution in March, the user directory would show that John solution = 1.
In April, if John has not solved a topic, he would still have solution = 1 in the user directory.

# fix
reset solutions to 0 before updating
2025-06-11 10:46:36 +08:00
Jarek Radosz 94f0c5a315 DEV: Update linting config and run gjs-codemod (#370) 2025-06-05 11:40:00 +01:00
zhanfengzeng a7bc394bdc FEATURE: apply plugin modifier for answers controller rate limiting (#369) 2025-05-22 11:07:07 -05:00
David Taylor ba3d4276ee DEV: Fix linting violations (#367) 2025-05-16 13:24:01 +01:00
Sérgio Saquetim 8e72136f54 DEV: Add compatibility with the Glimmer Post Stream (#363) 2025-05-05 15:12:39 -03:00
David Taylor ae01ad30c3 DEV: Remove legacy topic-list code (#362) 2025-04-14 14:38:48 +01:00
Loïc Guitaut 4f0234f5be DEV: Add system spec to check core features are working fine (#357) 2025-04-09 14:27:30 +02:00
Natalie Tay 539938ba59 FIX: Solutions directory item was using post creation instead of solved creation (#361)
Earlier on in the migration, the update of the user directory query was erroneously switched to use post creation date instead of the date the post was solved.

This commit fixes that.
2025-04-09 14:14:38 +08:00
Natalie Tay 6e12858bde FIX: Accepting another answer does not commit (#360)
When an answer already exists, clicking " Solution" on another post works, but does not commit.

This commit fixes that and also adds a test, and a transaction around accepting a solution (deleting the topic timer, previous user action, etc).
2025-04-07 11:42:36 +08:00
Natalie Tay 24d819a7d6 FIX: 500 due to absent module (#359)
The class got refactored and slapped with a module, but the usage did not follow through.
2025-04-04 17:24:25 +08:00
Natalie Tay 37003f91ef FIX: Exclude deleted topics and posts as solution in user summary (#358)
Follow up to #352

The user summary solutions count is more than it should be because of deleted topics and posts.
2025-04-04 16:43:00 +08:00
Discourse Translator Bot e2a09417a2 Update translations (#355) 2025-04-03 00:05:10 +02:00
Sérgio Saquetim b128e65ae5 DEV: Remove the legacy widget post menu code (#351) 2025-04-02 22:31:40 +01:00
David Taylor 390141297f DEV: Drop widget post-menu test (#356)
In preparation for https://github.com/discourse/discourse/pull/31211
2025-04-01 15:23:34 +01:00
David Taylor aede1c30cf DEV: Update selector in test (#354)
Preparation for https://github.com/discourse/discourse/pull/32082

Followup to fc2d1a290c
2025-03-31 20:58:59 +01:00
David Taylor fc2d1a290c DEV: Add class to solve topic-status (#353)
Preparing for https://github.com/discourse/discourse/pull/32082, which switches core to use the modern TopicStatus component everywhere
2025-03-31 16:25:12 +01:00
Natalie Tay be5798f6d8 FIX: Standardise the definition of what a solution is (#352)
There are three locations where a user's solution query is defined
- user summary
- user card
- user directory

This PR updates the queries to use data from the new `SolvedTopics` table instead of the `UserActions` table. And adds testssssss
2025-03-28 09:49:02 +08:00
Natalie Tay 9e9ac2862c FIX: Some solved topics have no answers (#350)
As part of https://github.com/discourse/discourse-solved/pull/342, some discrepancies in the old implementation resulted in solved topics linking to posts that do not exist (dangling custom field value). Causing us to see the following when there are no `answer_post`

```
NoMethodError (undefined method `user' for nil)
```

This PR prevents the error.
2025-03-27 01:15:15 +08:00
chapoi ad2555f1e0 UX: fix misalignment for non-admin and anon + move to variable use (#349) 2025-03-26 16:49:47 +01:00
Natalie Tay 1805184cde FIX: Multiple topics may have the same post as its solution (#348)
We are seeing some errors when migrating and adding indexes on `answer_post_id`.

```
#<StandardError:"An error has occurred, all later migrations canceled:\n\nPG::UniqueViolation: ERROR:  could not create unique index \"index_discourse_solved_solved_topics_on_answer_post_id\"\nDETAIL:  Key (answer_post_id)=(13006) is duplicated.\n">
```

This PR modifies the earlier migration, and also adds one before the addition of indexes to remove duplicates.
2025-03-26 22:21:32 +08:00
Natalie Tay a8a3554cec FEATURE: Add setting to show who marked as solved (#347)
This commit adds the site setting `SiteSetting.show_who_marked_solved` and also the following tooltip to answer posts.
2025-03-26 11:43:22 +08:00
Natalie Tay 6b07af89da UX: Better alignment and gaps for marked solved by (#346) 2025-03-26 02:21:36 +08:00
Discourse Translator Bot d88ea600b9 Update translations (#345) 2025-03-25 17:23:18 +01:00
Natalie Tay 5a0c875885 FEATURE: Show 'marked solved by' in OP when topic is solved (#343)
Depends on: https://github.com/discourse/discourse-solved/pull/342

This feature adds the "Marked solved as" information to the solved post appended to OP.

Originally, I had moved the widget usage to a [component](https://github.com/discourse/discourse-solved/blob/39baa0be4a889fdbff108e887a677d9a298d27d4/assets/javascripts/discourse/components/solved-post.gjs), but due to "cooking quotes", after some internal discussion (t/95318/25) we will stick to widgets for now as the post-stream gets modernized.
2025-03-25 17:14:02 +08:00
Natalie Tay e0a579e69e FIX: Migration was only done for first batch (#344)
https://github.com/discourse/discourse-solved/pull/342 was deployed and observed to only have 5000 (batch size) migrated. This is an error in migration where the ids had a gap between the batch.

This PR changes the migration to just loop through all topic custom fields with each loop increasing by batch size.
2025-03-25 17:06:22 +08:00