Skip to content

Commit 8a3bc53

Browse files
authored
Make action header more horizontally dense (dyad-sh#1629)
<!-- CURSOR_SUMMARY --> > [!NOTE] > Make preview header buttons more horizontally dense by stacking label/badge under smaller icons and standardizing icon size. > > - **UI (ActionHeader)**: > - **Button layout**: > - Replace shared `BUTTON_CLASS_NAME` with inline classes to reduce padding, gap, and font size; use `flex-col` for stacked icon/label. > - Wrap label and badge in a single `span` for tighter vertical grouping. > - **Icons**: > - Introduce `iconSize = 15` and apply to `Eye`, `AlertTriangle`, `Code`, `Wrench`, `Globe` for consistent sizing. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9cfe3ba. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent f7132d0 commit 8a3bc53

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/components/preview_panel/ActionHeader.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ export type PreviewMode =
4141
| "configure"
4242
| "publish";
4343

44-
const BUTTON_CLASS_NAME =
45-
"no-app-region-drag cursor-pointer relative flex items-center gap-1 px-2 py-1 rounded-md text-[13px] font-medium z-10 hover:bg-[var(--background)]";
46-
4744
// Preview Header component with preview mode toggle
4845
export const ActionHeader = () => {
4946
const [previewMode, setPreviewMode] = useAtom(previewModeAtom);
@@ -177,12 +174,14 @@ export const ActionHeader = () => {
177174
<button
178175
data-testid={testId}
179176
ref={ref}
180-
className={BUTTON_CLASS_NAME}
177+
className="no-app-region-drag cursor-pointer relative flex items-center gap-0.5 px-2 py-0.5 rounded-md text-xs font-medium z-10 hover:bg-[var(--background)] flex-col"
181178
onClick={() => selectPanel(mode)}
182179
>
183180
{icon}
184-
{!isCompact && <span>{text}</span>}
185-
{badge}
181+
<span>
182+
{!isCompact && <span>{text}</span>}
183+
{badge}
184+
</span>
186185
</button>
187186
);
188187

@@ -199,6 +198,7 @@ export const ActionHeader = () => {
199198

200199
return buttonContent;
201200
};
201+
const iconSize = 15;
202202

203203
return (
204204
<TooltipProvider>
@@ -220,14 +220,14 @@ export const ActionHeader = () => {
220220
{renderButton(
221221
"preview",
222222
previewRef,
223-
<Eye size={14} />,
223+
<Eye size={iconSize} />,
224224
"Preview",
225225
"preview-mode-button",
226226
)}
227227
{renderButton(
228228
"problems",
229229
problemsRef,
230-
<AlertTriangle size={14} />,
230+
<AlertTriangle size={iconSize} />,
231231
"Problems",
232232
"problems-mode-button",
233233
displayCount && (
@@ -239,21 +239,21 @@ export const ActionHeader = () => {
239239
{renderButton(
240240
"code",
241241
codeRef,
242-
<Code size={14} />,
242+
<Code size={iconSize} />,
243243
"Code",
244244
"code-mode-button",
245245
)}
246246
{renderButton(
247247
"configure",
248248
configureRef,
249-
<Wrench size={14} />,
249+
<Wrench size={iconSize} />,
250250
"Configure",
251251
"configure-mode-button",
252252
)}
253253
{renderButton(
254254
"publish",
255255
publishRef,
256-
<Globe size={14} />,
256+
<Globe size={iconSize} />,
257257
"Publish",
258258
"publish-mode-button",
259259
)}

0 commit comments

Comments
 (0)