fix: make nightdrive signage reliable and legible

This commit is contained in:
2026-09-03 17:07:00 +03:00
parent 4404c07f93
commit b075041918
50 changed files with 4435 additions and 200 deletions

View File

@@ -121,6 +121,8 @@ export function useJourneySections(
const sign = signController.sample({
now,
source: navigationState.value.source,
navigationEpoch: navigationState.value.epoch,
navigationDestinationId: navigationState.value.signDestinationId,
direction: driveSnapshot.direction,
acceleration: driveSnapshot.acceleration,
deltaY: driveSnapshot.scrollY - previousScrollY,

View File

@@ -33,7 +33,7 @@ const isEditableTarget = (target: EventTarget | null): boolean =>
export interface KeyboardNavigation {
state: Readonly<Ref<NavigationState>>;
onSectionLinkClick(event: MouseEvent): void;
onSectionLinkClick(event: MouseEvent, requestSign?: boolean): void;
notePassiveSection(id: SectionId): void;
}
@@ -44,6 +44,7 @@ export function useKeyboardNavigation(
epoch: 0,
source: "initial",
destinationId: null,
signDestinationId: null,
});
let controller: NavigationController | undefined;
let teardown = (): void => {};
@@ -60,7 +61,7 @@ export function useKeyboardNavigation(
else controller.restore(id, target);
};
const onSectionLinkClick = (event: MouseEvent): void => {
const onSectionLinkClick = (event: MouseEvent, requestSign = false): void => {
if (
event.defaultPrevented ||
event.button !== 0 ||
@@ -76,7 +77,7 @@ export function useKeyboardNavigation(
const validated = validateSectionAnchor(event.currentTarget, canonicalIds);
if (validated === null) return;
event.preventDefault();
controller.navigate(validated.id, validated.target);
controller.navigate(validated.id, validated.target, { requestSign });
};
onMounted(() => {