Skip to content

refactor(party): simplify RoleSelectionModal placeholder truncation (26 lines -> 5)#176

Merged
psykzz merged 1 commit into
refactor/party-split-modulesfrom
refactor/party-simplify-placeholder
Jun 20, 2026
Merged

refactor(party): simplify RoleSelectionModal placeholder truncation (26 lines -> 5)#176
psykzz merged 1 commit into
refactor/party-split-modulesfrom
refactor/party-simplify-placeholder

Conversation

@psykzz

@psykzz psykzz commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Closes #172

What

RoleSelectionModal.__init__ had 26 lines of nested conditionals to build a modal placeholder string. The suffix variable was always "" (inert), and label was always "Your Role" regardless of the branch.

Replaced with 5 clear lines. Behaviour is identical.

Validation

  • python -m py_compile party/views.py — clean
  • flake8 party/ --select=F821,E9 — clean

Closes #172

The 26-line nested conditional block for building a modal placeholder
(with dead suffix variable) is replaced with 5 clear lines.
Behaviour is identical: prefix + truncated roles list at 100 chars.
@psykzz psykzz merged commit 9e0c162 into refactor/party-split-modules Jun 20, 2026
3 checks passed
@psykzz psykzz deleted the refactor/party-simplify-placeholder branch June 20, 2026 07:52
psykzz added a commit that referenced this pull request Jun 20, 2026
…176)

Closes #172

The 26-line nested conditional block for building a modal placeholder
(with dead suffix variable) is replaced with 5 clear lines.
Behaviour is identical: prefix + truncated roles list at 100 chars.
psykzz added a commit that referenced this pull request Jun 20, 2026
* refactor(party): delete dead EditPartyModal class (#174)

Closes #171

EditPartyModal (title+description only) was superseded by EditPartyFullModal
(all settings). PartyView.edit_button always opens EditPartyFullModal.
No references to EditPartyModal exist outside its own definition.

* refactor(party): extract _make_party and _post_party to remove 3x copy-paste (#175)

Closes #167

Party dict construction and two-step config-write (save -> send -> save IDs)
were duplicated in party_create, party_template_use, and CreatePartyModal.
_make_party builds the dict; _post_party handles save+send+ID update.

* refactor(party): extract has_party_permission to remove 7x copy-paste (#177)

Closes #168

The author/admin permission check was copy-pasted in party_description, party_settime, party_compact, party_rename_option, party_delete, PartyView.edit_button, and PartyView.delete_button. Extracted to has_party_permission() in helpers.py to avoid circular import.

* refactor(party): simplify RoleSelectionModal placeholder truncation (#176)

Closes #172

The 26-line nested conditional block for building a modal placeholder
(with dead suffix variable) is replaced with 5 clear lines.
Behaviour is identical: prefix + truncated roles list at 100 chars.

* refactor(party): extract _reply helper to collapse signup_user branching (#178)

Closes #164

signup_user had a disabled_view+deferred 2x2 matrix repeated for every
response (not-found, role-full, success) = 12 near-duplicate blocks.
Extracted _reply() collapses all paths. signup_user drops ~120->~35 lines.
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