Skip to content

Collapse the pre-submission rules on contribution type pages - #989

Merged
JoaquinBN merged 2 commits into
devfrom
JoaquinBN/mission-separate-submission-limits
Aug 14, 2026
Merged

Collapse the pre-submission rules on contribution type pages#989
JoaquinBN merged 2 commits into
devfrom
JoaquinBN/mission-separate-submission-limits

Conversation

@JoaquinBN

@JoaquinBN JoaquinBN commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

What

The pre-flight submission guidance card (ContributionGuidelines) is now a <details> disclosure in every variant, not just on mobile.

  • Contribution type detail page (/contribution-type/:id): starts collapsed to a single header row with a chevron. The rules no longer push the type's missions and statistics down the page.
  • Submit form sticky rail (xl and up): still open by default, since there the rules are guidance for a form the user is actively filling in.
  • Submit form mobile slot: unchanged, already collapsed.

Note on mission submission limits

The other half of this workspace's brief — separating a mission's per-user submission counter from its contribution type's — was already delivered by #986 and is on dev. Mission.has_independent_limits (default off) is the per-mission toggle: off means mission submissions consume the type's slots, on means the mission is budgeted separately. No further work was needed here.

One deliberate limitation worth knowing: an independently-budgeted mission cannot be unlimited. The mission_independent_limits_need_a_cap check constraint requires at least one mission-level cap, since a mission that skipped its type's ceiling with no cap of its own would accept infinite submissions. Use a high max_submissions for an effectively-unlimited mission.

Testing

  • ContributionGuidelines.test.js: 13/13, including two new cases pinning collapsed-on-detail and open-on-create-form.
  • SubmitContribution* suites: 18/18.
  • Full frontend suite: 399 pass / 22 fail. The 22 failures are pre-existing on dev (Profile, api, routes, AuthButton) and none render this component.

Summary by CodeRabbit

  • New Features

    • Contribution guidelines on contribution-type pages now start collapsed, keeping key details, missions, and statistics prominent.
    • Expand the guidelines by selecting their heading.
    • Guidelines remain open by default on submission forms, including desktop layouts.
  • Accessibility

    • Added keyboard-friendly disclosure controls and clear visual indicators for expanded or collapsed content.

The pre-flight submission guidance is now a disclosure in every variant
rather than only on mobile. On a contribution type detail page it starts
collapsed to a single header row, so the rules no longer push the type's
missions and statistics down the page. The create form's sticky rail
still opens by default, since there the rules are guidance for a form the
user is actively filling in.

## Claude Implementation Notes
- frontend/src/components/portal/ContributionGuidelines.svelte: Desktop card
  branch is a <details open={!detail}> with the header as <summary> plus a
  rotating chevron; header margin collapses when closed.
- frontend/src/tests/ContributionGuidelines.test.js: Cover collapsed-on-detail
  and open-on-create-form defaults.
- frontend/CLAUDE.md: Document the per-variant open/closed behavior.
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8200f9f6-ab18-46a7-9617-06d572d7c931

📥 Commits

Reviewing files that changed from the base of the PR and between f4e8ae2 and f840751.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • frontend/CLAUDE.md
  • frontend/src/components/portal/ContributionGuidelines.svelte
  • frontend/src/tests/ContributionGuidelines.test.js

📝 Walkthrough

Walkthrough

Contribution guidance now uses a collapsible desktop disclosure. Detail pages start collapsed, while submit forms remain open. Tests and documentation cover the route-specific behavior.

Changes

Contribution guidance disclosure

Layer / File(s) Summary
Implement responsive guidance disclosure
frontend/src/components/portal/ContributionGuidelines.svelte
The desktop guidance panel now uses <details> with route-dependent initial state, a clickable summary, chevron rotation, and keyboard focus styling.
Validate and document disclosure behavior
frontend/src/tests/ContributionGuidelines.test.js, frontend/CLAUDE.md, CHANGELOG.md
Tests cover collapsed detail pages and open submit forms. Documentation and the changelog describe the disclosure behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch JoaquinBN/mission-separate-submission-limits

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JoaquinBN
JoaquinBN merged commit 267be25 into dev Aug 14, 2026
2 of 3 checks passed
@JoaquinBN
JoaquinBN deleted the JoaquinBN/mission-separate-submission-limits branch August 14, 2026 18:19
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.

1 participant