fix: the frontend type-checks again

`check frontend build` has been red on every head for a day, through four review
rounds that each came back clean — none of the reviewers type-check, and they
say so in their own coverage sections. Ten errors:

The dev badge's `label` and `color` were typed `string | undefined`, but the
workspace rows carry `string | null`, so all seven of its call sites failed.
`forkAccentStyle` took the same widening.

A Svelte transition is called with the node it animates, and `stripArrive` and
`stripLeave` were declared with no parameters at all.

And `DevWorkspaceSetting` still imported `Badge` after its badge moved into the
shared component.

`svelte-check` now reports 0 errors. Note that it only agrees with CI once
`src/lib/gen` has been regenerated — the gitignored client goes stale against
main and invents errors CI never sees.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-10-07 03:22:15 -07:00
co-authored by Claude Opus 5
parent 7c97e01914
commit 48aadb0bcb
4 changed files with 8 additions and 7 deletions
@@ -16,10 +16,11 @@ before a colour could be picked.
import { twMerge } from 'tailwind-merge'
interface Props {
/** The workspace's `dev_workspace_label`; spelled the way `devBadgeText` spells it. */
label?: string | undefined
/** The workspace's `dev_workspace_label`; spelled the way `devBadgeText` spells it. Nullable
* because that is what the workspace rows carry. */
label?: string | null
/** The fork's own colour. Without one — or with an unparsable one — the badge falls back. */
color?: string | undefined
color?: string | null
/** The badge's colour when the fork has none of its own. */
fallbackColor?: BadgeColor
/** Extra classes for that same case, for a host that tuned the uncoloured badge. */
@@ -2,7 +2,7 @@
import { workspaceStore, userWorkspaces, usersWorkspaceStore, superadmin } from '$lib/stores'
import { WorkspaceService, type ProtectionRuleset } from '$lib/gen'
import DevWorkspaceBadge from '$lib/components/DevWorkspaceBadge.svelte'
import { Badge, Button } from '$lib/components/common'
import { Button } from '$lib/components/common'
import Select from '$lib/components/select/Select.svelte'
import Toggle from '$lib/components/Toggle.svelte'
import { sendUserToast } from '$lib/toast'
+1 -1
View File
@@ -120,7 +120,7 @@ function lightestAtContrast(
* fork chip consumes (see WorkspaceScopeTrigger). Returns undefined for an
* unparsable color, letting the chip fall back to the default accent.
*/
export function forkAccentStyle(color: string | undefined): string | undefined {
export function forkAccentStyle(color: string | null | undefined): string | undefined {
if (!color) return undefined
const parsed = hexToHsl(color)
if (!parsed) return undefined
@@ -473,12 +473,12 @@
/** The arriving strip fades in over the expansion; the leaving one goes quickly, so the two
* are never both legible at once — they stand in different places, and a slow dissolve would
* read as two tab rows rather than one changing place. */
function stripArrive() {
function stripArrive(_node: Element) {
return reducedMotion.val
? { duration: 0 }
: { duration: 180, delay: 60, easing: cubicOut, css: (t: number) => `opacity: ${t}` }
}
function stripLeave() {
function stripLeave(_node: Element) {
return reducedMotion.val
? { duration: 0 }
: { duration: 80, easing: cubicOut, css: (t: number) => `opacity: ${t}` }