Skip to content

RM-45: Add predefined close reasons - #156

Merged
BenHall-1 merged 5 commits into
masterfrom
RM-45
Nov 2, 2026
Merged

BenHall-1 merged 5 commits into
masterfrom
RM-45

Conversation

@biast12

@biast12 biast12 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RM-45

Description

Adds support for predefined close reasons, which are set per panel on the dashboard:

  • /close and /closerequest suggest the panel's close reasons as you type.
  • The Close with Reason form shows a reason picker. It also shows a text box when the panel allows custom reasons. A picked reason wins over typed text.
  • The archive's Edit Close Reason button uses the same form, with the current reason pre-selected.
  • If the panel doesn't allow custom reasons, any reason given must be one of its close reasons. Closing without a reason still works.

Panels without close reasons, and tickets without a panel, behave exactly as before. If the lookup fails, the worker falls back to today's behaviour. System closes (auto-close, member leave, close request accept and timer, dashboard relay) are unchanged.

Requires:
TicketsBot-cloud/database#47 ✓
TicketsBot-cloud/locale#252 ✓

Type of Change

  • Bug fix
  • New feature
  • Breaking change

Testing

  • Check that everything works as it does now (there should be no change in behaviour)
  • Add a close reason, check if it come up when you run /close and /closerequest
  • Use the close with reason button, does the dropdown come up with the options?
  • Add something in both the options and submit - only the selected predefined option should be the close reason
  • Turn off Allow Custom Close Reasons - only the selects should be allowed and appear in the close with reason modal

Checklist

  • My code follows the style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Support panel-configured close reasons across close commands, modals, edits, and autocomplete. Add preset selection with optional custom reasons, canonicalize submissions, validate reasons, and centralize close-reason resolution logic.
@biast12
biast12 requested a review from a team as a code owner September 29, 2026 17:57
@github-actions github-actions Bot added needs:gomod_comment go.mod has uncommented local replace directives type:feature New Feature labels Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

This PR is blocked

  • needs:bump_db - PR references a database PR but go.mod is not yet bumped

Remove the label(s) above once the underlying dependency bump or comment has landed, and this check will re-run on the next push.

@BenHall-1

Copy link
Copy Markdown
Member

Ready to bump

@github-actions github-actions Bot removed needs:bump_db PR references database repo changes needs:gomod_comment go.mod has uncommented local replace directives labels Oct 8, 2026
@biast12

biast12 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@BenHall-1 bumped!

@github-actions github-actions Bot added the needs:bump_db PR references database repo changes label Oct 27, 2026
Pass worker context into autocomplete handlers and prevent unauthorized users from receiving ticket close reasons. Refactor close permission checks to return errors consistently.
@biast12

biast12 commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

The label is wrong, database is bumped already lol

@BenHall-1
BenHall-1 merged commit 50659d9 into master Nov 2, 2026
1 check failed
@BenHall-1
BenHall-1 deleted the RM-45 branch November 2, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:bump_db PR references database repo changes type:feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants