Skip to content

Commit c12c96c

Browse files
UI Fixes: Button Styling and Tab Navigation Improvements (#119)
* Fix server column alignment in installed scripts table - Add text-left class to server column td element - Add inline-block class to server name span element - Ensures server column content aligns with header like other columns * Fix UpdateableBadge overflow on smaller screens - Add flex-wrap and gap classes to badge containers in ScriptCard and ScriptCardList - Prevents badges from overflowing card boundaries on narrow screens - Maintains proper spacing with gap-1/gap-2 for wrapped elements - Improves responsive design for mobile and laptop screens * Enhance action buttons with blueish theme and hover animations - Update Edit, Update, Delete, Save, and Cancel buttons with color-coded themes - Edit: Blue theme (bg-blue-50, text-blue-700) - Update: Cyan theme (bg-cyan-50, text-cyan-700) - Delete: Red theme (bg-red-50, text-red-700) - Save: Green theme (bg-green-50, text-green-700) - Cancel: Gray theme (bg-gray-50, text-gray-700) - Add hover effects: scale-105, shadow-md, color transitions - Apply consistent styling to both table and mobile card views - Disabled buttons prevent scale animation and show proper cursor states * Tone down button colors for better dark theme compatibility - Replace bright flashbang colors with subtle dark theme variants - Use 900-level colors with 20% opacity for backgrounds - Use 300-level colors for text with 200-level on hover - Use 700-level colors with 50% opacity for borders - Maintain color coding but with much more subtle appearance - Better contrast and readability against dark backgrounds - No more flashbang effect! 😅 * Refactor button styling with semantic variants for uniform appearance - Add semantic button variants: edit, update, delete, save, cancel - Each variant has consistent dark theme colors and hover effects - Remove custom className overrides from all button instances - Centralize styling in Button component for maintainability - All action buttons now use semantic variants instead of custom classes - Much cleaner code and consistent styling across the application * Remove rounded bottom border from active tab - Add rounded-t-md rounded-b-none classes to active tab styling - Creates flat bottom edge that connects seamlessly with content below - Applied to all three tabs: Available Scripts, Downloaded Scripts, Installed Scripts - Maintains rounded top corners for visual appeal while removing bottom rounding * Apply flat bottom edge to tab hover states - Add hover:rounded-t-md hover:rounded-b-none to inactive tab hover states - Ensures consistent flat bottom edge on both active and hover states - Creates uniform visual behavior across all tab interactions - Maintains rounded top corners while removing bottom rounding on hover
1 parent 7a550bb commit c12c96c

File tree

6 files changed

+26
-20
lines changed

6 files changed

+26
-20
lines changed

src/app/_components/InstalledScriptsTab.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,9 @@ export function InstalledScriptsTab() {
816816
)
817817
)}
818818
</td>
819-
<td className="px-6 py-4 whitespace-nowrap">
819+
<td className="px-6 py-4 whitespace-nowrap text-left">
820820
<span
821-
className="text-sm px-3 py-1 rounded"
821+
className="text-sm px-3 py-1 rounded inline-block"
822822
style={{
823823
backgroundColor: script.server_color ?? 'transparent',
824824
color: script.server_color ? getContrastColor(script.server_color) : 'inherit'
@@ -842,14 +842,14 @@ export function InstalledScriptsTab() {
842842
<Button
843843
onClick={handleSaveEdit}
844844
disabled={updateScriptMutation.isPending}
845-
variant="default"
845+
variant="save"
846846
size="sm"
847847
>
848848
{updateScriptMutation.isPending ? 'Saving...' : 'Save'}
849849
</Button>
850850
<Button
851851
onClick={handleCancelEdit}
852-
variant="outline"
852+
variant="cancel"
853853
size="sm"
854854
>
855855
Cancel
@@ -859,23 +859,23 @@ export function InstalledScriptsTab() {
859859
<>
860860
<Button
861861
onClick={() => handleEditScript(script)}
862-
variant="default"
862+
variant="edit"
863863
size="sm"
864864
>
865865
Edit
866866
</Button>
867867
{script.container_id && (
868868
<Button
869869
onClick={() => handleUpdateScript(script)}
870-
variant="link"
870+
variant="update"
871871
size="sm"
872872
>
873873
Update
874874
</Button>
875875
)}
876876
<Button
877877
onClick={() => handleDeleteScript(Number(script.id))}
878-
variant="destructive"
878+
variant="delete"
879879
size="sm"
880880
disabled={deleteScriptMutation.isPending}
881881
>

src/app/_components/ScriptCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function ScriptCard({ script, onClick }: ScriptCardProps) {
4949
</h3>
5050
<div className="mt-2 space-y-2">
5151
{/* Type and Updateable status on first row */}
52-
<div className="flex items-center space-x-2">
52+
<div className="flex items-center space-x-2 flex-wrap gap-1">
5353
<TypeBadge type={script.type ?? 'unknown'} />
5454
{script.updateable && <UpdateableBadge />}
5555
</div>

src/app/_components/ScriptCardList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function ScriptCardList({ script, onClick }: ScriptCardListProps) {
7070
<h3 className="text-xl font-semibold text-foreground truncate mb-2">
7171
{script.name || 'Unnamed Script'}
7272
</h3>
73-
<div className="flex items-center space-x-3">
73+
<div className="flex items-center space-x-3 flex-wrap gap-2">
7474
<TypeBadge type={script.type ?? 'unknown'} />
7575
{script.updateable && <UpdateableBadge />}
7676
<div className="flex items-center space-x-1">

src/app/_components/ScriptInstallationCard.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ export function ScriptInstallationCard({
134134
<Button
135135
onClick={onSave}
136136
disabled={isUpdating}
137-
variant="default"
137+
variant="save"
138138
size="sm"
139139
className="flex-1 min-w-0"
140140
>
141141
{isUpdating ? 'Saving...' : 'Save'}
142142
</Button>
143143
<Button
144144
onClick={onCancel}
145-
variant="outline"
145+
variant="cancel"
146146
size="sm"
147147
className="flex-1 min-w-0"
148148
>
@@ -153,7 +153,7 @@ export function ScriptInstallationCard({
153153
<>
154154
<Button
155155
onClick={onEdit}
156-
variant="default"
156+
variant="edit"
157157
size="sm"
158158
className="flex-1 min-w-0"
159159
>
@@ -162,7 +162,7 @@ export function ScriptInstallationCard({
162162
{script.container_id && (
163163
<Button
164164
onClick={onUpdate}
165-
variant="link"
165+
variant="update"
166166
size="sm"
167167
className="flex-1 min-w-0"
168168
>
@@ -171,7 +171,7 @@ export function ScriptInstallationCard({
171171
)}
172172
<Button
173173
onClick={onDelete}
174-
variant="destructive"
174+
variant="delete"
175175
size="sm"
176176
disabled={isDeleting}
177177
className="flex-1 min-w-0"

src/app/_components/ui/button.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ const buttonVariants = cva(
3434
"relative after:absolute after:bg-primary after:bottom-2 after:h-[1px] after:w-2/3 after:origin-bottom-left after:scale-x-100 hover:after:origin-bottom-right hover:after:scale-x-0 after:transition-transform after:ease-in-out after:duration-300",
3535
linkHover2:
3636
"relative after:absolute after:bg-primary after:bottom-2 after:h-[1px] after:w-2/3 after:origin-bottom-right after:scale-x-0 hover:after:origin-bottom-left hover:after:scale-x-100 after:transition-transform after:ease-in-out after:duration-300",
37+
// Dark theme action button variants
38+
edit: "bg-blue-900/20 hover:bg-blue-900/30 border border-blue-700/50 text-blue-300 hover:text-blue-200 hover:border-blue-600/60 transition-all duration-200 hover:scale-105 hover:shadow-md",
39+
update: "bg-cyan-900/20 hover:bg-cyan-900/30 border border-cyan-700/50 text-cyan-300 hover:text-cyan-200 hover:border-cyan-600/60 transition-all duration-200 hover:scale-105 hover:shadow-md",
40+
delete: "bg-red-900/20 hover:bg-red-900/30 border border-red-700/50 text-red-300 hover:text-red-200 hover:border-red-600/60 transition-all duration-200 hover:scale-105 hover:shadow-md disabled:hover:scale-100",
41+
save: "bg-green-900/20 hover:bg-green-900/30 border border-green-700/50 text-green-300 hover:text-green-200 hover:border-green-600/60 transition-all duration-200 hover:scale-105 hover:shadow-md disabled:hover:scale-100",
42+
cancel: "bg-gray-800/20 hover:bg-gray-800/30 border border-gray-600/50 text-gray-300 hover:text-gray-200 hover:border-gray-500/60 transition-all duration-200 hover:scale-105 hover:shadow-md",
3743
},
3844
size: {
3945
default: "h-10 px-4 py-2",

src/app/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ export default function Home() {
106106
onClick={() => setActiveTab('scripts')}
107107
className={`px-3 py-2 text-sm flex items-center justify-center sm:justify-start gap-2 w-full sm:w-auto ${
108108
activeTab === 'scripts'
109-
? 'bg-accent text-accent-foreground'
110-
: 'hover:bg-accent hover:text-accent-foreground'
109+
? 'bg-accent text-accent-foreground rounded-t-md rounded-b-none'
110+
: 'hover:bg-accent hover:text-accent-foreground hover:rounded-t-md hover:rounded-b-none'
111111
}`}>
112112
<Package className="h-4 w-4" />
113113
<span className="hidden sm:inline">Available Scripts</span>
@@ -122,8 +122,8 @@ export default function Home() {
122122
onClick={() => setActiveTab('downloaded')}
123123
className={`px-3 py-2 text-sm flex items-center justify-center sm:justify-start gap-2 w-full sm:w-auto ${
124124
activeTab === 'downloaded'
125-
? 'bg-accent text-accent-foreground'
126-
: 'hover:bg-accent hover:text-accent-foreground'
125+
? 'bg-accent text-accent-foreground rounded-t-md rounded-b-none'
126+
: 'hover:bg-accent hover:text-accent-foreground hover:rounded-t-md hover:rounded-b-none'
127127
}`}>
128128
<HardDrive className="h-4 w-4" />
129129
<span className="hidden sm:inline">Downloaded Scripts</span>
@@ -138,8 +138,8 @@ export default function Home() {
138138
onClick={() => setActiveTab('installed')}
139139
className={`px-3 py-2 text-sm flex items-center justify-center sm:justify-start gap-2 w-full sm:w-auto ${
140140
activeTab === 'installed'
141-
? 'bg-accent text-accent-foreground'
142-
: 'hover:bg-accent hover:text-accent-foreground'
141+
? 'bg-accent text-accent-foreground rounded-t-md rounded-b-none'
142+
: 'hover:bg-accent hover:text-accent-foreground hover:rounded-t-md hover:rounded-b-none'
143143
}`}>
144144
<FolderOpen className="h-4 w-4" />
145145
<span className="hidden sm:inline">Installed Scripts</span>

0 commit comments

Comments
 (0)