Skip to content

fix(studio): let the auto-join toggle show what it just saved - #175

Merged
mroops0111 merged 1 commit into
masterfrom
fix/auto-join-toggle
Sep 15, 2026
Merged

mroops0111 merged 1 commit into
masterfrom
fix/auto-join-toggle

Conversation

@mroops0111

Copy link
Copy Markdown
Owner

What

Two small defects on the Admit Anyone Who Signs In checkbox, in the workspace details sheet.

The toggle looked unpressable

It reads its own state from the workspace (productManifest.autoJoinAs), but the onChanged callback it was handed only invalidated queryKeys.workspaceMembers. The PATCH landed, the workspace query was never refetched, and the controlled checkbox re-rendered with the old checked={false}.

To anyone using it, the click does nothing. The write had in fact succeeded every time.

invalidate() was written for its two original callers, MemberRow and AddMemberControl, which both edit the member list. AutoJoinControl was later wired to the same callback but edits the workspace, so that edge was missing. Since turning this on also backfills existing users into the member list, one save genuinely leaves both queries stale, so the second invalidation belongs in the shared helper rather than in one caller's onSuccess.

The checkbox sat about 4px high

mt-0.5 centres a 12px box on a 16px line, which is what text-2xs (11px / 16px) gives. But text-2xs was on the two spans inside the label, not on the label, and a label carries the strut of whatever it inherits. With no size pinned anywhere above it the strut is the browser default plus preflight's line-height: 1.5, so the first line box was 24px and the nudge under-shot by 4px.

Moving the size onto the row makes the line the height the existing nudge already assumed. Same idiom as the two-line checkbox in Build.tsx. Also added shrink-0 so the box cannot be squeezed next to flex-1 text in a narrow sheet.

Verification

  • @braidhq/studio typecheck, lint, and 268 tests pass
  • Confirmed against the deployed instance that the writes had been landing all along: dottedsign's PRODUCT.md carries autoJoinAs: guest

Note

This is display-only. No change to the permission model, the route, or the manifest.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JXXoZwM5RfHUzW6vScoeqv

@github-actions github-actions Bot added the bug Something isn't working label Sep 11, 2026
The toggle reads whether the workspace admits everyone from the
workspace itself, but the callback it was given only refreshed the
member list beside it. So a save landed on the server and the
checkbox snapped straight back, which reads as a control that cannot
be pressed rather than one whose answer arrived late.

Admitting everyone also backfills the member list, so that one save
leaves both stale, and the refresh belongs to the pair rather than to
either caller.

The box beside the label was also sitting high. Its nudge assumed the
line box came from the small text inside the label, where a label
carries the strut of whatever it inherits and a span cannot shrink it.
Putting the size on the row makes the line the height the nudge
already expected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXXoZwM5RfHUzW6vScoeqv
@mroops0111
mroops0111 merged commit c892879 into master Sep 15, 2026
6 checks passed
@mroops0111
mroops0111 deleted the fix/auto-join-toggle branch September 15, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant