Skip to content

fix: drop Config tab for functions, support generic vendor middleware in data transforms#66

Merged
bburda merged 2 commits intomainfrom
fix/functions-config-tab-and-generic-data
Apr 14, 2026
Merged

fix: drop Config tab for functions, support generic vendor middleware in data transforms#66
bburda merged 2 commits intomainfrom
fix/functions-config-tab-and-generic-data

Conversation

@bburda
Copy link
Copy Markdown
Contributor

@bburda bburda commented Apr 13, 2026

Pull Request

Summary

Two small UI polish fixes for function entities and generic-middleware data rendering:

  1. FunctionsPanel stops fetching /functions/{id}/configurations and no longer renders a Config tab (functions do not expose that collection). Removes 404 spam and an always-empty tab.
  2. transformDataResponse treats the SOVD x-medkit vendor extension as generic middleware metadata: reads middleware, access, type, direction, encoding; marks topics as status: 'data' when the gateway inlines a value; accepts input/output alongside publish/subscribe/both. ROS 2 behaviour unchanged, everything new is additive.

The duplicate transformFault timestamp fix has been dropped from this PR. It now lives only on #64 (its original home).


Issue


Type

  • Bug fix
  • New feature
  • Breaking change
  • Documentation only

Testing

  • npm run lint clean
  • npm run typecheck clean
  • npm test - 358 tests pass (8 new tests for generic vendor middleware handling)
  • npm run build succeeds
  • Manual: function detail view no longer issues /configurations request and no longer renders Config tab; existing component/app Config tabs unchanged

Checklist

  • Breaking changes are clearly described (none)
  • Linting passes (npm run lint)
  • Build succeeds (npm run build)
  • Docs were updated if behavior or public API changed (n/a - bug fixes, no public API change)

Functions are capability aggregations in SOVD and do not expose their
own `/configurations` collection. FunctionsPanel was still fetching it
and rendering a Config tab that always stayed at 0, producing 404 spam
in the network panel and an empty tab in the UI.

Filter `configurations` out of FUNCTION_TABS, drop the parallel
fetchConfigurations call in loadFunctionData, and remove the Config
card from the overview summary grid.
Copilot AI review requested due to automatic review settings April 13, 2026 19:57
@bburda bburda self-assigned this Apr 13, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR polishes SOVD entity resource handling in the React UI by removing an unsupported configurations surface from function entities, hardening fault timestamp parsing, and making data transforms tolerate non-ROS2 vendor-extension metadata.

Changes:

  • Remove the Configurations tab/fetch from FunctionsPanel to avoid 404s for /functions/{id}/configurations.
  • Make transformFault tolerant to ISO timestamp strings and invalid/missing/zero/negative values.
  • Extend transformDataResponse to support generic x-medkit metadata (direction/type/value) and mark items as status: 'data' when a value is inlined, with added tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/lib/transforms.ts Harden fault timestamp parsing and broaden data transforms to handle generic x-medkit metadata/value inlining.
src/lib/transforms.test.ts Add unit tests for defensive fault timestamps and generic vendor middleware handling in data transforms.
src/components/FunctionsPanel.tsx Remove Configurations tab and configurations fetch for functions to prevent 404 spam and empty UI.

Comment thread src/lib/transforms.ts Outdated
Comment thread src/lib/transforms.ts Outdated
Comment thread src/lib/transforms.ts Outdated
Comment thread src/lib/transforms.ts Outdated
Comment thread src/lib/transforms.ts Outdated
Comment thread src/lib/transforms.test.ts Outdated
@bburda bburda force-pushed the fix/functions-config-tab-and-generic-data branch from f35724c to 8d3fde2 Compare April 14, 2026 15:18
@bburda bburda changed the title fix: drop Config tab for functions, defensive fault timestamps, generic vendor middleware in data transforms fix: drop Config tab for functions, support generic vendor middleware in data transforms Apr 14, 2026
@bburda
Copy link
Copy Markdown
Contributor Author

bburda commented Apr 14, 2026

Dropped the duplicate transformFault timestamp fix from this PR - it now lives only on #64 per the review thread there. Scope here is now just the function Config-tab drop and the generic vendor middleware support.

Extend `RawDataItem` / `transformDataResponse` to treat the SOVD
`x-medkit` vendor extension as generic metadata rather than a
ROS-2-only construct:

- accept `middleware`, `access`, `type`, `direction`, `encoding` as
  optional vendor fields on the data item
- when the gateway inlines `value`, mark the resulting topic as
  `status: 'data'` instead of always `metadata_only`, so non-streaming
  middlewares render their current value immediately
- use `x-medkit.type` as the type label when no ROS 2 message type is
  available
- recognise `input` / `output` as alternative direction terms alongside
  `publish` / `subscribe` / `both`
- fall back to `x-medkit.direction` when `ros2.direction` is absent

ROS 2 behaviour is unchanged; everything new is additive.
@bburda bburda force-pushed the fix/functions-config-tab-and-generic-data branch from 8d3fde2 to 10ada66 Compare April 14, 2026 15:32
@mfaferek93 mfaferek93 self-requested a review April 14, 2026 15:47
@bburda bburda merged commit adcacbf into main Apr 14, 2026
3 checks passed
@bburda bburda deleted the fix/functions-config-tab-and-generic-data branch April 14, 2026 15:49
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.

[BUG] Empty function Config tab, brittle fault timestamps, ROS-2-only data transforms

3 participants