Skip to content

feat: location templates in NodeInfo + dashboard template UX - #258

Merged
RyanTheRobothead merged 2 commits into
unstablefrom
feature/204-location-templates-nodeinfo-dashboard
Mar 28, 2026
Merged

feat: location templates in NodeInfo + dashboard template UX#258
RyanTheRobothead merged 2 commits into
unstablefrom
feature/204-location-templates-nodeinfo-dashboard

Conversation

@RyanTheRobothead

@RyanTheRobothead RyanTheRobothead commented Mar 28, 2026

Copy link
Copy Markdown
Member

Summary

Closes #204. Exposes location templates through NodeInfo and adds comprehensive dashboard UX for template-aware location management.

  • NodeInfo: Added location_templates and location_representation_templates fields, populated from AbstractNode class variables at init
  • Dashboard - SchemaForm: New reusable component that renders dynamic forms from a template's schema_def, default_values, and required_overrides
  • Dashboard - LocationModal: Existing representations now display as structured cards with labeled fields (instead of raw JSON chips). Inline editing via SchemaForm. Template-aware "Add Representation" flow with dynamic forms.
  • Dashboard - CreateLocationFromTemplateModal: New modal for creating locations from LocationTemplate with node role bindings and optional representation overrides
  • Dashboard - Entry points: "Create from Template" buttons on LocationsPanel, LocationTemplatesPanel rows, and AddLocationModal
  • Bug fixes: LocationModal API calls now use location_name (not location_id); modal location data stays in sync after mutations via computed property
  • Example lab: Added schema_def to RobotArmNode and LiquidHandlerNode representation templates
  • Bundled templates: Added location representation template boilerplate to module/robot_arm, module/device, and module/liquid_handler scaffolding templates
  • Documentation: New integrator guide (10-location-templates.md), updated wiring guide, node development reference, example lab README, and template catalog

Test plan

  • 1689 Python tests pass (including 5 new NodeInfo template population tests)
  • Frontend builds with no TypeScript errors
  • All pre-commit hooks pass (ruff, formatting, etc.)
  • Manual: Verify dynamic form renders correct field types (text, number, enum select, JSON textarea) for robot arm templates
  • Manual: Create location from template with node bindings
  • Manual: Edit existing representation inline via SchemaForm
  • Manual: Verify fallback to JSON editor for nodes without templates
  • Manual: Verify delete location, attach/detach resource still work after URL fix

🤖 Generated with Claude Code

…e UX (#204)

Add location_templates and location_representation_templates fields to
NodeInfo so consumers can discover what templates a node registers.
Populate them from AbstractNode class variables at init.

Dashboard changes:
- SchemaForm component renders dynamic forms from template schema_def
- LocationModal shows structured representation data with inline editing
- CreateLocationFromTemplateModal for creating locations from templates
- Template entry points on LocationsPanel, LocationTemplatesPanel, AddLocationModal
- Fix LocationModal API URLs to use location_name instead of location_id
- Fix modal reactivity by deriving location from store via computed

Example lab & templates:
- Add schema_def to RobotArmNode and LiquidHandlerNode representation templates
- Add location_representation_templates boilerplate to robot_arm, device,
  and liquid_handler bundled module templates

Documentation:
- New integrator guide: docs/guides/integrator/10-location-templates.md
- Update wiring guide, node development reference, example lab README,
  and template catalog

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/madsci_common/madsci/common/types
  node_types.py
  src/madsci_node_module/madsci/node_module
  abstract_node_module.py
Project Total  

This report was generated by python-coverage-comment-action

- Fix getTemplateForNode to resolve correct template for multi-template
  nodes using location_template_name and node_bindings reverse-mapping
- Extract locationApiUrl/locationBaseUrl helpers to eliminate 8 duplicated
  fragile URL construction patterns across 3 components
- Always collect representation overrides regardless of UI toggle visibility
- Wire up validateFormValues for override form validation on submission
- Replace all alert() calls with reactive v-alert error display pattern
- Fix SchemaForm emitting update to parent during mount initialization
- Sync TypeScript Location interface with Python model (add 5 missing fields)
- Tighten get_resource typing and remove unnecessary as-any casts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@RyanTheRobothead
RyanTheRobothead merged commit b85ffcd into unstable Mar 28, 2026
4 checks passed
@RyanTheRobothead
RyanTheRobothead deleted the feature/204-location-templates-nodeinfo-dashboard branch April 9, 2026 19:47
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