Skip to content

Commit 4db3310

Browse files
committed
Fixes
1 parent 671339c commit 4db3310

25 files changed

Lines changed: 239 additions & 50 deletions

scripts/generate-lastmod.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function extractLastModified(repoDir: string): Promise<Record<string, string>> {
2727
});
2828

2929
let currentDate = "";
30+
let exitCode: number | null = null;
3031
const rl = createInterface({ input: proc.stdout });
3132

3233
rl.on("line", (line) => {
@@ -38,10 +39,13 @@ function extractLastModified(repoDir: string): Promise<Record<string, string>> {
3839
}
3940
});
4041

41-
rl.on("close", () => resolve(map));
4242
proc.on("error", reject);
4343
proc.on("close", (code) => {
44-
if (code !== 0) reject(new Error(`git log exited ${code}`));
44+
exitCode = code;
45+
});
46+
rl.on("close", () => {
47+
if (exitCode !== 0) reject(new Error(`git log exited ${exitCode}`));
48+
else resolve(map);
4549
});
4650
});
4751
}

src/components/Link.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { forwardRef, type ComponentProps } from "react";
22
import { Link as RouterLink, NavLink as RouterNavLink } from "react-router";
33

44
export const Link = forwardRef<HTMLAnchorElement, ComponentProps<typeof RouterLink>>(
5-
(props, ref) => <RouterLink discover="none" {...props} ref={ref} />,
5+
(props, ref) => <RouterLink {...props} discover="none" ref={ref} />,
66
);
77

88
export const NavLink = forwardRef<HTMLAnchorElement, ComponentProps<typeof RouterNavLink>>(
9-
(props, ref) => <RouterNavLink discover="none" {...props} ref={ref} />,
9+
(props, ref) => <RouterNavLink {...props} discover="none" ref={ref} />,
1010
);

src/components/Lists.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ interface Props<T> {
88

99
export function LazyList<T>({ data, render }: Props<T>) {
1010
const parentRef = useRef<HTMLDivElement>(null);
11-
const parentOffsetRef = useRef(0);
11+
const [parentOffset, setParentOffset] = React.useState(0);
1212

1313
const virtualizer = useWindowVirtualizer({
1414
count: data.length,
1515
estimateSize: () => 80,
1616
overscan: 2,
17-
scrollMargin: parentOffsetRef.current,
17+
scrollMargin: parentOffset,
1818
});
1919

2020
// Capture offset once on mount
2121
React.useLayoutEffect(() => {
2222
if (parentRef.current) {
23-
parentOffsetRef.current = parentRef.current.getBoundingClientRect().top + window.scrollY;
23+
setParentOffset(parentRef.current.getBoundingClientRect().top + window.scrollY);
2424
}
2525
}, []);
2626

@@ -46,7 +46,7 @@ export function LazyList<T>({ data, render }: Props<T>) {
4646
top: 0,
4747
left: 0,
4848
width: "100%",
49-
transform: `translateY(${virtualRow.start - parentOffsetRef.current}px)`,
49+
transform: `translateY(${virtualRow.start - parentOffset}px)`,
5050
}}
5151
>
5252
{render(data[virtualRow.index])}

src/components/kind-icon/metadataIconMap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { IconKind } from "./KindIcon";
22

3-
export const metadataIconMap: Record<string, IconKind> = {
3+
export const metadataIconMap: Partial<Record<string, IconKind>> = {
44
MPropertyFriendlyName: "meta-tag",
55
MPropertyDescription: "meta-note",
66
MNetworkEnable: "meta-broadcast",

src/components/layout/NavBar.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function GameSwitcher({ currentGame }: { currentGame: GameId }) {
7575
onClick={() => setOpen(!open)}
7676
title={currentGameInfo?.name}
7777
aria-expanded={open}
78-
aria-haspopup="menu"
78+
aria-haspopup="listbox"
7979
>
8080
<SwitcherChevron
8181
viewBox="0 0 24 24"
@@ -98,11 +98,12 @@ export function GameSwitcher({ currentGame }: { currentGame: GameId }) {
9898
</SwitcherIcon>
9999
</SwitcherToggle>
100100
{open && (
101-
<SwitcherDropdown role="menu" aria-label="Select game">
101+
<SwitcherDropdown role="listbox" aria-label="Select game">
102102
{GAME_LIST.map((g) => (
103103
<SwitcherOption
104104
key={g.id}
105-
role="menuitem"
105+
role="option"
106+
aria-selected={g.id === currentGame}
106107
onClick={() => switchTo(g.id)}
107108
data-active={g.id === currentGame || undefined}
108109
>
@@ -277,7 +278,7 @@ const ToggleThumb = styled.span`
277278
background-color 0.2s;
278279
279280
[data-theme="dark"] & {
280-
left: 22px;
281+
left: 24px;
281282
background-color: #7a7f88;
282283
}
283284
`;

src/components/layout/Sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const SidebarLink = styled(NavLink)`
4444
}
4545
`;
4646

47-
export const SidebarElement: React.FC<{
47+
const SidebarElement: React.FC<{
4848
to: string;
4949
icon: IconKind;
5050
text: string;
@@ -94,7 +94,7 @@ export const SidebarGroupHeader = styled.button`
9494
gap: 4px;
9595
overflow: hidden;
9696
white-space: nowrap;
97-
text-overflow: ellipsis;
97+
min-width: 0;
9898
transition: color 0.1s;
9999
100100
&:hover {

src/components/schema/ColoredSyntax.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22

3-
export type ColoredSyntaxKind = "literal" | "interface" | "container" | "atomic";
3+
type ColoredSyntaxKind = "literal" | "interface" | "container" | "atomic";
44

55
const syntaxStyles: Record<ColoredSyntaxKind, React.CSSProperties> = {
66
literal: { color: "var(--syntax-literal)" },

src/components/schema/CrossGameRefs.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ type DiffStatus = "identical" | "offsets_only" | "differs";
1616

1717
const GameLink = styled(SectionLink)`
1818
&[data-status="offsets_only"] {
19-
border-color: #5b8ab5;
19+
border-color: var(--cross-game-offsets);
2020
}
2121
2222
&[data-status="differs"] {
23-
border-color: #c97a1e;
23+
border-color: var(--cross-game-differs);
2424
}
2525
`;
2626

@@ -81,6 +81,7 @@ function compareClasses(a: SchemaClass, b: SchemaClass): DiffStatus {
8181
if (a.fields[i].name !== b.fields[i].name) return "differs";
8282
if (!typesEqual(a.fields[i].type, b.fields[i].type)) return "differs";
8383
if (!metadataEqual(a.fields[i].metadata, b.fields[i].metadata)) return "differs";
84+
if (a.fields[i].defaultValue !== b.fields[i].defaultValue) return "differs";
8485
if (a.fields[i].offset !== b.fields[i].offset) offsetsDiffer = true;
8586
}
8687
if (!metadataEqual(a.metadata, b.metadata)) return "differs";

src/components/schema/DeclarationsContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { href } from "react-router";
33
import { Declaration, SchemaClass } from "../../data/types";
44
import { SchemaMetadata } from "../../data/schemas";
55
import { DEFAULT_GAME, GameId } from "../../games-list";
6+
export { declarationKey } from "../../data/derived";
67
import type { ReferenceEntry } from "../../data/derived";
7-
export { declarationKey, type ReferenceEntry } from "../../data/derived";
88

99
export function schemaPath(game: string, module?: string, scope?: string): string {
1010
return href("/:game?/:module?/:scope?", { game, module, scope });

src/components/schema/SchemaClass.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ const BitRange = styled.span`
310310
font-variant-numeric: tabular-nums;
311311
`;
312312

313-
const BitfieldPadding = styled.div`
313+
const BitfieldPadding = styled.li`
314314
padding: 3px 10px;
315315
font-size: 13px;
316316
color: var(--text-dim);

0 commit comments

Comments
 (0)