Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ jobs:
- name: Lint
run: bun run lint

- name: Typecheck
run: bun run typecheck

- name: Build
run: bun run build
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build:dev": "vite build --mode development",
"generate:sitemap": "bun run scripts/generate-sitemap.ts",
"preview": "vite preview",
"typecheck": "tsc --noEmit",
"lint": "eslint .",
"test": "bun test",
"format": "prettier --write ."
Expand Down
4 changes: 2 additions & 2 deletions src/components/devtools/AppShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function useTablistKeyboard(tab: Tab, onTabChange: (tab: Tab) => void) {
const buttons = Array.from(
navRef.current?.querySelectorAll<HTMLButtonElement>('[role="tab"]') ?? [],
);
const current = buttons.findIndex((b) => b.dataset.tab === tab);
const current = buttons.findIndex((b) => b.dataset["tab"] === tab);
if (current === -1 || buttons.length === 0) return;
e.preventDefault();
let next: number;
Expand All @@ -37,7 +37,7 @@ function useTablistKeyboard(tab: Tab, onTabChange: (tab: Tab) => void) {
else next = (current - 1 + buttons.length) % buttons.length;
const target = buttons[next];
target?.focus();
const id = target?.dataset.tab as Tab | undefined;
const id = target?.dataset["tab"] as Tab | undefined;
if (id) onTabChange(id);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/devtools/LoopDiagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function PendingLane({ items, idle }: { items: QueueItem[]; idle: boolean }) {
<div className="flex flex-wrap items-center gap-1.5">
{items.map((item) => (
<span
key={item.key}
key={`p${item.id}`}
className="inline-flex max-w-full items-center rounded-sm border border-api bg-api/10 px-2 py-1 text-[11px] text-api"
>
<span className="min-w-0 truncate">{item.label}</span>
Expand Down
6 changes: 3 additions & 3 deletions src/components/devtools/PatternLibrary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export function PatternLibrary({
onConsumeFocusedPattern,
}: {
onRun: (code: string) => void;
focusedPattern?: string;
onConsumeFocusedPattern?: () => void;
focusedPattern?: string | undefined;
onConsumeFocusedPattern?: (() => void) | undefined;
}) {
const total = INTERVIEW_PATTERNS.length;

Expand Down Expand Up @@ -75,7 +75,7 @@ function PatternRow({
pattern: InterviewPattern;
onRun: (code: string) => void;
focused: boolean;
onConsumeFocus?: () => void;
onConsumeFocus?: (() => void) | undefined;
}) {
const [open, setOpen] = useState(false);

Expand Down
4 changes: 2 additions & 2 deletions src/components/devtools/SourcesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ export function SourcesView({
}: {
activeEra: string;
expandedConcept: string | null;
focusedPattern?: string;
onConsumeFocusedPattern?: () => void;
focusedPattern?: string | undefined;
onConsumeFocusedPattern?: (() => void) | undefined;
onSelectEra: (eraId: string) => void;
onToggleConcept: (conceptId: string | null) => void;
onRun: (code: string) => void;
Expand Down
4 changes: 2 additions & 2 deletions src/components/devtools/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function Timeline({
const buttons = Array.from(
railRef.current?.querySelectorAll<HTMLButtonElement>('[data-era]') ?? [],
);
const current = buttons.findIndex((b) => b.dataset.era === era.id);
const current = buttons.findIndex((b) => b.dataset["era"] === era.id);
if (current === -1 || buttons.length === 0) return;
e.preventDefault();
let next: number;
Expand All @@ -43,7 +43,7 @@ export function Timeline({
else if (e.key === "ArrowDown") next = (current + 1) % buttons.length;
else next = (current - 1 + buttons.length) % buttons.length;
const target = buttons[next];
const id = target?.dataset.era;
const id = target?.dataset["era"];
if (!id) return;
target.focus();
onSelectEra(id);
Expand Down
1 change: 1 addition & 0 deletions src/routes/__root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function NotFoundComponent() {
<div className="mt-6">
<Link
to="/"
search={{ tab: "timeline" }}
className="inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90"
>
Go home
Expand Down
7 changes: 4 additions & 3 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import { SITE_ORIGIN, SITE_TITLE, SITE_DESCRIPTION, websiteJsonLd } from "@/lib/
const Workbench = lazy(() => import("@/components/devtools/Workbench"));

export const Route = createFileRoute("/")({
validateSearch: (search: Record<string, unknown>): { tab: Tab; focusPattern?: string } => ({
tab: search.tab === "loop" || search.tab === "console" ? search.tab : "timeline",
focusPattern: typeof search.focusPattern === "string" ? search.focusPattern : undefined,
validateSearch: (search: Record<string, unknown>): { tab: Tab; focusPattern?: string | undefined } => ({
tab: search["tab"] === "loop" || search["tab"] === "console" ? search["tab"] : "timeline",
focusPattern:
typeof search["focusPattern"] === "string" ? search["focusPattern"] : undefined,
}),
head: () => ({
meta: [
Expand Down
Loading