feat(app): collapse workspace header button labels on narrow rows

Measure the header row width and hide text labels on the Open,
Scripts, and git action split buttons below 700px so the header
fits without wrapping on split-pane layouts.
This commit is contained in:
Mohamed Boudra
2026-04-19 14:26:51 +07:00
parent cfa3b009e3
commit 43bbf8cb12
8 changed files with 84 additions and 15 deletions
@@ -41,12 +41,14 @@ interface WorkspaceScriptsButtonProps {
serverId: string;
workspaceId: string;
scripts: WorkspaceDescriptor["scripts"];
hideLabels?: boolean;
}
export function WorkspaceScriptsButton({
serverId,
workspaceId,
scripts,
hideLabels,
}: WorkspaceScriptsButtonProps): ReactElement | null {
const { theme } = useUnistyles();
const toast = useToast();
@@ -98,7 +100,7 @@ export function WorkspaceScriptsButton({
}
fill="transparent"
/>
<Text style={styles.splitButtonText}>Scripts</Text>
{!hideLabels && <Text style={styles.splitButtonText}>Scripts</Text>}
<ChevronDown size={14} color={theme.colors.foregroundMuted} />
</View>
</DropdownMenuTrigger>
@@ -268,6 +270,11 @@ const styles = StyleSheet.create((theme) => ({
paddingVertical: theme.spacing[1],
justifyContent: "center",
},
splitButtonPrimaryIconOnly: {
paddingHorizontal: theme.spacing[2],
paddingVertical: theme.spacing[1],
justifyContent: "center",
},
splitButtonPrimaryHovered: {
backgroundColor: theme.colors.surface2,
},