fix: improve settings dialog UX with stable button width and smart scrollbar

Fix two UX issues in the settings dialog:

1. Check for Updates button width stability
   - Added min-w-[140px] to prevent layout shift during state changes
   - Button maintains consistent width across all states:
     * "Check for Updates" (idle)
     * "Checking..." (with spinner)
     * "Update to vX.X.X" (with download icon)
     * "Installing..." (with spinner)

2. Settings dialog scrollbar behavior
   - Changed overflow-y-scroll to overflow-y-auto
   - Scrollbar now only appears when content actually overflows
   - Prevents unnecessary scrollbar on About tab (content < 400px)
   - Maintains min-h-[400px] on all tabs to prevent dialog height jump

These changes improve visual stability and reduce UI clutter while
maintaining consistent dialog dimensions during tab switching.
This commit is contained in:
Jason
2025-10-18 16:26:37 +08:00
parent 320bf3eeac
commit 404297cd30
2 changed files with 2 additions and 1 deletions

View File

@@ -185,6 +185,7 @@ export function AboutSection({ isPortable }: AboutSectionProps) {
size="sm"
onClick={handleCheckUpdate}
disabled={isChecking || isDownloading}
className="min-w-[140px]"
>
{isDownloading ? (
<span className="inline-flex items-center gap-2">

View File

@@ -179,7 +179,7 @@ export function SettingsDialog({
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
</div>
) : (
<div className="flex-1 overflow-y-scroll px-6 py-4">
<div className="flex-1 overflow-y-auto px-6 py-4">
<Tabs
value={activeTab}
onValueChange={setActiveTab}