feat(tui): custom-field labels, detail-view list rendering, bulk-edit polish (#132, #133, #134)#135
Merged
Merged
Conversation
…t use Mirror the #130 ObjectTypeResolver: fetch-once-per-scope, cache, return None on failure. CustomFieldResolver maps custom_fields.<name> -> label/type/choices scoped by object type; TagsResolver fetches the global tag list. custom_field_labels builds a display-label map with collision/fallback handling. Foundation for #132, #134. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…able (#133) The detail view stringified list values (tags, other M2M/list fields) to a raw list-of-dicts repr. Route them through the shared flatten/render_cell pipeline so they show a comma-joined display string, colored when object colors are enabled, matching the list table. Promotes view._cell to public render_cell. Closes #133 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ser (#132) Custom-field columns showed the raw custom_fields.<name> key everywhere. Add a display-label layer (CustomFieldResolver + custom_field_labels) that maps the key to the field's NetBox label for: TUI list headers, the column chooser, and CLI table/CSV headers. The raw key stays the selector/persistence key, so --columns and saved prefs are unchanged. Labels resolve only when a custom-field column is shown; missing defs, offline, unknown fields, and label collisions all fall back to the raw key. Closes #132 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ct (#134) - Expand custom_fields into one typed widget per field (text/number/switch/ select/multiselect) in both the single EditForm and the BulkEditForm, via a shared forms.py layer. Values stage flat as custom_fields.<name> and are folded back into a nested custom_fields object before the PATCH/POST. - Render tags as a SelectionList multi-select populated from /api/extras/tags/, submitting the NetBox-writable [{name, slug}] list. Single edit only stages a tags change when the selection actually differs; bulk replaces (Set tags to…). - Polish the bulk form layout (CSS) to align include-toggle + label + widget with the single-edit experience. - Widget ids encode the custom_fields dot as a hyphen (Textual rejects dots). - Degrade gracefully to the prior single text inputs when tag/custom-field definitions can't be fetched. Closes #134 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- EditForm: pre-seed custom-field multiselect widgets from the record's current values (previously only tags seeded; cf multiselects rendered empty). Stage a multiselect change only when the value set actually differs, so an unchanged pre-seeded selection — regardless of order — never forces a spurious patch. - CLI: relabel custom-field column headers in 'get' and create/update response output too (handle_get + _render_response), deriving the collection path from a detail path so the resolver matches. Matches handle_list; gated on a cf column. - BulkEditForm: encode FK widget/button ids consistently at creation (Textual rejects dots), matching how they are queried back. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 29, 2026
Merged
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.
Closes #132, #133, #134 — three tightly-coupled TUI improvements for the 1.6.0 milestone. They share a custom-field-definitions resolver (and #134 a tags resolver), mirroring the #130 object-type resolver pattern, so they ship together to avoid release churn.
#133 — detail view renders list-of-object fields like the list table (bug)
The detail view stringified list values (tags, other M2M/list fields) to a raw
[{'id': …, 'display': …}]repr. They now route through the sharedflatten/render_cellpipeline → comma-joined display, colored when object colors are on. Both the editable and read-only branches are covered.view._cellwas promoted to publicrender_cell.#132 — custom-field column labels (enhancement)
Custom-field columns showed the raw
custom_fields.<name>key. A newCustomFieldResolvermaps the key → the field's NetBox label (GET /api/extras/custom-fields/, scoped by object type), consumed by:f)table/csvheaders — forlist,get, and create/update responsesThe raw key stays the selector/persistence key, so
--columnsand saved prefs are unchanged. Labels resolve only when a custom-field column is shown; missing defs, offline, unknown fields, and label collisions all fall back to the raw key.json/jsonl/yamlare untouched.#134 — bulk-edit polish + per-field custom fields + tags dropdown (enhancement)
custom_fieldsexpands into one typed widget per field (text/number/switch/select/multiselect) in both the singleEditFormand theBulkEditForm, via the sharedforms.pylayer. Values stage flat ascustom_fields.<name>and are folded back into a nestedcustom_fieldsobject before the PATCH/POST.tagsrenders as aSelectionListpopulated fromGET /api/extras/tags/, submitting the NetBox-writable[{name, slug}]list. Single edit only stages a tags change when the selection actually differs; bulk replaces ("Set tags to…").Notes
nsc/savedfilters/alongside the feat(saved-searches): back saved searches with NetBox native SavedFilter #130 object-type resolver.custom_fields.dot as a hyphen (Textual rejects dots in ids).Testing
just lint(ruff + mypy --strict) clean.just test— 1324 passed, 1 skipped (19 new tests across resolvers, detail rendering, CLI/TUI headers, forms helpers, and bulk/single edit flows).🤖 Generated with Claude Code