Skip to content

Add host field on robot create/edit forms - #3

Merged
mark-takada-airoa merged 1 commit into
mainfrom
feat/robot-form-host-field
Jun 12, 2026
Merged

mark-takada-airoa merged 1 commit into
mainfrom
feat/robot-form-host-field

Conversation

@mark-takada-airoa

@mark-takada-airoa mark-takada-airoa commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Promote host from the JSON robot_config blob to a dedicated, required input on the Create/Edit Robot forms, and rebrand the remaining JSON section as "Advanced Settings."

Changes

  • Added a required host text field (validated via z.string().min(1)) above the JSON textarea in both create-robot-form.tsx and edit-robot-form.tsx.
  • Renamed the JSON textarea to "Advanced Settings (JSON)" and dropped host from its placeholder; the field now only carries port, cameras, etc.
  • Added robot-config-utils.ts with mergeRobotConfigWithHost (merges the dedicated host into the JSON on submit, returns null on invalid JSON) and splitHostFromRobotConfig (extracts host from the stored config when seeding Edit defaults).
  • Added i18n keys (en / ja) for robotForm.host, robotForm.hostDescription, robotForm.advancedSettings, robotForm.advancedSettingsDescription, and validation.hostRequired.

Local Verification

Before creating the PR, please verify the following (exclude items already covered by CI/CD):

Create Robot — host required validation
  • Submitting with an empty host shows the validation.hostRequired i18n error and blocks submit.
image
  • Submitting with a host value merges it into robot_config.host in the API payload.
image
  • The Advanced Settings placeholder no longer references the host key.
image image
Create Robot — Advanced Settings invalid JSON guard
  • Invalid JSON in Advanced Settings surfaces the "Invalid JSON" error and prevents submit.
image
Edit Robot — host preload
  • When the existing robot_config has a host, it appears in the Host field on load.
  • The Advanced Settings textarea shows only the non-host keys.
image image
  • When no other keys remain, the textarea is empty (no {} placeholder).
image image
Edit Robot — host overwrite on save
  • Editing the Host field and saving overwrites robot_config.host with the new value.
image image
  • If a user types a host key inside Advanced Settings, the dedicated Host field still wins on collision.
image image
i18n labels (en / ja) - en: "Host IP", "Advanced Settings (JSON)", and "Host IP is required" render correctly. image
  • ja: "Host IP", "高度な設定(JSON)", and "Host IP は必須です" render correctly.
image

@mark-takada-airoa mark-takada-airoa changed the title add: host field on robot create/edit forms Add host field on robot create/edit forms Jun 8, 2026

@petr-airoa petr-airoa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@okubotakuya-airoa okubotakuya-airoa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for the PR. LGTM!

@mark-takada-airoa
mark-takada-airoa force-pushed the feat/robot-form-host-field branch from a8ccc4c to 071677e Compare June 10, 2026 23:26
@mark-takada-airoa
mark-takada-airoa merged commit dc1362d into main Jun 12, 2026
1 check passed
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.

3 participants