Skip to content

Release v3.10.3 - #1011

Merged
moustachu merged 3 commits into
mainfrom
develop
Jul 24, 2026
Merged

Release v3.10.3#1011
moustachu merged 3 commits into
mainfrom
develop

Conversation

@moustachu

Copy link
Copy Markdown
Member

This pull request introduces improvements to proposal ordering logic, adds Slovak locale translations, and refines the way controller extensions are included in the codebase. The main focus is on enhancing the ordering of proposals and making the code more maintainable and extensible.

Proposal ordering improvements:

  • Introduced a new extension module ProposalsControllerReorderTiebreaker in proposals_controller_reorder_extends.rb to ensure proposals with the same ordering are consistently sorted by descending id as a tiebreaker. This module is prepended to the controller for higher priority. [1] [2]
  • Changed the SQL ordering logic in proposals_controller_extends.rb from using position(... in ...) to array_position, which is more efficient and compatible with PostgreSQL for ordering proposals by a specific list of IDs.
  • Updated the RSpec test in proposals_controller_spec.rb to match the new ordering logic using array_position.

Codebase maintainability:

  • Changed the way controller extensions are applied: switched from include to prepend for ProposalsControllerExtends, ensuring that custom logic takes precedence over the original methods.

Localization:

  • Added Slovak (sk) translations for assemblies and date/time formats in sk.yml, improving internationalization support.

AyakorK and others added 3 commits July 24, 2026 10:29
* fix: Fix proposal order when ids are multi-matching (133 -> 1133)

* fix: Test failing

---------

Co-authored-by: moustachu <moustachu@opensourcepolitics.eu>

Copilot AI left a comment

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.

Pull request overview

This PR refines proposals ordering in the proposals index by switching to a PostgreSQL array_position-based ordering and adding a deterministic tiebreaker for equal ordering values, while also adding Slovak locale strings and adjusting controller extension loading/precedence.

Changes:

  • Replace position(... in ...) ordering with array_position(ARRAY[...] ...) to keep proposals ordered by a specific ID list.
  • Add a reorder tiebreaker (id DESC) via a prepended controller module for stable ordering.
  • Add Slovak (sk) locale entries for assemblies and date/time UI strings.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/controllers/proposals_controller_spec.rb Updates controller spec expectation to match new array_position SQL ordering.
lib/extends/controllers/decidim/proposals/proposals_controller_reorder_extends.rb Adds a prepended reorder override to append id DESC as a deterministic tiebreaker.
lib/extends/controllers/decidim/proposals/proposals_controller_extends.rb Switches ordering SQL to array_position and changes extension application from include to prepend.
config/locales/sk.yml Introduces Slovak locale keys for assemblies and date/time-related UI text.
config/application.rb Requires the new proposals reorder extension during after_initialize.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spec/controllers/proposals_controller_spec.rb
@moustachu
moustachu merged commit 29900a1 into main Jul 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants