Peripherals Display Name Support#209
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a human-friendly display_name field for peripherals, wiring it through persistence, the HTTP API, and the frontend so peripherals can be shown/edited with a nicer label than the technical id.
Changes:
- Add
display_nameto thePeripheralmodel serialization and persist it in the peripherals collection. - Extend peripherals API schemas/handlers and unit tests to accept/return
display_name. - Update the frontend peripherals list/forms and frontend API wrapper to display and submit
display_name.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/qtoggleserver/peripherals/test_peripheral.py | Adds unit coverage that display_name defaults to "" and is reflected in to_json(). |
| tests/unit/qtoggleserver/peripherals/test_init.py | Adds persistence/compat tests around display_name when adding peripherals. |
| tests/unit/qtoggleserver/peripherals/api/test_funcs.py | Updates expected API payloads and adds POST validation/behavior tests for display_name. |
| qtoggleserver/peripherals/peripheral.py | Adds display_name storage plus getter/setter and includes it in to_json(). |
| qtoggleserver/peripherals/api/schema.py | Adds display_name to POST/PATCH/PUT peripheral schemas (string, max 64). |
| qtoggleserver/peripherals/api/funcs.py | Includes display_name in PATCH merge defaults so updates round-trip correctly. |
| qtoggleserver/peripherals/init.py | Excludes display_name from legacy flattened params and persists display_name for dynamic peripherals. |
| qtoggleserver/frontend/js/peripherals/peripherals-list.js | Shows display_name (fallback to id) in the peripherals list UI. |
| qtoggleserver/frontend/js/peripherals/peripheral-form.js | Adds editable Display Name field and includes it in PATCH payload; uses it for page title. |
| qtoggleserver/frontend/js/peripherals/add-peripheral-form.js | Adds Display Name field and submits it during peripheral creation. |
| qtoggleserver/frontend/js/api/peripherals.js | Extends postPeripherals() to accept and send display_name. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.