Skip to content

fix(graphs): return the extension display name instead of dropping it - #1321

Merged
jfrench9 merged 1 commit into
mainfrom
bugfix/extension-display-name
Sep 1, 2026
Merged

fix(graphs): return the extension display name instead of dropping it#1321
jfrench9 merged 1 commit into
mainfrom
bugfix/extension-display-name

Conversation

@jfrench9

@jfrench9 jfrench9 commented Sep 1, 2026

Copy link
Copy Markdown
Member

getAvailableExtensions builds a display-names table, looks each extension up
in it, puts the result in a dict — and then drops it when constructing the
AvailableExtension response objects, which carry only name, description
and enabled:

extension_objects = [
  AvailableExtension(
    name=str(ext["name"]), description=str(ext["description"]), enabled=False
  )
  for ext in available_extensions   # ext["display_name"] computed, never read
]

So the only human-readable label the endpoint has never leaves it. Clients get
name, which is the schema slug the create path takes, and the visible
consequence is the graph creation wizard heading its extension cards
"roboledger" and "roboinvestor" — plus the required-extensions alert listing
slugs.

Found while fixing dark-mode issues in that same wizard
(robosystems-app#351).

Change

  • display_name added to AvailableExtension, optional so an older client is
    unaffected; clients fall back to the slug when it is absent.
  • Populated on both response paths. The fallback branch never had one at all,
    so the table is hoisted to module scope beside the descriptions, where the
    existing comment already explains why those constants are single-sourced.
  • Test asserts the display name survives into the response. Verified it fails
    against the old source (KeyError), so it is not vacuous.

Follow-up (not in this PR)

The apps can't use the field until the TypeScript client is regenerated and
released, then adopted. Happy to take that chain next if you want it.

just test-code clean; pytest tests/routers/graphs tests/models green
(1735 passed, 4 skipped).

`getAvailableExtensions` built a display_names table, looked each
extension up in it, put the result in a dict — and then discarded it when
constructing the AvailableExtension response objects, which only carry
name, description and enabled.

So the only human-readable label the endpoint has never left it. Clients
render `name`, which is the schema slug the create path takes, and the
graph creation wizard headings its extension cards "roboledger" and
"roboinvestor" is the visible consequence.

Add display_name to the model and populate it on both paths. The
fallback branch never had one at all, so hoist the table to module scope
next to the descriptions it belongs with, where the same comment already
explains why the constants are single-sourced.

The field is optional so an older client is unaffected, and clients
should fall back to the slug when it is absent.
@jfrench9
jfrench9 merged commit 3cec357 into main Sep 1, 2026
7 checks passed
@jfrench9
jfrench9 deleted the bugfix/extension-display-name branch September 1, 2026 06:40
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