Add PF2e attack effects, ability frequency, and perception details

Show inline on-hit effects on attack lines (e.g., "plus Grab"), frequency
limits on abilities (e.g., "(1/day)"), and perception details text alongside
senses. Strip redundant frequency lines from Foundry descriptions.

Also add resilient PF2e source fetching: batched requests with retry,
graceful handling of ad-blocker-blocked creature files (partial success
with toast warning and re-fetch prompt for missing creatures).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-04-10 23:37:03 +02:00
parent 1eaeecad32
commit c3707cf0b6
16 changed files with 488 additions and 55 deletions

View File

@@ -8,7 +8,7 @@ import { Input } from "./ui/input.js";
interface SourceFetchPromptProps {
sourceCode: string;
onSourceLoaded: () => void;
onSourceLoaded: (skippedNames: string[]) => void;
}
export function SourceFetchPrompt({
@@ -32,8 +32,9 @@ export function SourceFetchPrompt({
setStatus("fetching");
setError("");
try {
await fetchAndCacheSource(sourceCode, url);
onSourceLoaded();
const { skippedNames } = await fetchAndCacheSource(sourceCode, url);
setStatus("idle");
onSourceLoaded(skippedNames);
} catch (e) {
setStatus("error");
setError(e instanceof Error ? e.message : "Failed to fetch source data");
@@ -51,7 +52,7 @@ export function SourceFetchPrompt({
const text = await file.text();
const json = JSON.parse(text);
await uploadAndCacheSource(sourceCode, json);
onSourceLoaded();
onSourceLoaded([]);
} catch (err) {
setStatus("error");
setError(