Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
707ace0
fix: replace meaningless span by p tag in statistic cell
Stef-Rousset Dec 8, 2025
5abf88e
fix replace meaningless span by p tag in participatory_space_metadata…
Stef-Rousset Dec 8, 2025
3c902de
fix: replace span by p tag in comment's alignment_badge cell
Stef-Rousset Dec 8, 2025
5bf76cb
fix: add a p tag for reference in participatory process show
Stef-Rousset Dec 8, 2025
4cb1952
fix: replace span by p tag in upload_field js
Stef-Rousset Dec 8, 2025
6c681fc
fix: replace span by p tag, and label by p in upload modal
Stef-Rousset Dec 8, 2025
b2d0ebe
New Crowdin updates (#15681)
decidim-bot Dec 9, 2025
f08bf40
Error handling of not found resources for GraphQL API (#15721)
alecslupu Dec 10, 2025
a0841c2
Fix NuValidator image (#15773)
alecslupu Dec 11, 2025
f72c523
Change Vote button to Edit vote when user has already voted (#15761)
antopalidi Dec 11, 2025
4ef4a70
Add total votes count to election results in admin and public views (…
antopalidi Dec 11, 2025
15dbb71
Allow editing last question on receipt page for per-question election…
antopalidi Dec 11, 2025
00b96d3
Prevent server error on proposal page when the user is not logged in …
fblupi Dec 12, 2025
e55f4c4
Use `GraphQL::ExecutionError` to handle API permissions (#15682)
alecslupu Dec 12, 2025
085ede4
Refactor QueryExtensions to move the implementation to API (#15768)
alecslupu Dec 12, 2025
cb5212d
Extract breadcrumb related specs to their own tests (#15737)
alecslupu Dec 13, 2025
1a80b16
Rename private participants to members (#15749)
andreslucena Dec 14, 2025
370ebe4
Add short_name field to Organizations for PWA (#15729)
andreslucena Dec 15, 2025
24e19c2
Add AWS Bucket configuration for public assets (#15777)
alecslupu Dec 15, 2025
0623de4
Extract documentation from /api to docs.decidim.org (#15804)
andreslucena Dec 15, 2025
c4aa90c
Fix search result comment with link (#15774)
Ginger-Leo Dec 15, 2025
4c1c6a0
Improve handling of `PermissionNotSetError` exceptions in GraphQL API…
alecslupu Dec 16, 2025
5fb38f0
Show responses menu entry in Surveys' admin (#15785)
greenwoodt Dec 16, 2025
94b7039
Fix process and assembly admin members action logs (#15788)
alecslupu Dec 17, 2025
9b079c2
Sorting via created_at attribute within spaces (#15810)
greenwoodt Dec 17, 2025
ec1d8ed
Merge branch 'develop' of github.com:decidim/decidim into fix/semanti…
alecslupu Dec 17, 2025
243d573
Fix focus trap in modal dialog for sharing (#15807)
Ginger-Leo Dec 17, 2025
b16ed4e
Add errors pages and more examples to API (#15814)
alecslupu Dec 18, 2025
40c07d9
fix: add p tag for reference in assembly show
Stef-Rousset Dec 18, 2025
2fbd1f8
style: update style to be applied on p instead of span
Stef-Rousset Dec 18, 2025
b72051b
Move FormFactory to be accessible from API (#15819)
alecslupu Dec 19, 2025
c4faf2a
Add additional API exceptions (#15789)
alecslupu Dec 19, 2025
8361425
Update docs for GitHub Actions configuration (#15824)
andreslucena Dec 19, 2025
e2e272b
Enable EnforcedShorthandSyntax: always on rubocop configuration (#15822)
andreslucena Dec 19, 2025
6b4549b
Write API: vote/unvote proposals (#15791)
alecslupu Dec 19, 2025
0f9074e
Fix details in ProposalAnswerType spec file (#15826)
andreslucena Dec 19, 2025
a9ed074
Write API: withdraw meetings (#15799)
alecslupu Dec 19, 2025
fb7f856
Add checkbox for showing Members page in Processees/Assemblies (#15808)
andreslucena Dec 19, 2025
134fadb
Write API: withdraw proposals (#15793)
alecslupu Dec 19, 2025
19d5028
New Crowdin updates (#15782)
decidim-bot Dec 20, 2025
027bb45
Refactor attachments tab in budgets' projects and initiatives (#15831)
andreslucena Dec 20, 2025
9c82ca2
Fix notification from Component publication (#15830)
andreslucena Dec 20, 2025
fa1611b
Do not show "more information" modal when there isn't any (#15821)
greenwoodt Dec 20, 2025
5b78ec5
Fix factories location pages module (#15832)
alecslupu Dec 22, 2025
d83c862
Fix breadcrumb in conferences' program (#15833)
andreslucena Dec 22, 2025
1b46fd6
Remove identity_selector_dialog.js file (#15842)
andreslucena Dec 22, 2025
b08bdc8
Fix proposal import with other proposals states in budgets (#15630)
greenwoodt Dec 24, 2025
8e6e76a
Fix HashSyntax rubocop offence in `project_import_proposals_form.rb` …
alecslupu Jan 7, 2026
52f4352
Fix auto-redirect when question voting closes (#15760)
antopalidi Jan 7, 2026
4d9ab0a
Fix accountability results filtering (#15564)
alexrlpz Jan 7, 2026
535ed01
Write API: close debates (#15800)
alecslupu Jan 8, 2026
ca74db9
Fix promoting committee members page in Initiatives' admin (#15844)
andreslucena Jan 8, 2026
5653812
Write API: create meetings (#15796)
alecslupu Jan 9, 2026
e0ccf7c
Write API: create proposals (#15790)
alecslupu Jan 9, 2026
d08f474
Fix error when there are too many aliases in GraphQL API (#15867)
alecslupu Jan 9, 2026
ed13c7c
Rename createMeetings to createMeeting in GraphQL API mutation (#15874)
andreslucena Jan 9, 2026
3aac27f
Show promoted space image in the menu (#15860)
alecslupu Jan 9, 2026
b78b5dd
Remove unecessary inclusions of admin assets on initiatives frontend …
andreslucena Jan 9, 2026
bf81bab
Bump tailwindcss from v3.4.1 to v3.4.19 (#15873)
greenwoodt Jan 9, 2026
3be49f7
Disable introspection for regular users (#15865)
alecslupu Jan 9, 2026
ded12f8
Write API: close meetings (#15798)
alecslupu Jan 9, 2026
9b1dc8a
Avoid GraphQL circular query (recursion limit) (#15866)
alecslupu Jan 12, 2026
c7effe1
Replace image processing with imagemagick to libvips (#15670)
greenwoodt Jan 12, 2026
d1157b4
Write API: create debates (#15801)
alecslupu Jan 14, 2026
781fa42
Rename set_component_breadcrumb_item to set_breadcrumb_items (#15859)
alecslupu Jan 14, 2026
37ffce3
Write API: update meetings (#15797)
alecslupu Jan 14, 2026
b963709
Remove gitpod configuration (#15888)
andreslucena Jan 14, 2026
f6cde10
Add DPG Alliance badge (#15889)
andreslucena Jan 14, 2026
5fcebb8
Add documentation for the new exceptions (#15868)
alecslupu Jan 14, 2026
acf878e
Write API: update proposals (#15795)
alecslupu Jan 15, 2026
71ea61d
Make results searcheable (#15881)
alecslupu Jan 15, 2026
f6ad7a8
Add component hooks documentation (#15883)
alecslupu Jan 15, 2026
235d404
Fix accountability pipeline (#15896)
alecslupu Jan 16, 2026
fe6d9f4
Remove unused component hook - before_destroy (#15882)
alecslupu Jan 19, 2026
1777154
Align ProposalAnswerType mutation with latest changes (#15827)
alecslupu Jan 19, 2026
3cb646b
Fix inconsistent tab behavior in the elements of the breadcrumb when …
alecslupu Jan 19, 2026
3965dd2
Fix devcontainer configuration (#15887)
andreslucena Jan 19, 2026
7bbb2bb
Fix search bar icon gets overwritten when search phrase is too long (…
alecslupu Jan 19, 2026
cfff6af
Write API: update debates (#15802)
alecslupu Jan 19, 2026
2a8e91b
Fix validation error in user name regular expression (#15919)
andreslucena Jan 21, 2026
8a1d812
Bump qltysh/qlty-action to v2 (#15913)
dependabot[bot] Jan 21, 2026
b04406b
Add comprehensive AI coding agent instructions for Decidim developmen…
Copilot Jan 21, 2026
304038b
Show the breadcrumb in medium resolutions (700px) (#15863)
alecslupu Jan 21, 2026
ea32040
Fix accountability pipeline (#15922)
alecslupu Jan 21, 2026
893683a
Bump actions/labeler to v6 (#15911)
dependabot[bot] Jan 21, 2026
b5a94b3
Make the numbers in seeds non-harcoded and respect SLOW_SEEDS (#15926)
andreslucena Jan 21, 2026
4c1a2b6
Bump github/codeql-action to v4 (#15909)
dependabot[bot] Jan 22, 2026
510d681
Fix quality indicator content block (#15897)
greenwoodt Jan 23, 2026
b4f0f06
Fix username handling exceptions (#15928)
alecslupu Jan 26, 2026
c086ac3
Add devcontainer CLI wrapper script (#15916)
andreslucena Jan 27, 2026
2ca7edf
Refactor API based comments (#15794)
alecslupu Jan 27, 2026
bd5ab26
Set fixed image for language selector on mobile (#15864)
alecslupu Jan 27, 2026
0b7759e
Fix survey matrix responses export in forms (#15920)
greenwoodt Jan 28, 2026
59255b0
Bump actions/cache to v5 (#15912)
dependabot[bot] Jan 28, 2026
1323275
Clean-up the old partial/cells on navigation menu (#15862)
alecslupu Jan 28, 2026
d540b8a
New Crowdin updates (#15839)
decidim-bot Jan 28, 2026
8654b74
Remove sticky header (#15886)
alecslupu Jan 29, 2026
43d5eb3
Fix disabled 'true' continue button in initiatives creation/edit (#15…
andreslucena Jan 30, 2026
48dfdfb
Fix correct icon & name assignment for elections (#15969)
greenwoodt Jan 30, 2026
03141d6
Fix collaborative texts name & icon in search (#15974)
greenwoodt Jan 30, 2026
0d88d13
Remove legacy field banner image from initiative type (#15953)
andreslucena Jan 30, 2026
b0778c9
Make the document a required field in spaces import (#15980)
andreslucena Feb 3, 2026
ce4def3
Fix image removal bug in the hero block (#15899)
rsdeus Feb 3, 2026
7ac8cb3
Fix markup and UX between the spaces imports (#15984)
andreslucena Feb 4, 2026
521c686
Bump tiptap from v2.1.13 to v3.13.0 (#15823)
greenwoodt Feb 4, 2026
7d14b69
Fix caching issue in processes content block (#15988)
andreslucena Feb 4, 2026
a5e2510
Fix for explanation what means a draft and pending initiative (#15955)
andreslucena Feb 4, 2026
9b610e7
Fix proposal to proposal component import (#15890)
greenwoodt Feb 4, 2026
aac096f
Enhance security documentation with templates and procedures (#15962)
andreslucena Feb 5, 2026
cb66d94
Fix notifications flaky specs (#16002)
alecslupu Feb 5, 2026
83bb852
Allow Attachment to answer to `can_participate?` based on it's attach…
davidbeig Feb 5, 2026
4e78dfd
Show errors outside of the upload modal (#15981)
andreslucena Feb 6, 2026
6aeaffc
Fix can_participate? into ParticipatoryProcessStep (#16008)
alecslupu Feb 6, 2026
201b9e0
Merge branch 'fix/semantic_html' of github.com:OpenSourcePolitics/dec…
alecslupu Feb 6, 2026
9fb172a
Merge branch 'develop' of github.com:decidim/decidim into fix/semanti…
alecslupu Feb 6, 2026
332f474
Fix allow admins deleting attachments with links (#15994)
entantoencuanto Feb 6, 2026
9af7da0
Finishing touches with regard to header improvements (#15683)
alecslupu Feb 6, 2026
3878d80
Attachment not persisting on error. (#15938)
Ginger-Leo Feb 6, 2026
76e22c6
Merge branch 'develop' of github.com:decidim/decidim into fix/semanti…
alecslupu Feb 6, 2026
3d6ee6c
Apply CodeRabbit suggestion
alecslupu Feb 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 47 additions & 0 deletions .ai/app-directories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# App directories

As decidim is a gem for Ruby on Rails you may find the usual rails directories: controllers, models, etc. but we also have other kind of directories.

## Standard Rails

| Directory | Description | Technology |
|--------------|----------------------------------|------------------------|
| controllers/ | HTTP request handlers | Rails ActionController |
| models/ | ActiveRecord models and entities | Rails ActiveRecord |
| views/ | ERB templates for rendering | Rails ERB |
| helpers/ | View helper methods | Rails ActionView |
| mailers/ | Email sending classes | Rails ActionMailer |
| jobs/ | Background job classes | Rails ActiveJob |

## Beyond Standard Rails

| Directory | Description | Technology |
|--------------|-------------------------------------------------------------|-------------------------------------------------------------------|
| commands/ | Business logic encapsulating use cases (Command Pattern) | Custom Decidim base class (inspired by Rectify gem). |
| forms/ | Form objects for data validation and transformation | Custom Form base class with Decidim::Attributes |
| cells/ | Reusable view components | Trailblazer::Cells gem |
| events/ | Activity logging, notifications, event triggering | Custom Event classes (SimpleEvent, NotificationEvent, EmailEvent) |
| permissions/ | Authorization and permission checking logic | Custom Decidim permission system |
| queries/ | Database query objects for complex queries | Custom Query base class |
| presenters/ | Decorator classes for view-specific formatting | SimpleDelegator-based |
| services/ | Stateless utility and business service classes | Plain Ruby classes |
| validators/ | Custom validation classes | Rails Custom Validators |
| serializers/ | JSON/XML serialization for API responses | Custom serializers |
| uploaders/ | File upload handling | Custom validations for ActiveStorage |
| constraints/ | Rails routing constraints | Custom constraint classes |
| resolvers/ | GraphQL data resolution | Custom resolver classes |
| scrubbers/ | HTML content sanitization | Rails::HTML::Scrubber |
| packs/ | JavaScript/CSS entry points and assets | Shakapacker |
| assets/ | Static assets (some modules) | Asset pipeline |

## Key Architectural Patterns

**IMPORTANT: You must follow the existing patterns.**

1. **Command Pattern**: Commands in `app/commands/` encapsulate single use cases and broadcast events
2. **Form Objects**: Forms in `app/forms/` handle validation separately from models
3. **Cells**: Component-based views using `Trailblazer::Cells` for reusable UI
4. **Query Objects**: Complex database queries isolated in `app/queries/`
5. **Events**: Events trigger notifications, logs, and side effects
6. **Permission System**: Scope-based authorization with action/subject model
7. **Content Block System**: Customizable page sections via manifests
113 changes: 113 additions & 0 deletions .ai/build-pipeline-integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Build Pipeline Integration

**CI Requirements:** The `.github/workflows/` contain the production CI setup:

- Tests run on Ubuntu
- Requires PostgreSQL and Redis services
- Uses specific Ruby and Node versions
- Runs parallel tests across multiple modules
- **Each module CI can timeout at 30-60 minutes - NEVER CANCEL**

## Pre-Commit Checklist

Before committing, ALWAYS run:

```bash
npm run lint
bundle exec rubocop
bundle exec erblint --lint-all
bundle exec i18n-tasks normalize --locales en
bundle exec rspec
npm run test
```

## Troubleshooting

### JavaScript Lint Failures

```bash
# View errors
npm run lint

# Auto-fix what can be fixed
npm run lint -- --fix
```

### Ruby Lint Failures (RuboCop)

```bash
# View errors with details
bundle exec rubocop

# Auto-fix safe corrections
bundle exec rubocop -a

# Auto-fix including unsafe corrections (review changes afterward)
bundle exec rubocop -A
```

### ERB Lint Failures

```bash
# View errors
bundle exec erblint --lint-all

# Auto-fix
bundle exec erblint --lint-all --autocorrect
```

### CSS/SCSS Formatting Issues

```bash
# Check issues
npm run stylelint
npm run prettier

# Auto-fix
npm run prettify
```

### Translation Key Issues

```bash
# Normalize and sort keys (only English)
bundle exec i18n-tasks normalize --locales en

# Find missing keys
bundle exec i18n-tasks missing

# Find unused keys
bundle exec i18n-tasks unused
```

### Test Failures

**IMPORTANT:** When a test fails, always ask the user whether you should fix the test or fix the code that the test is validating. Do not assume which approach is correct.

1. **Read the error message carefully** - RSpec provides detailed failure information

2. **Run the specific failing test** to iterate faster:

```bash
cd decidim-<module>
bundle exec rspec spec/path/to/failing_spec.rb:LINE_NUMBER
```

- You can pass multiple line numbers: file.rb:12:34
- For failures in shared contexts/examples, always run the concrete example using its file:line from the failure output.
- Alternatively, run by example description:

```bash
bundle exec rspec spec/path/to/failing_spec.rb -e "example description"
```

1. **Check for flaky tests** - If a test passes when run individually but fails in the suite, it may be a test isolation issue

2. **Reset the test database** if you suspect data issues:

```bash
cd spec/decidim_dummy_app
bin/rails db:reset RAILS_ENV=test
```

1. **Check for missing dependencies** - Run `bundle install` and `npm install` if tests fail with load errors
206 changes: 206 additions & 0 deletions .ai/development-workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# Development Workflow

## Creating a Development App

As decidim is a gem, we need to create a rails application to test it. That's why we have the `development_app`. When you generate it, you create a rails application with the decidim gem using the local files. You only need to generate it once. So if the directory already exists you don't need to generate it again unless a reset is required.

You should not change anything inside this development app as it's a local directory that won't be persisted.

```bash
# Install dependencies first (if not already done)
bundle install
npm install

# Create development app for active development
bundle exec rake development_app
cd development_app
bin/dev # Starts Rails server with webpack dev server
```

## Key Development Files and Locations

**Gem Structure:** Each `decidim-*` directory is a separate gem:

- `decidim-core/` - Main framework and shared components
- `decidim-admin/` - Administrative interface
- `decidim-proposals/` - Proposal management component
- `decidim-participatory_processes/` - Process management
- `decidim-assemblies/` - Assembly management
- `decidim-meetings/` - Meeting management
- `decidim-surveys/` - Survey component
- And many more...

**Important Files:**

- `Rakefile` - Main build tasks and gem management
- `Gemfile` - Root dependency specification
- `package.json` - JavaScript dependencies and scripts
- `.github/workflows/` - CI/CD pipeline definitions
- `docs/` - Comprehensive documentation in AsciiDoc format

**JavaScript Assets:** Located in each gem's `app/packs/` directory
**Stylesheets:** Located in each gem's `app/packs/stylesheets/` directory

## Common Development Tasks

Running the development server:

```bash
cd development_app
bin/dev # Starts Rails + webpack dev server
# Access at http://localhost:3000
# Admin panel: http://localhost:3000/admin (after creating admin user)
```

Database operations:

```bash
cd development_app
bin/rails db:drop # Drop database
bin/rails db:create # Create database
bin/rails db:migrate # Run migrations
bin/rails db:seed # Load sample data
bin/rails db:reset # Reset and reseed database
```

Asset compilation:

```bash
cd development_app
bin/rails assets:precompile
```

## Database Migrations

When creating new features that require database changes, migrations belong in the appropriate `decidim-*` module, not in the development app.

### Creating a Migration

```bash
cd decidim-<module>
bin/rails generate migration AddFieldToTableName field_name:type
```

### Migration File Location

Migrations are stored in each gem's `db/migrate/` directory:

```text
decidim-<module>/
└── db/
└── migrate/
└── YYYYMMDDHHMMSS_migration_name.rb
```

### Applying Migrations

After creating a migration, regenerate the development or test app to apply it:

```bash
# For development
bundle exec rake development_app

# For testing
bundle exec rake test_app
```

Or apply migrations directly in an existing app:

```bash
cd development_app # or spec/decidim_dummy_app
bin/rails decidim:upgrade
bin/rails db:migrate
```

### Migration Best Practices

- Use reversible migrations when possible
- Add indexes for foreign keys and frequently queried columns
- Use `change_column_null` with a default value for non-nullable columns
- Test migrations in both directions: `bin/rails db:migrate` and `bin/rails db:rollback`

## Data Migrations (data-migrate)

Decidim uses the `data-migrate` gem for data changes that should not live in schema migrations (e.g. backfilling data, transforming existing records, one-off fixes).

Use data migrations when:

- Modifying existing data
- Backfilling new columns
- Migrating values between columns or tables
- Fixing production data inconsistencies

Do **not** use schema migrations for these cases.

### Creating a Data Migration

From the appropriate decidim-* module:

```bash
cd decidim-<module> bin/rails generate data_migration BackfillSomething
```

This creates a file under:

```text
decidim-<module>/
└── db/
└── data/
└── YYYYMMDDHHMMSS_backfill_something.rb
```

### Running Data Migrations

In a development or test app:

```bash
bin/rails data:migrate
```

To check status:

```bash
bin/rails data:migrate:status
```

### Data Migration Best Practices

- Never reference application models directly.
- Define a minimal ActiveRecord::Base class inside the migration.
- Always pin the table name to avoid breakage if models change:

```ruby
class LegacyProposal < ActiveRecord::Base
self.table_name = "decidim_proposals_proposals"
end
```

- Avoid callbacks, validations, and scopes.
- Make migrations idempotent (safe to re-run).
- Prefer find_each for large datasets.
- Keep data migrations small and focused.

### Example Pattern

```ruby
class BackfillPublishedAt < ActiveRecord::Migration[6.1]
class Proposal < ActiveRecord::Base
self.table_name = "decidim_proposals_proposals"
end

def up
Proposal.where(published_at: nil).find_each do |proposal|
proposal.update_column(:published_at, proposal.created_at)
end
end

def down
# no-op (data migrations are usually irreversible)
end
end
```

### When in Doubt

- Schema change? → regular migration
- Data change? → data-migrate
Loading
Loading