Skip to content

Commit 3e36002

Browse files
committed
fix(editor): polish setup wizard + main-window narrow-width layout
- Setup wizard: de-box the title beside the logo; footer buttons size to content and sit together on one row (Refresh no longer stretches full-width and overflows); rename the deps-step "Done" button to "Next". - Client Configuration dialog: show the count + only failures + next step instead of enumerating every successfully configured client. - Main window header: version pill never shrinks/clips (flex-shrink 0); title stays at natural width. - Tabs: flex-shrink so all six stay reachable when docked narrow. - Connection status label wraps/shrinks instead of sliding under the Disconnect button (scoped to #connection-section).
1 parent e677663 commit 3e36002

5 files changed

Lines changed: 54 additions & 9 deletions

File tree

‎MCPForUnity/Editor/Windows/Components/Common.uss‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,23 @@
170170
-unity-text-align: middle-left;
171171
}
172172

173+
/* At narrow widths the connection status label (e.g. "Session Active (Project)") must wrap/shrink
174+
instead of sliding under the toggle button. Scoped to the connection section so other shared
175+
.status-text rows are unaffected; uses wrapping (not ellipsis) so the text stays fully readable. */
176+
#connection-section .status-container {
177+
flex-shrink: 1;
178+
min-width: 0;
179+
}
180+
181+
#connection-section .status-text {
182+
flex-shrink: 1;
183+
white-space: normal;
184+
}
185+
186+
#connection-section #connection-toggle {
187+
flex-shrink: 0;
188+
}
189+
173190
.status-indicator-small {
174191
width: 8px;
175192
height: 8px;

‎MCPForUnity/Editor/Windows/MCPForUnityEditorWindow.uss‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
border-radius: 10px;
4848
border-width: 1px;
4949
border-color: rgba(80, 150, 220, 0.4);
50+
flex-shrink: 0;
51+
margin-left: 8px;
5052
}
5153

5254
/* Update Notification */
@@ -90,12 +92,13 @@
9092

9193
.tab-toolbar .unity-toolbar-button {
9294
flex-grow: 1;
95+
flex-shrink: 1;
9396
min-height: 32px;
9497
font-size: 12px;
9598
border-width: 0px;
9699
background-color: transparent;
97100
margin: 0px 2px 0px 0px;
98-
padding: 0px 12px;
101+
padding: 0px 8px;
99102
border-radius: 4px 4px 0px 0px;
100103
margin-bottom: -1px;
101104
}

‎MCPForUnity/Editor/Windows/MCPSetupWindow.cs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,19 @@ private void OnSkipClientsClicked()
180180
private void OnConfigureSelectedClicked()
181181
{
182182
int success = 0, failure = 0;
183-
var messages = new List<string>();
183+
var failures = new List<string>();
184184
foreach (var (c, toggle) in clientToggles)
185185
{
186186
if (!toggle.value) continue;
187187
try
188188
{
189189
MCPServiceLocator.Client.ConfigureClient(c);
190190
success++;
191-
messages.Add($"✓ {c.DisplayName}");
192191
}
193192
catch (System.Exception ex)
194193
{
195194
failure++;
196-
messages.Add($"⚠ {c.DisplayName}: {ex.Message}");
195+
failures.Add($"⚠ {c.DisplayName}: {ex.Message}");
197196
}
198197
}
199198
if (success == 0 && failure == 0)
@@ -204,12 +203,15 @@ private void OnConfigureSelectedClicked()
204203
"OK");
205204
return;
206205
}
206+
// Keep the summary short: a count, only the failures (if any), and the next step —
207+
// no need to enumerate every successfully-configured client.
208+
string failureList = failures.Count > 0 ? "\n\n" + string.Join("\n", failures) : "";
207209
string nextStep = (failure == 0 && success > 0)
208210
? "\n\nYou're all set. Ask your AI assistant to create a GameObject in the open scene to confirm the connection."
209211
: "";
210212
EditorUtility.DisplayDialog(
211213
"Client Configuration",
212-
$"{success} configured, {failure} failed.\n\n{string.Join("\n", messages)}{nextStep}",
214+
$"{success} configured, {failure} failed.{failureList}{nextStep}",
213215
"OK");
214216
Setup.SetupWindowService.MarkSetupCompleted();
215217
Close();

‎MCPForUnity/Editor/Windows/MCPSetupWindow.uss‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
flex-shrink: 0;
2121
}
2222

23+
/* In the header row the title reads as a plain heading beside the logo, not a boxed button. */
24+
.setup-header .title {
25+
margin-bottom: 0;
26+
padding: 0;
27+
background-color: rgba(0, 0, 0, 0);
28+
flex-shrink: 1;
29+
white-space: normal;
30+
}
31+
2332
/* Dependency list */
2433
#dependency-list {
2534
margin-top: 8px;
@@ -102,16 +111,30 @@
102111
margin-top: 0;
103112
}
104113

105-
/* Button container at bottom */
114+
/* Button container at bottom — wraps rather than clipping when the window is narrowed. */
106115
.button-container {
107116
flex-direction: row;
108117
align-items: center;
109118
justify-content: flex-end;
119+
flex-wrap: wrap;
110120
}
111121

112-
/* Button sizing */
122+
/* Button sizing — grow to fit the label (e.g. "Configure Selected") instead of clipping. */
113123
.setup-button {
114-
width: 96px;
124+
min-width: 96px;
125+
height: 28px;
126+
padding-left: 12px;
127+
padding-right: 12px;
128+
margin-left: 8px;
129+
margin-top: 4px;
130+
}
131+
132+
/* Footer buttons size to content and sit together on one row. The descendant selector
133+
(higher specificity) beats .secondary-button's width:100% regardless of stylesheet order,
134+
so Refresh no longer stretches full-width and overflows. */
135+
.button-container .setup-button {
136+
width: auto;
137+
flex-grow: 0;
115138
}
116139

117140
/* Description text spacing */

‎MCPForUnity/Editor/Windows/MCPSetupWindow.uxml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<!-- Action Buttons -->
5858
<ui:VisualElement class="button-container">
5959
<ui:Button name="refresh-button" text="Refresh" class="setup-button secondary-button" />
60-
<ui:Button name="done-button" text="Done" class="setup-button action-button" />
60+
<ui:Button name="done-button" text="Next" class="setup-button action-button" />
6161
</ui:VisualElement>
6262
</ui:VisualElement>
6363

0 commit comments

Comments
 (0)