Skip to content

Make preset creation easier: username owner search and compiler name display#2037

Open
ethteck with Copilot wants to merge 5 commits into
mainfrom
copilot/make-preset-creation-easier
Open

Make preset creation easier: username owner search and compiler name display#2037
ethteck with Copilot wants to merge 5 commits into
mainfrom
copilot/make-preset-creation-easier

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown

Preset creation/editing was painful: owner lookup required knowing the numeric profile ID and the preset detail UI showed the opaque compiler ID instead of a human-readable name.

Backend — Django admin

  • Owner field: Replaced raw_id_fields = ["owner"] with autocomplete_fields = ["owner"] so admins can search by username; added search_fields = ["user__username", "pseudonym"] to ProfileAdmin to enable this

Frontend — Preset detail page

  • Compiler display: Renamed "Compiler ID" → "Compiler" and renders the human-readable name via the existing i18n translation layer instead of the raw ID
  • Compiler editing: Edit mode now loads available compilers for the preset's platform and shows a Select dropdown; the chosen compiler is included in the PATCH request on save

- Backend: Add compiler dropdown to PresetAdmin with choices from available_compilers(), sorted alphabetically with platform names displayed
- Backend: Replace raw_id_fields owner lookup with autocomplete_fields to enable username-based search
- Backend: Add search_fields to ProfileAdmin (user__username, pseudonym) to support autocomplete
- Frontend: Show human-readable compiler name (via i18n translation) instead of raw compiler ID
- Frontend: Allow changing compiler via dropdown when editing a preset
- Frontend: Include selected compiler in PATCH request on save
Copilot AI changed the title [WIP] Update admin page for easier preset creation Make preset creation easier: compiler dropdown, username owner search, and compiler name display Jul 13, 2026
Copilot AI requested a review from ethteck July 13, 2026 03:29
@ethteck ethteck changed the title Make preset creation easier: compiler dropdown, username owner search, and compiler name display Make preset creation easier: username owner search and compiler name display Jul 13, 2026
@ethteck
ethteck marked this pull request as ready for review July 13, 2026 08:03
@ethteck
ethteck requested a review from bates64 as a code owner July 13, 2026 08:03
@mkst

mkst commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Just tried to test this locally..

  • 🔴 Changing compiler through the frontend fails... There's an explicit check /safeguard on the backend, so trying to change the compiler hits:
{
    "non_field_errors": [
        "Only compiler_flags can be edited on an existing preset."
    ],
    "kind": "ValidationError"
}

So that constraint should be changed & its unit test updated.

  • 🟢 The username search on the /admin page works as expected thankfully (i.e. it doesnt load a million profiles, it searches smartly).

@ethteck

ethteck commented Jul 17, 2026

Copy link
Copy Markdown
Member

Thanks for testing this better than I did :P

The issue you reported should be fixed now, hopefully

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.

Make preset creation easier

3 participants