Make action header more horizontally dense (#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 9cfe3ba52b79c9176289d077ffcbaf57b1613f44. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This commit is contained in:
@@ -41,9 +41,6 @@ export type PreviewMode =
|
|||||||
| "configure"
|
| "configure"
|
||||||
| "publish";
|
| "publish";
|
||||||
|
|
||||||
const BUTTON_CLASS_NAME =
|
|
||||||
"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)]";
|
|
||||||
|
|
||||||
// Preview Header component with preview mode toggle
|
// Preview Header component with preview mode toggle
|
||||||
export const ActionHeader = () => {
|
export const ActionHeader = () => {
|
||||||
const [previewMode, setPreviewMode] = useAtom(previewModeAtom);
|
const [previewMode, setPreviewMode] = useAtom(previewModeAtom);
|
||||||
@@ -177,12 +174,14 @@ export const ActionHeader = () => {
|
|||||||
<button
|
<button
|
||||||
data-testid={testId}
|
data-testid={testId}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={BUTTON_CLASS_NAME}
|
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"
|
||||||
onClick={() => selectPanel(mode)}
|
onClick={() => selectPanel(mode)}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
|
<span>
|
||||||
{!isCompact && <span>{text}</span>}
|
{!isCompact && <span>{text}</span>}
|
||||||
{badge}
|
{badge}
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -199,6 +198,7 @@ export const ActionHeader = () => {
|
|||||||
|
|
||||||
return buttonContent;
|
return buttonContent;
|
||||||
};
|
};
|
||||||
|
const iconSize = 15;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
@@ -220,14 +220,14 @@ export const ActionHeader = () => {
|
|||||||
{renderButton(
|
{renderButton(
|
||||||
"preview",
|
"preview",
|
||||||
previewRef,
|
previewRef,
|
||||||
<Eye size={14} />,
|
<Eye size={iconSize} />,
|
||||||
"Preview",
|
"Preview",
|
||||||
"preview-mode-button",
|
"preview-mode-button",
|
||||||
)}
|
)}
|
||||||
{renderButton(
|
{renderButton(
|
||||||
"problems",
|
"problems",
|
||||||
problemsRef,
|
problemsRef,
|
||||||
<AlertTriangle size={14} />,
|
<AlertTriangle size={iconSize} />,
|
||||||
"Problems",
|
"Problems",
|
||||||
"problems-mode-button",
|
"problems-mode-button",
|
||||||
displayCount && (
|
displayCount && (
|
||||||
@@ -239,21 +239,21 @@ export const ActionHeader = () => {
|
|||||||
{renderButton(
|
{renderButton(
|
||||||
"code",
|
"code",
|
||||||
codeRef,
|
codeRef,
|
||||||
<Code size={14} />,
|
<Code size={iconSize} />,
|
||||||
"Code",
|
"Code",
|
||||||
"code-mode-button",
|
"code-mode-button",
|
||||||
)}
|
)}
|
||||||
{renderButton(
|
{renderButton(
|
||||||
"configure",
|
"configure",
|
||||||
configureRef,
|
configureRef,
|
||||||
<Wrench size={14} />,
|
<Wrench size={iconSize} />,
|
||||||
"Configure",
|
"Configure",
|
||||||
"configure-mode-button",
|
"configure-mode-button",
|
||||||
)}
|
)}
|
||||||
{renderButton(
|
{renderButton(
|
||||||
"publish",
|
"publish",
|
||||||
publishRef,
|
publishRef,
|
||||||
<Globe size={14} />,
|
<Globe size={iconSize} />,
|
||||||
"Publish",
|
"Publish",
|
||||||
"publish-mode-button",
|
"publish-mode-button",
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user