Skip to content

fix: harden environment rename flows

MacroscopeApp / Macroscope - UI Consistency failed Aug 17, 2026 in 4m 12s

UI Consistency: 1 issue found

apps/web/src/components/settings/ConnectionsSettings.tsx — In SavedBackendListRow, the new EnvironmentLabelControl renders its rename form as a sibling of the still-visible <h3>{environment.label}</h3>, so the environment name appears twice while editing and the min-h-5 title line grows to the input height. The app's established inline-rename pattern (Sidebar.tsx, ChatHeader.tsx) swaps the title for the input; suggest routing the heading through the control's existing non-editing (showValue) branch.

Previously flagged items are resolved: the native window.confirm is now an AlertDialog, the input uses the named size="compact" primitive instead of a call-site h-7 override, Escape is handled and stopped locally, and the pencil trigger now uses icon-micro/ghost-muted, matching SettingResetButton and fitting the 20px title line.

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/ui-consistency.md
More information about how Check Run Agents work can be found in our Help Center.

Scope reviewed (include patterns apps/web/src/**/*.ts|tsx|css):

  • apps/web/src/components/settings/ConnectionsSettings.tsx — new EnvironmentLabelControl, SavedBackendListRow wiring, and the two primary-environment SettingsRow call sites.
  • apps/web/src/state/environments.ts — label projection only, no UI surface.

Checks performed:

  • Primitive contracts: Button sizes (icon-micro = size-5 with size-3 icon, matching SettingResetButton in settingsLayout.tsx; icon-xs for the save/cancel actions) and Input size="compact" (wrapper radius + h-7 inner field) are used as defined, with only width/contextual classes at the call site.
  • Confirmation flow matches the other AlertDialog usages in the same file (AlertDialogClose render={<Button variant="outline" />} + action button).
  • Accessibility/interaction: aria-labels on the pencil, input, save and cancel controls; type="submit" for Enter; Escape is prevented and stopped so it does not close the settings surface; disabled state is driven through the primitives.
  • No nested <form> (the new form is the only one in the file); the AlertDialog action button lives in a portal, outside the form.
  • Inline-rename precedent compared against Sidebar.tsx (line 1104) and ChatHeader.tsx (line 265), both of which replace the title with the input.

Not flagged (judged minor/aesthetic): the compact input (28px field, 30px bordered wrapper) sits next to icon-xs buttons that shrink to 24px at the sm breakpoint; KeybindingsSettings.tsx pairs a compact input with a compact button, but both sizes here are named primitive sizes used as intended.


🔍 Agent activity — 1 tool call

💭 Looking at the recent changes to the web file, I can see that previous issues have been addressed—the window.confirm was replaced with AlertDialog, input sizing was fixed to compact, escape key propagation was handled, and the pencil button icon sizing was corrected to use icon-micro with ghost-muted styling while the save/cancel buttons use icon-xs. Now I need to review what else might need attention. Let me verify whether the size variants like icon-micro, ghost-muted, and compact are actually supported by the Button and Input primitives. I'm checking the button and input component files. I'm looking at the EnvironmentLabelControl code to review what's currently there. Looking at the SettingsRow rendering around that line range and checking for consistency issues with the value display styling and button sizing relative to the input height. The row title uses flexbox with minimum height and centered alignment, and the icon fits at 20px. When editing, the form renders alongside the label rather than replacing it, so both the h3 and the input field display together. That creates a visual duplication—the name appears twice during editing—but it's more of a UX quirk than a strict component consistency violation. The row does grow from 20px to about 30px when the input and buttons appear, which is inherent to inline editing. The real question is whether the save and cancel buttons inside the edit form match the sizing of the rest of the system. Let me search the codebase to see how compact inputs are typically paired with buttons elsewhere. I'm noticing a sizing inconsistency between the input and button components—the compact input stays at 28px while the icon-xs buttons shrink to 24px at the small breakpoint, creating a visual mismatch that might be worth addressing. Looking at other potential issues, I should check what text sizing the SettingsRow uses elsewhere in the file to see if the text-[13px] arbitrary value is consistent with the rest of the component. I need to check the rest of the SettingsRow component to understand how the control prop is rendered, whether it's wrapped in a flex container, and if multiple children can be passed there. The icon-micro with size-3 matches the SettingResetButton pattern, so that's consistent. Now I'm checking how other SettingsRow controls display text values—specifically looking at ConnectionsSettings to see what class they use for read-only value text rendered in control props. Looking at the text styling for values in the SettingsRow control—the text-[13px] text-muted-foreground class appears elsewhere for read-only values, and I'm noticing the description text uses a slightly different opacity level with text-muted-foreground/80. There's also a potential issue with duplicate label display in SavedBackendListRow that I should investigate. The hooks are ordered correctly with the early return coming after all of them, and the accessibility attributes look good with the aria-label for rename actions. The state management seems sound—the value initializes from the label and resets properly when entering edit mode. The Spinner component should already be imported, and the AlertDialog is positioned correctly as a sibling rather than nested inside the form, which avoids any form submission issues. Now I'm checking whether the AlertDialogClose button styling with the outline variant is consistent with other AlertDialog usages throughout the file. The AlertDialog implementation looks good. The Input component's disabled state works fine with the opacity styling, and the combination of compact sizing with disabled and autoFocus props is solid. Now I'm checking the icon-xs Button variant and how it behaves in different contexts. Looking at the geometry more carefully: the form buttons at icon-xs are 24px on desktop versus the input's 30px height, which creates a 2px mismatch. I'm comparing this against similar patterns like KeybindingsSettings where compact Input pairs with compact Button, and there's still that 2px difference. Given that the author has already fixed geometry issues in prior reviews and chose icon-xs as the defined primitive size, this feels like a minor inconsistency rather than something worth flagging. Let me shift focus to the behavioral aspects instead. I'm examining how EnvironmentLabelControl renders per row with its own useEnvironmentSessionState hook. Now I'm checking the accessibility and HTML structure more carefully. The rename form sits inside the row, and I need to verify whether there's a nested form situation happening — that would be invalid HTML. Looking at SavedBackendListRow, the row title is an h3 with the pencil button having proper aria-label. The real question is whether the row itself or any ancestor is wrapped in a form element that would create nesting issues. There's only one form to deal with, which is good. Mobile isn't in scope since we're limiting to the apps/web/src patterns. I need to verify that useEnvironmentSessionState actually exists in apps/web/src/state/session.ts since the diff shows it being imported in the web file but doesn't show it being added there — same question about the AuthOrchestrationOperateScope import in the Connect file. The environments file is just a data change with the label coming from serverConfig now. I'm checking whether there are any UI consistency issues worth flagging by comparing how the primary-environment SettingsRow displays read-only values across different parts of the interface, particularly looking at the styling and layout patterns around lines 3195 and 3557. I notice the description text uses a slightly different opacity level than the control value text, though that's not really a problem. More importantly, I'm checking whether the input width of 192px might cause overflow issues on narrow screens when combined with the h3 label in the saved-environment row, especially since the container has min-w-0 but the input has a fixed width. There's also a potential UI inconsistency: when editing a saved backend, both the environment name label and the input field appear side-by-side, creating a duplication that looks like "My MacBook [My MacBook input]" — unlike the primary environment settings where the label hides when editing. This feels like a layout defect that also unnecessarily increases the row height. Let me check if there's an existing inline-rename pattern elsewhere in the codebase that properly hides the title while editing, like how project or thread renames are handled. Looking at the Sidebar component around line 1104 to see how they handle the rename input pattern — it seems they swap the title with an input field rather than showing both simultaneously. I should check ChatHeader at line 265 too to understand the broader convention, though the saved-environment row appears to display the label and input together, which might be the consistency argument I need. I'm seeing the real issue now: the inline rename pattern in this codebase replaces the label with the input field, but here both the original <h3> and the edit form are showing at the same time, which breaks that convention and causes the layout to expand awkwardly. The fix would be to have the EnvironmentLabelControl component handle rendering the label itself, so it can toggle between showing the text and showing the input without duplication. I could suggest passing a render prop or leveraging the existing showValue pattern to move the <h3> inside the control, matching how the Sidebar and ChatHeader handle inline renames. This would be a multi-hunk change but contained to the same file. Now I'm checking if there are other issues — looking at the button and input sizing in the form, particularly how the icon-xs buttons at 24px compare to the 30px input height in the settings row context. Let me verify the layout structure for the form and dialog in EnvironmentLabelControl—the AlertDialog renders as a portal so that's fine. I'm also checking if there's an issue when the label is empty, but that's not a UI consistency problem. I'll focus on the duplicate title as my main comment, and possibly add a brief note about the icon-xs versus compact button size mismatch on a separate line. The real problem is that icon-xs is designed to scale down on smaller screens, but the compact input stays fixed at h-7, creating an intentional mismatch between the two primitives. I should search for existing examples of compact Input paired with icon-xs Button to see how this is typically handled. I'm noticing a discrepancy between what the git grep shows and what I saw earlier when viewing the file — the current HEAD has size="icon-xs" and variant="ghost" on that button, but my previous view showed size="icon-micro" and variant="ghost-muted" instead. The view tool was pointing to a different branch reference, which explains why the attributes don't match. So the clone is at f560e7e, not the PR head f1b37a6 — that's why the unspecified grep showed the older icon-xs state. I need to consistently use the /tree/f1b37a68 URL to check the actual PR changes, and re-verify the key findings at that commit. I've confirmed the h3 and control coexist at f1b37a6 in SavedBackendListRow (lines 1598-1604), with the label rendered unconditionally next to the input field. Now checking the diff to see what changed. The previous commit isn't available, but the latest change with the icon update addressed the feedback. I'm identifying a clear issue: the saved-environment row has a duplicated static label next to the rename input. Picturing the layout—"● My MacBook [My MacBook][✓][✕]"—it's definitely redundant and confusing, breaking the pattern established elsewhere in the sidebar and chat header. I should flag this as a UI consistency problem on the EnvironmentLabelControl (lines 1599-1604 in the diff), noting the duplicate against the h3 label above it. The duplicate is a visual defect even if the input serves as an inline editor. I'm skipping the geometry concern about icon sizing versus input dimensions—that's too minor and icon-xs is a named primitive. The input width and maxLength seem reasonable, though I'm briefly reconsidering whether showing the label twice could be intentional before settling on it being a defect worth commenting on. I'm verifying the SettingsRow layout doesn't shift when editing (the auto-sized column with grid-cols-[minmax(0,1fr)_minmax(10rem,auto)] handles the input plus buttons fine), and EnvironmentLabelControl's early return when neither canRename nor showValue is true doesn't cause hook issues. Given this is a genuine inconsistency with the repo's inline-rename convention and the duplicate label is a regression risk, I'm setting this to failure and writing a concise inline comment without reproducing the diff. The comment will point out that while editing, the row still displays the environment name as an <h3> next to the input field, creating a duplicate label that also causes the title line to grow to match the input height. I'll reference the repo's established pattern from Sidebar and ChatHeader where the title swaps out for the input field entirely, and suggest letting EnvironmentLabelControl manage the displayed name through its existing showValue branch — perhaps via a renderLabel prop — so the heading is hidden while the form is open. I'll post this at line 1599 in ConnectionsSettings.tsx, spanning the relevant lines where the heading and input coexist.

1. modify_pr — One inline-rename consistency issue in apps/web/src/components/settings/ConnectionsSettings.tsx. The primitive usage itself (compact Input, icon-micro/ghost-muted pencil matching SettingResetButton, AlertDialog for the duplicate-name confirmation, Escape handled locally) now lines up with the shared component system.


Agent Credits: 198 credits