Skip to content

Commit 89a1278

Browse files
committed
lil oopsies
1 parent 9543085 commit 89a1278

16 files changed

Lines changed: 108 additions & 51 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changelog
2-
## v2.6 - Launch Reliability
2+
## v2.6.0 - Launch Reliability
33

44
### Game launching
55

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unioncrax-direct",
3-
"version": "2.6.BETA",
3+
"version": "2.6.0",
44
"description": "UC.D",
55
"type": "module",
66
"main": "electron/main.cjs",

renderer/src/app/pages/LauncherPage.tsx

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,8 +1247,12 @@ function StatsRow({
12471247
<span className="whitespace-nowrap text-xs text-muted-foreground/80 font-medium">Updated (7d)</span>
12481248
</div>
12491249
<div className="w-px h-4 bg-white/[.07] hidden sm:block" />
1250-
<Link
1251-
to="/settings?section=leaderboard"
1250+
<a
1251+
href="https://union-crax.xyz/leaderboard"
1252+
onClick={(e) => {
1253+
e.preventDefault();
1254+
(window as any).ucSystem?.openExternal?.("https://union-crax.xyz/leaderboard");
1255+
}}
12521256
className="group flex shrink-0 items-center gap-2 whitespace-nowrap"
12531257
title="UC.Direct users online right now — open the leaderboard"
12541258
>
@@ -1260,10 +1264,14 @@ function StatsRow({
12601264
<AnimatedCounter value={usersOnline} format={formatNumber} />
12611265
</span>
12621266
<span className="text-xs text-muted-foreground/80 group-hover:text-muted-foreground transition-colors font-medium">Now online</span>
1263-
</Link>
1267+
</a>
12641268
<div className="w-px h-4 bg-white/[.07] hidden sm:block" />
1265-
<Link
1266-
to="/settings?section=leaderboard"
1269+
<a
1270+
href="https://union-crax.xyz/leaderboard"
1271+
onClick={(e) => {
1272+
e.preventDefault();
1273+
(window as any).ucSystem?.openExternal?.("https://union-crax.xyz/leaderboard");
1274+
}}
12671275
className="group flex shrink-0 items-center gap-2 whitespace-nowrap"
12681276
title="People in a running game right now — open the leaderboard"
12691277
>
@@ -1275,18 +1283,22 @@ function StatsRow({
12751283
<AnimatedCounter value={playersNow} format={formatNumber} />
12761284
</span>
12771285
<span className="text-xs text-muted-foreground/80 group-hover:text-muted-foreground transition-colors font-medium">Now playing</span>
1278-
</Link>
1286+
</a>
12791287
<div className="w-px h-4 bg-white/[.07] hidden sm:block" />
1280-
<Link
1281-
to="/settings?section=leaderboard"
1288+
<a
1289+
href="https://union-crax.xyz/leaderboard"
1290+
onClick={(e) => {
1291+
e.preventDefault();
1292+
(window as any).ucSystem?.openExternal?.("https://union-crax.xyz/leaderboard");
1293+
}}
12821294
className="group flex shrink-0 items-center gap-2 whitespace-nowrap"
12831295
title="All-time playtime tracked by UC.Direct — open the leaderboard"
12841296
>
12851297
<span className="text-sm font-semibold text-amber-400 group-hover:text-amber-300 transition-colors">
12861298
{formatPlaytimeCompact(totalPlaytimeSeconds)}
12871299
</span>
12881300
<span className="text-xs text-muted-foreground/80 group-hover:text-muted-foreground transition-colors font-medium">Total playtime</span>
1289-
</Link>
1301+
</a>
12901302
<div className="flex shrink-0 items-center gap-1 whitespace-nowrap" title="These stats are tracked by UC.Direct">
12911303
<span className="text-xs text-muted-foreground/60 font-medium italic">Tracked by</span>
12921304
<span className="text-xs font-semibold text-violet-400">UC.Direct</span>

renderer/src/components/GameExperience.tsx

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export function GameExperience({
171171
const [notes, setNotes] = useState("")
172172
const [submitting, setSubmitting] = useState(false)
173173
const [submitted, setSubmitted] = useState(false)
174+
const [hasRated, setHasRated] = useState(false)
174175
const [submitError, setSubmitError] = useState<string | null>(null)
175176
const { user, loading: authLoading } = useDiscordAccount()
176177

@@ -183,6 +184,20 @@ export function GameExperience({
183184
if (j?.success) {
184185
setExperiences(j.experiences || [])
185186
if (j.stats) setStats(j.stats as Stats)
187+
if (j.myRating) {
188+
setHasRated(true)
189+
setRating(j.myRating.rating)
190+
const d = (j.myRating.distro || "").toLowerCase()
191+
if (d === "windows") {
192+
setPlatform("windows")
193+
setDistro("")
194+
} else {
195+
setPlatform("linux")
196+
setDistro(j.myRating.distro || "")
197+
}
198+
setProtonVersion(j.myRating.proton_version || "")
199+
setNotes(j.myRating.notes || "")
200+
}
186201
}
187202
})
188203
.catch(() => { })
@@ -233,11 +248,14 @@ export function GameExperience({
233248
if (!res.ok || !json.success) {
234249
setSubmitError(json.error || "Failed to submit. Please try again.")
235250
} else {
251+
if (json.updated) setHasRated(true)
236252
setSubmitted(true)
237-
setDistro("")
238-
setProtonVersion("")
239-
setRating(null)
240-
setNotes("")
253+
if (!json.updated && !hasRated) {
254+
setDistro("")
255+
setProtonVersion("")
256+
setRating(null)
257+
setNotes("")
258+
}
241259
fetchExperiences()
242260
}
243261
} catch {
@@ -318,7 +336,7 @@ export function GameExperience({
318336
<div className="flex items-start gap-3 p-4 rounded-xl bg-emerald-500/10 border border-emerald-500/20">
319337
<CheckCircle2 className="h-5 w-5 text-emerald-500 mt-0.5 shrink-0" />
320338
<div className="flex-1">
321-
<div className="text-sm font-semibold text-emerald-500">Thanks for the rating!</div>
339+
<div className="text-sm font-semibold text-emerald-500">{hasRated ? "Thanks for updating your rating!" : "Thanks for the rating!"}</div>
322340
<div className="text-xs text-muted-foreground mt-1">Your report is now part of the average above.</div>
323341
<div className="flex flex-wrap items-center gap-3 mt-3">
324342
{onLeaveComment && (
@@ -327,13 +345,15 @@ export function GameExperience({
327345
Leave a detailed comment
328346
</Button>
329347
)}
330-
<button onClick={() => setSubmitted(false)} className="text-xs text-muted-foreground underline hover:text-foreground">Rate again</button>
348+
<button onClick={() => setSubmitted(false)} className="text-xs text-muted-foreground underline hover:text-foreground">
349+
{hasRated ? "Edit rating" : "Rate again"}
350+
</button>
331351
</div>
332352
</div>
333353
</div>
334354
) : (
335355
<div className="space-y-4">
336-
<div className="text-sm font-semibold text-foreground">How is it running for you?</div>
356+
<div className="text-sm font-semibold text-foreground">{hasRated ? "Update your rating" : "How is it running for you?"}</div>
337357

338358
<div className="space-y-1.5">
339359
<StarRating value={rating} onChange={setRating} />
@@ -436,7 +456,7 @@ export function GameExperience({
436456
className="gap-2"
437457
>
438458
{submitting ? <Loader2 className="h-4 w-4 animate-spin" /> : <Send className="h-4 w-4" />}
439-
{submitting ? "Submitting…" : "Submit rating"}
459+
{submitting ? "Submitting…" : hasRated ? "Update rating" : "Submit rating"}
440460
</Button>
441461
</div>
442462
)}

renderer/src/components/home/TopPlayerOfTheWeekSection.tsx

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,28 @@ export function TopPlayerOfTheWeekSection() {
8484
</span>
8585
</div>
8686
<Button asChild variant="ghost" size="sm" className="rounded-full text-xs">
87-
<Link to="/settings?section=leaderboard">
87+
<a
88+
href="https://union-crax.xyz/leaderboard"
89+
onClick={(e) => {
90+
e.preventDefault();
91+
(window as any).ucSystem?.openExternal?.("https://union-crax.xyz/leaderboard");
92+
}}
93+
>
8894
View full leaderboard
8995
<ArrowUpRight className="ml-1 h-3.5 w-3.5" />
90-
</Link>
96+
</a>
9197
</Button>
9298
</div>
9399

94100
<Card className="rounded-3xl border border-amber-400/15 bg-gradient-to-br from-amber-500/5 via-card/60 to-card/40 backdrop-blur-md">
95101
<CardContent className="p-6 sm:p-8">
96102
<div className="flex flex-col gap-6 sm:flex-row sm:items-center sm:justify-between">
97-
<Link
98-
to={`/settings?section=profile&user=${entry.username}`}
103+
<a
104+
href={`https://union-crax.xyz/user/${entry.username}`}
105+
onClick={(e) => {
106+
e.preventDefault();
107+
(window as any).ucSystem?.openExternal?.(`https://union-crax.xyz/user/${entry.username}`);
108+
}}
99109
className="group flex items-center gap-4"
100110
>
101111
<div className="relative">
@@ -135,16 +145,20 @@ export function TopPlayerOfTheWeekSection() {
135145
</div>
136146
) : null}
137147
</div>
138-
</Link>
148+
</a>
139149

140150
{runnersUp.length > 0 ? (
141151
<div className="flex flex-wrap items-center gap-2 sm:flex-nowrap sm:justify-end">
142152
{runnersUp.map((runner) => {
143153
const runnerName = runner.displayName || runner.username
144154
return (
145-
<Link
155+
<a
146156
key={runner.userId}
147-
to={`/settings?section=profile&user=${runner.username}`}
157+
href={`https://union-crax.xyz/user/${runner.username}`}
158+
onClick={(e) => {
159+
e.preventDefault();
160+
(window as any).ucSystem?.openExternal?.(`https://union-crax.xyz/user/${runner.username}`);
161+
}}
148162
className="flex items-center gap-2 rounded-full border border-white/[.07] bg-card/60 px-3 py-1.5 text-xs transition-colors hover:bg-secondary/70"
149163
title={`${runnerName} · ${formatPlaytime(runner.weekSeconds)}`}
150164
>
@@ -163,7 +177,7 @@ export function TopPlayerOfTheWeekSection() {
163177
<span className="hidden sm:inline text-foreground/80">{runnerName}</span>
164178
{runner.ucPlus ? <UcPlusBadge compact /> : null}
165179
<span className="text-muted-foreground/80">{formatPlaytime(runner.weekSeconds)}</span>
166-
</Link>
180+
</a>
167181
)
168182
})}
169183
</div>

renderer/src/components/ui/badge.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import { cva, type VariantProps } from "class-variance-authority"
55
import { cn } from "@/lib/utils"
66

77
const badgeVariants = cva(
8-
"inline-flex items-center justify-center rounded-full border px-2.5 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none transition-colors overflow-hidden",
8+
"inline-flex items-center justify-center rounded-full border px-2.5 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-0 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
99
{
1010
variants: {
1111
variant: {
1212
default:
13-
"border-transparent bg-primary text-primary-foreground",
13+
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
1414
secondary:
15-
"border-transparent bg-secondary text-foreground/80",
15+
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
1616
online:
17-
"bg-black/60 text-white border border-white/10",
17+
"bg-black/60 text-white border border-border/50 shadow-md",
1818
destructive:
19-
"bg-red-500/10 text-red-400 border border-red-500/20",
19+
"border-transparent bg-destructive/60 text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/40",
2020
outline:
21-
"border-white/20 text-foreground/80",
21+
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
2222
},
2323
},
2424
defaultVariants: {

renderer/src/components/ui/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Card({ className, ...props }: React.ComponentProps<"div">) {
77
<div
88
data-slot="card"
99
className={cn(
10-
"bg-card text-foreground flex flex-col gap-6 rounded-2xl border border-white/[.07] py-6 shadow-sm",
10+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
1111
className
1212
)}
1313
{...props}

renderer/src/components/ui/checkbox.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ import { Check as CheckIcon } from "@/components/icons"
44

55
import { cn } from '../../lib/utils'
66

7-
function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
7+
function Checkbox({
8+
className,
9+
...props
10+
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
811
return (
912
<CheckboxPrimitive.Root
1013
data-slot="checkbox"
1114
className={cn(
12-
'peer size-4 shrink-0 rounded-[4px] border border-white/[.15] bg-card transition-colors outline-none',
13-
'data-[state=checked]:bg-primary data-[state=checked]:border-white data-[state=checked]:text-black',
14-
'focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:border-white/40',
15-
'disabled:cursor-not-allowed disabled:opacity-30',
16-
'active:scale-95',
15+
"peer border-input bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
1716
className
1817
)}
1918
{...props}

renderer/src/components/ui/input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
1010
type={type}
1111
data-slot="input"
1212
className={cn(
13-
"file:text-foreground/90 placeholder:text-muted-foreground/60 selection:bg-white/20 selection:text-white border-border flex h-9 w-full min-w-0 rounded-2xl border bg-card px-4 py-1 text-sm text-foreground/90 transition-colors outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-30",
14-
"focus-visible:border-white",
15-
"aria-invalid:border-red-500/60",
13+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground bg-card border-border flex h-9 w-full min-w-0 rounded-2xl border px-4 py-2 text-base shadow-xs transition-colors outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
14+
"focus-visible:border-ring focus-visible:ring-0",
15+
"aria-invalid:border-destructive",
1616
className
1717
)}
1818
{...props}

renderer/src/components/ui/select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function SelectTrigger({
3838
data-slot="select-trigger"
3939
data-size={size}
4040
className={cn(
41-
"bg-card border border-border text-foreground/90 data-[placeholder]:text-muted-foreground/60 [&_svg:not([class*='text-'])]:text-muted-foreground/80 flex w-fit items-center justify-between gap-2 rounded-2xl px-3 py-2 text-sm whitespace-nowrap transition-colors outline-none focus-visible:border-white disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
41+
"flex w-fit items-center justify-between gap-2 rounded-full border border-white/[.07] bg-background/70 px-3 py-2 text-sm text-foreground/90 whitespace-nowrap backdrop-blur-md transition-[color,box-shadow,border-color,background-color] outline-none hover:bg-white/[.03] focus-visible:border-white/20 focus-visible:ring-[3px] focus-visible:ring-white/10 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground/80 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground/80 aria-invalid:border-red-500/60",
4242
className
4343
)}
4444
{...props}

0 commit comments

Comments
 (0)