fix(book): the designed book paces its bursts, lists and maps the way the design asks

A burst of four or more photos within a quarter of an hour becomes one grid,
no beat runs three times in a row, and an entry's pros and cons go into the
room under its words on the opener, the panorama or the quiet page, with a
note when they find none. A chapter map is the map of the chapter's trip, and
entries on no trip are named in the notes. The sorts compare by code unit, the
summary metrics and the page lookups exist once, and a flag or country mark
asked for by its own code is labelled with that country.
This commit is contained in:
Maurice
2026-10-23 01:45:16 +00:00
parent 7d736e1a34
commit 2becbd17bc
14 changed files with 603 additions and 149 deletions
@@ -13,7 +13,7 @@ import type { ToolArgs } from './cards/card-types';
import { readKey, recordOf } from './cards/card-values';
import { MikroORM } from '@mikro-orm/core';
import { Injectable } from '@nestjs/common';
import type { BookFinding } from '@trek/shared';
import { compareCodeUnits, type BookFinding } from '@trek/shared';
/**
* The check a Studio turn runs on every book write the model proposes, before
@@ -71,7 +71,7 @@ function pageOf(tool: string, args: ToolArgs): string {
const page = args.spreadId ?? args.afterSpreadId;
if (typeof page === 'string') return `${tool}:${page}`;
const ids = Array.isArray(args.spreadIds) ? args.spreadIds.filter((id): id is string => typeof id === 'string') : [];
return ids.length > 0 ? `${tool}:${[...ids].sort().join(',')}` : tool;
return ids.length > 0 ? `${tool}:${[...ids].sort(compareCodeUnits).join(',')}` : tool;
}
function reason(err: unknown): string {