Skip to content

fix(fleet): persist fleet name in definition body + restore button cursor - #552

Merged
rschardosin merged 1 commit into
SAP:mainfrom
corey-aloia:fix/fleet-save-agent-name-and-button-cursor
Sep 26, 2026
Merged

rschardosin merged 1 commit into
SAP:mainfrom
corey-aloia:fix/fleet-save-agent-name-and-button-cursor

Conversation

@corey-aloia

Copy link
Copy Markdown
Contributor

Summary

Two Studio UI fixes.

Bug 1 — "Save Agent" returned HTTP 400 "fleet name is required". A plan/template's display name was stored only in the ent name column, never in the definition body. On read, GetPlan deserialized the body into *fleet.FleetPlan without the column name, so plan.Name was empty and the agent PATCH handler's Validate() failed. Compounding it, FleetPlan embeds FleetConfig and both declare a name JSON tag, so encoding/json fills only the outer FleetPlan.Name and leaves the embedded FleetConfig.Name (the field Validate checks) empty. Fix: GetPlan/GetFleet now reconcile both name fields and fall back to the name column (healing legacy rows on read); Save writes the resolved name back into the body. Mirrored in the template store.

Bug 2 — no pointer cursor on buttons. Tailwind v4's Preflight dropped cursor: pointer on <button> (v3 set it). Restored for enabled buttons / role="button" in web/src/index.css.

Testing

  • New store round-trip tests (Save reconciles name; Get heals legacy rows). go test ./pkg/store/entstore/... ./pkg/api/... green (pre-existing unrelated TestOAuthServerCleanup failure confirmed on clean main). go vet / gofmt / npm run typecheck clean.
  • In-browser: Add Agent → Save Agent now PATCHes 200 (was 400), panel closes; buttons show a hand cursor on hover.

@cla-assistant

cla-assistant Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

…rsor

Two Studio UI fixes:

1. "Save Agent" in the Fleet UI returned HTTP 400 "fleet name is
   required". The plan/template display name was stored only in the ent
   `name` column, never in the definition body. On read, GetPlan
   deserialized the body into *fleet.FleetPlan without injecting the
   column name, so plan.Name was empty and the agent PATCH handler's
   plan.Validate() failed on its first check.

   FleetPlan embeds FleetConfig and both declare a `name` JSON tag, so
   encoding/json populates only the shallower FleetPlan.Name and leaves
   the embedded FleetConfig.Name (the field Validate checks) empty —
   unlike the YAML path, which syncs them explicitly. GetPlan now
   reconciles both fields and falls back to the `name` column, healing
   legacy rows on read. Save writes the resolved name back into the body
   so new rows are self-consistent. Mirrored in the template store.

2. Tailwind v4's Preflight (unlike v3) no longer sets cursor:pointer on
   buttons, so no button in Studio showed a hand on hover. Restore it for
   enabled buttons and role="button" elements.

Verified in-browser: agent PATCH now returns 200, editor panel closes,
buttons show a pointer cursor on hover.
@corey-aloia
corey-aloia force-pushed the fix/fleet-save-agent-name-and-button-cursor branch from 0153e58 to 22599db Compare September 25, 2026 12:41

@rschardosin rschardosin 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.

Thank you!

@rschardosin
rschardosin merged commit 3a47999 into SAP:main Sep 26, 2026
5 checks 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.

2 participants