From 560288c9e7c0f44aac0fae898598ee1ba7a77bbf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 17:25:37 +0000 Subject: [PATCH 1/8] chore: update submodules to latest versions --- frontend/public/bsatn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/bsatn b/frontend/public/bsatn index ec941c34..a9fb6056 160000 --- a/frontend/public/bsatn +++ b/frontend/public/bsatn @@ -1 +1 @@ -Subproject commit ec941c342686365e2811f303b82f9c0f220af0fc +Subproject commit a9fb6056035f6c12e524f4174d2dd50658403d44 From cc037b412cbf6b5c6a64ae1b56c7bfcf2f61b247 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Nov 2026 12:30:14 +0000 Subject: [PATCH 2/8] chore: sync translations from Crowdin --- frontend/src/locales/de/messages.po | 4 ++-- frontend/src/locales/es/messages.po | 4 ++-- frontend/src/locales/fr/messages.po | 4 ++-- frontend/src/locales/ja/messages.po | 3 ++- frontend/src/locales/pl/messages.po | 4 ++-- frontend/src/locales/pt-BR/messages.po | 4 ++-- frontend/src/locales/ru/messages.po | 3 ++- frontend/src/locales/zh-Hans/messages.po | 4 ++-- frontend/src/locales/zh-Hant/messages.po | 4 ++-- frontend/src/locales/zu/messages.po | 3 ++- 10 files changed, 20 insertions(+), 17 deletions(-) diff --git a/frontend/src/locales/de/messages.po b/frontend/src/locales/de/messages.po index fa760aaa..ef11797c 100644 --- a/frontend/src/locales/de/messages.po +++ b/frontend/src/locales/de/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: de\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: German\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -5857,7 +5857,7 @@ msgstr "" #: src/lib/table-defs/prospecting-table.tsx #: src/routes/database/prospecting/[id].tsx msgid "Biomes" -msgstr "" +msgstr "Biome" #: src/lib/crafts/error-vocab.ts msgid "Too many filters selected (maximum {MAX_SHARED_FILTER_IDS})." diff --git a/frontend/src/locales/es/messages.po b/frontend/src/locales/es/messages.po index c8948c44..00f5a74c 100644 --- a/frontend/src/locales/es/messages.po +++ b/frontend/src/locales/es/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: es\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Spanish\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -5857,7 +5857,7 @@ msgstr "" #: src/lib/table-defs/prospecting-table.tsx #: src/routes/database/prospecting/[id].tsx msgid "Biomes" -msgstr "" +msgstr "Biomas" #: src/lib/crafts/error-vocab.ts msgid "Too many filters selected (maximum {MAX_SHARED_FILTER_IDS})." diff --git a/frontend/src/locales/fr/messages.po b/frontend/src/locales/fr/messages.po index 98b54962..97b05e18 100644 --- a/frontend/src/locales/fr/messages.po +++ b/frontend/src/locales/fr/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: fr\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: French\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" @@ -5857,7 +5857,7 @@ msgstr "" #: src/lib/table-defs/prospecting-table.tsx #: src/routes/database/prospecting/[id].tsx msgid "Biomes" -msgstr "" +msgstr "Biomes" #: src/lib/crafts/error-vocab.ts msgid "Too many filters selected (maximum {MAX_SHARED_FILTER_IDS})." diff --git a/frontend/src/locales/ja/messages.po b/frontend/src/locales/ja/messages.po index b8c4bd88..ffee2e95 100644 --- a/frontend/src/locales/ja/messages.po +++ b/frontend/src/locales/ja/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: ja\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Japanese\n" "Plural-Forms: nplurals=1; plural=0;\n" @@ -6375,3 +6375,4 @@ msgstr "Brico's Toolboxは、<0>BitCraftのアイテム、レシピ、生き #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "{buildingName}を解体" + diff --git a/frontend/src/locales/pl/messages.po b/frontend/src/locales/pl/messages.po index 47f14d80..2bd0a150 100644 --- a/frontend/src/locales/pl/messages.po +++ b/frontend/src/locales/pl/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: pl\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Polish\n" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" @@ -5857,7 +5857,7 @@ msgstr "" #: src/lib/table-defs/prospecting-table.tsx #: src/routes/database/prospecting/[id].tsx msgid "Biomes" -msgstr "" +msgstr "Biomy" #: src/lib/crafts/error-vocab.ts msgid "Too many filters selected (maximum {MAX_SHARED_FILTER_IDS})." diff --git a/frontend/src/locales/pt-BR/messages.po b/frontend/src/locales/pt-BR/messages.po index 106e98e2..09c46cfd 100644 --- a/frontend/src/locales/pt-BR/messages.po +++ b/frontend/src/locales/pt-BR/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: pt\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Portuguese, Brazilian\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -5857,7 +5857,7 @@ msgstr "" #: src/lib/table-defs/prospecting-table.tsx #: src/routes/database/prospecting/[id].tsx msgid "Biomes" -msgstr "" +msgstr "Biomas" #: src/lib/crafts/error-vocab.ts msgid "Too many filters selected (maximum {MAX_SHARED_FILTER_IDS})." diff --git a/frontend/src/locales/ru/messages.po b/frontend/src/locales/ru/messages.po index c1897e54..df0f49de 100644 --- a/frontend/src/locales/ru/messages.po +++ b/frontend/src/locales/ru/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: ru\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Russian\n" "Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n" @@ -6375,3 +6375,4 @@ msgstr "" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "" + diff --git a/frontend/src/locales/zh-Hans/messages.po b/frontend/src/locales/zh-Hans/messages.po index 8fef8e0c..9cd562a8 100644 --- a/frontend/src/locales/zh-Hans/messages.po +++ b/frontend/src/locales/zh-Hans/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: zh\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Plural-Forms: nplurals=1; plural=0;\n" @@ -5857,7 +5857,7 @@ msgstr "" #: src/lib/table-defs/prospecting-table.tsx #: src/routes/database/prospecting/[id].tsx msgid "Biomes" -msgstr "" +msgstr "生物群系" #: src/lib/crafts/error-vocab.ts msgid "Too many filters selected (maximum {MAX_SHARED_FILTER_IDS})." diff --git a/frontend/src/locales/zh-Hant/messages.po b/frontend/src/locales/zh-Hant/messages.po index 0e252e38..47aa7f76 100644 --- a/frontend/src/locales/zh-Hant/messages.po +++ b/frontend/src/locales/zh-Hant/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: zh\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Chinese Traditional\n" "Plural-Forms: nplurals=1; plural=0;\n" @@ -5857,7 +5857,7 @@ msgstr "" #: src/lib/table-defs/prospecting-table.tsx #: src/routes/database/prospecting/[id].tsx msgid "Biomes" -msgstr "" +msgstr "生態域" #: src/lib/crafts/error-vocab.ts msgid "Too many filters selected (maximum {MAX_SHARED_FILTER_IDS})." diff --git a/frontend/src/locales/zu/messages.po b/frontend/src/locales/zu/messages.po index 3aad2a8a..ce679d73 100644 --- a/frontend/src/locales/zu/messages.po +++ b/frontend/src/locales/zu/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: zu\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-13 11:51\n" +"PO-Revision-Date: 2026-11-20 12:29\n" "Last-Translator: \n" "Language-Team: Zulu\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -6375,3 +6375,4 @@ msgstr "crwdns5532:0crwdne5532:0" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "crwdns5506:0{buildingName}crwdne5506:0" + From ba718adbc567c84c7b1ded3953ba1596c12f3d3d Mon Sep 17 00:00:00 2001 From: wizjany Date: Fri, 20 Nov 2026 00:33:10 -0500 Subject: [PATCH 3/8] Fix recipe times rounding. Also fix detail tab auto-selection. --- .../components/shared/DetailPageLayout.tsx | 36 +++++++++++-------- .../src/components/shared/RelTablePresets.tsx | 2 +- frontend/src/lib/recipe-stats.tsx | 22 ++++++------ frontend/src/lib/utils.ts | 23 +++++++++++- frontend/src/routes/database/paving/[id].tsx | 2 +- .../routes/database/pillar-shaping/[id].tsx | 2 +- .../src/routes/database/resource/[id].tsx | 6 ++-- 7 files changed, 60 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/shared/DetailPageLayout.tsx b/frontend/src/components/shared/DetailPageLayout.tsx index 296ebbd0..1dc9fc1e 100644 --- a/frontend/src/components/shared/DetailPageLayout.tsx +++ b/frontend/src/components/shared/DetailPageLayout.tsx @@ -17,7 +17,7 @@ import { TbOutlineClipboardText as IconClipboardText, TbOutlineExternalLink as IconExternal } from "solid-icons/tb"; -import {Component, createEffect, createSignal, For, JSX, onMount, Show, untrack} from "solid-js"; +import {Component, createEffect, createMemo, createSignal, For, JSX, onMount, Show, untrack} from "solid-js"; import {Spinner, SpinnerType} from "solid-spinner"; import {createCommentsTab, detailPageCommentKey} from "~/components/comments/comments-tab"; import {FontIcon} from "~/components/icons/font-icons"; @@ -240,6 +240,12 @@ export const DetailPageLayout: Component = (props) => { }; const availableTabs = () => allTabs()?.filter(t => t.alwaysEnabled || t.count === undefined || t.count > 0) ?? []; const disabledTabs = () => allTabs()?.filter(t => !t.alwaysEnabled && t.count !== undefined && t.count === 0 && (t.showWhenEmpty ?? true)) ?? []; + // The tab lists render by id, not by tab object: `props.tabs` is rebuilt on a locale switch, and + // remounting the triggers makes Kobalte re-select a tab (firing `onChange`, which writes `?detail=`). + const availableTabIds = createMemo(() => availableTabs().map(t => t.id)); + const disabledTabIds = createMemo(() => disabledTabs().map(t => t.id)); + const availableTab = (id: string) => availableTabs().find(t => t.id === id); + const disabledTab = (id: string) => disabledTabs().find(t => t.id === id); const metaArgs = () => ({ kind: props.metaKind ?? "entry", tier: props.tier, @@ -498,12 +504,12 @@ export const DetailPageLayout: Component = (props) => { - - {(tab) => ( - - {tabLabel(tab.label)} - - ({tab.count}) + + {(id) => ( + + {tabLabel(availableTab(id)?.label ?? "")} + + ({availableTab(id)?.count}) )} @@ -512,19 +518,19 @@ export const DetailPageLayout: Component = (props) => { - - {(tab) => ( - - {tabLabel(tab.label)} (0) + + {(id) => ( + + {tabLabel(disabledTab(id)?.label ?? "")} (0) )} - - {(tab) => ( - - {tab.content()} + + {(id) => ( + + {availableTab(id)?.content()} )} diff --git a/frontend/src/components/shared/RelTablePresets.tsx b/frontend/src/components/shared/RelTablePresets.tsx index 578d96fa..9d449fe9 100644 --- a/frontend/src/components/shared/RelTablePresets.tsx +++ b/frontend/src/components/shared/RelTablePresets.tsx @@ -43,7 +43,7 @@ interface BuffEffectWithLabel extends BuffEffect { const buffColumns: RelTableColumn[] = [ {header: msg`Buff`, cell: (row) => }, - {header: msg`Duration`, cell: (row) => {row.duration != null ? readableSeconds(fixFloat(row.duration)) : "∞"}}, + {header: msg`Duration`, cell: (row) => {row.duration != null ? readableSeconds(row.duration) : "∞"}}, {header: msg`Stats`, cell: (row) => { const buffIdx = BitCraftTables.BuffDesc.indexedBy("id")(); const stats = buffIdx.get(row.buffId)?.stats ?? []; diff --git a/frontend/src/lib/recipe-stats.tsx b/frontend/src/lib/recipe-stats.tsx index 3126ba66..ab612fec 100644 --- a/frontend/src/lib/recipe-stats.tsx +++ b/frontend/src/lib/recipe-stats.tsx @@ -217,7 +217,7 @@ export function craftingStatLines(recipe: CraftingRecipeDesc): StatLine[] { const buildingData = BitCraftTables.BuildingTypeDesc.indexedBy("id")(); const lines: StatLine[] = [ [t`Effort`, recipe.actionsRequired], - [t`Time`, readableSeconds(fixFloat(recipe.timeRequirement))], + [t`Time`, readableSeconds(recipe.timeRequirement)], [t`Stamina`, fixFloat(recipe.staminaRequirement)], ]; addCommonRequirements(lines, recipe, recipe.actionsRequired); @@ -293,7 +293,7 @@ export function extractionStatLines(recipe: ExtractionRecipeDesc, resource?: Res lines.push([t`Total HP`, resource.maxHealth]); } } - lines.push([t`Time`, readableSeconds(fixFloat(recipe.timeRequirement))]); + lines.push([t`Time`, readableSeconds(recipe.timeRequirement)]); lines.push([t`Stamina`, fixFloat(recipe.staminaRequirement)]); addCommonRequirements(lines, recipe, totalEffort); addSkillProgressInfo(lines, recipe); @@ -306,7 +306,7 @@ export function constructionStatLines(recipe: ConstructionRecipeDesc): StatLine[ trackUILocale(); const lines: StatLine[] = [ [t`Effort`, recipe.actionsRequired], - [t`Time`, readableSeconds(fixFloat(recipe.timeRequirement))], + [t`Time`, readableSeconds(recipe.timeRequirement)], [t`Stamina`, fixFloat(recipe.staminaRequirement)], ]; addCommonRequirements(lines, recipe, recipe.actionsRequired); @@ -318,7 +318,7 @@ export function constructionStatLines(recipe: ConstructionRecipeDesc): StatLine[ export function deconstructionStatLines(recipe: DeconstructionRecipeDesc): StatLine[] { trackUILocale(); const lines: StatLine[] = [ - [t`Time`, readableSeconds(fixFloat(recipe.timeRequirement))], + [t`Time`, readableSeconds(recipe.timeRequirement)], ]; addCommonRequirements(lines, recipe); return lines; @@ -328,7 +328,7 @@ export function pavingStatLines(recipe: PavingTileDesc): StatLine[] { trackUILocale(); const skillData = BitCraftTables.SkillDesc.indexedBy("id")(); const lines: StatLine[] = [ - [t`Time`, readableSeconds(fixFloat(recipe.pavingDuration))], + [t`Time`, readableSeconds(recipe.pavingDuration)], ]; recipe.experiencePerProgress.forEach(xp => { const pair = skillExpPair(xp, undefined, skillData); @@ -342,7 +342,7 @@ export function pillarShapingStatLines(recipe: PillarShapingDesc): StatLine[] { trackUILocale(); const skillData = BitCraftTables.SkillDesc.indexedBy("id")(); const lines: StatLine[] = [ - [t`Time`, readableSeconds(fixFloat(recipe.duration))], + [t`Time`, readableSeconds(recipe.duration)], ]; recipe.experiencePerProgress.forEach(xp => { const pair = skillExpPair(xp, undefined, skillData); @@ -355,7 +355,7 @@ export function pillarShapingStatLines(recipe: PillarShapingDesc): StatLine[] { export function conversionStatLines(recipe: ItemConversionRecipeDesc): StatLine[] { trackUILocale(); return [ - [t`Time`, readableSeconds(fixFloat(recipe.timeCost))], + [t`Time`, readableSeconds(recipe.timeCost)], [t`Stamina`, fixFloat(recipe.staminaCost)], ]; } @@ -530,7 +530,7 @@ function addPlaceableSelfBuffs(lines: StatLine[], placeableBuffs: PlaceableSelfB () => ( {buff?.description ?? `Buff #${b.buffId}`} - {duration ? {readableSeconds(fixFloat(duration))} : null} + {duration ? {readableSeconds(duration)} : null} { @@ -550,7 +550,7 @@ function addPlaceableSelfBuffs(lines: StatLine[], placeableBuffs: PlaceableSelfB export function interactionStatLines(interaction: PlaceableInteractionDesc, sourcePlaceable: PlaceableDesc | undefined): StatLine[] { trackUILocale(); const lines: StatLine[] = [ - [t`Time`, readableSeconds(fixFloat(interaction.timeRequirement))], + [t`Time`, readableSeconds(interaction.timeRequirement)], [t`Stamina`, fixFloat(interaction.staminaRequirement)], ]; @@ -577,8 +577,8 @@ export function growthStatLines(growth: PlaceableGrowthDesc): StatLine[] { const maxTime = growth.time[1] ?? minTime; const lines: StatLine[] = [ [t`Time`, minTime === maxTime - ? `${readableSeconds(fixFloat(minTime))}` - : `${readableSeconds(fixFloat(minTime))} - ${readableSeconds(fixFloat(maxTime))}`], + ? `${readableSeconds(minTime)}` + : `${readableSeconds(minTime)} - ${readableSeconds(maxTime)}`], ]; if (!growth.showTimeLeft) { lines.push([t`Shows Time Left`, t`No`]); diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index cc2bbf96..1a2fa3b4 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -107,6 +107,22 @@ function getDurationFormats(locale: string): [Intl.DurationFormat, Intl.Duration return [durationFormat, durationFormatZero]; } +let subMinuteFormat: Intl.NumberFormat | undefined; +let subMinuteFormatLocale: string | undefined; + +/** Localized "1.6s" style; `Intl.DurationFormat` rejects fractional units, so sub-minute fractions go through here. */ +function formatFractionalSeconds(seconds: number, locale: string): string { + if (!subMinuteFormat || subMinuteFormatLocale !== locale) { + subMinuteFormatLocale = locale; + try { + subMinuteFormat = new Intl.NumberFormat(locale, {style: "unit", unit: "second", unitDisplay: "narrow", maximumFractionDigits: 3}); + } catch { + subMinuteFormat = new Intl.NumberFormat(undefined, {style: "unit", unit: "second", unitDisplay: "narrow", maximumFractionDigits: 3}); + } + } + return subMinuteFormat.format(seconds); +} + function readableSecondsFallback(hours: number, minutes: number, secs: number): string { return [ hours > 0 ? `${hours}h` : null, @@ -122,7 +138,12 @@ export function readableSeconds(seconds: number | undefined, shorten: boolean = if (seconds === undefined) return undefined; trackUILocale(); if (seconds === -1) return t`Infinite`; - seconds = Math.round(seconds); + seconds = fixFloat(seconds); + // Fractions are only meaningful (and only displayed) for durations under a minute. + if (seconds >= 60) seconds = Math.round(seconds); + else if (!Number.isInteger(seconds)) { + return formatFractionalSeconds(seconds, PSEUDOLOCALE_ENABLED ? activeDataLocale() : i18n.locale); + } const hours = Math.floor(seconds / 3600) const minutes = Math.floor((seconds % 3600) / 60) const secs = hours > 0 && shorten ? 0 : seconds % 60; diff --git a/frontend/src/routes/database/paving/[id].tsx b/frontend/src/routes/database/paving/[id].tsx index 09d60d1b..f1bfffc8 100644 --- a/frontend/src/routes/database/paving/[id].tsx +++ b/frontend/src/routes/database/paving/[id].tsx @@ -75,7 +75,7 @@ export default function PavingDetail() { metaImage={ogImageForAsset(tile()?.iconAddress)} details={[ {label: msg`Experience`, value: experienceStr()}, - {label: msg`Build Time`, value: tile() ? readableSeconds(fixFloat(tile()!.pavingDuration)) : undefined}, + {label: msg`Build Time`, value: tile() ? readableSeconds(tile()!.pavingDuration) : undefined}, ]} rawData={tile()} spacetimeTable={BitCraftTables.PavingTileDesc.spacetimeName} diff --git a/frontend/src/routes/database/pillar-shaping/[id].tsx b/frontend/src/routes/database/pillar-shaping/[id].tsx index 26c0dff0..1108ca4b 100644 --- a/frontend/src/routes/database/pillar-shaping/[id].tsx +++ b/frontend/src/routes/database/pillar-shaping/[id].tsx @@ -55,7 +55,7 @@ export default function PillarShapingDetail() { metaImage={ogImageForAsset(pillar()?.iconAddress)} details={[ {label: msg`Experience`, value: experienceStr()}, - {label: msg`Build Time`, value: pillar() ? readableSeconds(fixFloat(pillar()!.duration)) : undefined}, + {label: msg`Build Time`, value: pillar() ? readableSeconds(pillar()!.duration) : undefined}, ]} rawData={pillar()} spacetimeTable={BitCraftTables.PillarShapingDesc.spacetimeName} diff --git a/frontend/src/routes/database/resource/[id].tsx b/frontend/src/routes/database/resource/[id].tsx index ad8f392c..bc531f13 100644 --- a/frontend/src/routes/database/resource/[id].tsx +++ b/frontend/src/routes/database/resource/[id].tsx @@ -17,7 +17,7 @@ import {prospectingForResource} from "~/lib/recipe-stats"; import {enemiesForResource, extractionRecipeForResource, resourceGrowthFrom, resourceGrowthInto, resourcesYieldingResource} from "~/lib/relations"; import {useSettings} from "~/lib/settings"; import {enemySpawnsTab} from "~/lib/table-utils/detail-tab-builders.tsx"; -import {fixFloat, readableSeconds} from "~/lib/utils"; +import {readableSeconds} from "~/lib/utils"; export default function ResourceDetail() { const params = useParams(); @@ -78,8 +78,8 @@ export default function ResourceDetail() { { heading: msg`Resource Spawning`, properties: [ - {label: msg`Despawn Time`, value: r.despawnTime ? `${readableSeconds(fixFloat(r.despawnTime))}` : undefined}, - {label: msg`Scheduled Respawn`, value: r.scheduledRespawnTime ? `${readableSeconds(fixFloat(r.scheduledRespawnTime))}` : undefined}, + {label: msg`Despawn Time`, value: r.despawnTime ? `${readableSeconds(r.despawnTime)}` : undefined}, + {label: msg`Scheduled Respawn`, value: r.scheduledRespawnTime ? `${readableSeconds(r.scheduledRespawnTime)}` : undefined}, {label: msg`Not Respawning`, value: r.notRespawning ? true : undefined}, {label: msg`Spawn Priority`, value: r.spawnPriority}, ...(r.spawnsOnLand ? [{label: msg`Land Elevation`, value: `${r.landElevationMin}-${r.landElevationMax}`}] : []), From 65199120b33f7bfe065d3530caad26c043e46377 Mon Sep 17 00:00:00 2001 From: wizjany Date: Wed, 25 Nov 2026 21:48:08 -0500 Subject: [PATCH 4/8] Building view for crafts. This makes tbe entire craft browser nonfunctional until prism republishes. --- backend/brico-bot/.env.example | 2 +- common/bindings/prism/craft_meta_table.ts | 1 + common/bindings/prism/index.ts | 170 ++++++++++++++++-- common/bindings/prism/shop_info_table.ts | 19 ++ common/bindings/prism/shop_inventory_table.ts | 17 ++ .../prism/trade_event_history_table.ts | 30 ++++ common/bindings/prism/trade_event_table.ts | 30 ++++ common/bindings/prism/trade_order_table.ts | 24 +++ common/bindings/prism/types.ts | 141 +++++++++++++++ .../src/components/crafts/craft-columns.tsx | 2 +- frontend/src/lib/crafts/entries.ts | 5 + frontend/src/lib/crafts/relay.ts | 61 +++++++ frontend/src/locales/de/messages.po | 20 +++ frontend/src/locales/en/messages.po | 20 +++ frontend/src/locales/es/messages.po | 20 +++ frontend/src/locales/fr/messages.po | 20 +++ frontend/src/locales/ja/messages.po | 21 ++- frontend/src/locales/pl/messages.po | 20 +++ frontend/src/locales/pt-BR/messages.po | 20 +++ frontend/src/locales/ru/messages.po | 21 ++- frontend/src/locales/zh-Hans/messages.po | 20 +++ frontend/src/locales/zh-Hant/messages.po | 20 +++ frontend/src/locales/zu/messages.po | 21 ++- frontend/src/routes/tools/crafts/[id].tsx | 12 ++ .../src/routes/tools/crafts/building/[id].tsx | 125 +++++++++++++ 25 files changed, 839 insertions(+), 23 deletions(-) create mode 100644 common/bindings/prism/shop_info_table.ts create mode 100644 common/bindings/prism/shop_inventory_table.ts create mode 100644 common/bindings/prism/trade_event_history_table.ts create mode 100644 common/bindings/prism/trade_event_table.ts create mode 100644 common/bindings/prism/trade_order_table.ts create mode 100644 frontend/src/routes/tools/crafts/building/[id].tsx diff --git a/backend/brico-bot/.env.example b/backend/brico-bot/.env.example index a0bf90e4..e6d32063 100644 --- a/backend/brico-bot/.env.example +++ b/backend/brico-bot/.env.example @@ -3,7 +3,7 @@ # ── prism's relay-module (the BitCraft read-mirror) ────────────────────────── #BRICO_RELAY_HOST=http://127.0.0.1:3000 -#BRICO_RELAY_MODULE=prism-relay +#BRICO_RELAY_MODULE=prism-release # ── brico-app (brico's own module) ─────────────────────────────────────────── #BRICO_APP_ENABLED=1 diff --git a/common/bindings/prism/craft_meta_table.ts b/common/bindings/prism/craft_meta_table.ts index e20d878f..33b790f4 100644 --- a/common/bindings/prism/craft_meta_table.ts +++ b/common/bindings/prism/craft_meta_table.ts @@ -20,4 +20,5 @@ export default __t.row({ get status() { return CraftStatus; }, + buildingDescId: __t.i32().name("building_desc_id"), }); diff --git a/common/bindings/prism/index.ts b/common/bindings/prism/index.ts index 6b79f51b..f751e611 100644 --- a/common/bindings/prism/index.ts +++ b/common/bindings/prism/index.ts @@ -1,27 +1,27 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.9.0 (commit 9e0d92412ff2248f401a8ad12d535f2b5ac30912). +// This was generated using spacetimedb cli version 2.14.0 (commit 7c3ee551755dc0152d9e0b0d5241fff939d3eda0). /* eslint-disable */ /* tslint:disable */ import { - DbConnectionBuilder as __DbConnectionBuilder, - type DbConnectionConfig as __DbConnectionConfig, - DbConnectionImpl as __DbConnectionImpl, - type ErrorContextInterface as __ErrorContextInterface, - type EventContextInterface as __EventContextInterface, - makeQueryBuilder as __makeQueryBuilder, - procedures as __procedures, - type QueryBuilder as __QueryBuilder, - type ReducerEventContextInterface as __ReducerEventContextInterface, - reducers as __reducers, - type RemoteModule as __RemoteModule, - schema as __schema, - SubscriptionBuilderImpl as __SubscriptionBuilderImpl, - type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, - type SubscriptionHandleImpl as __SubscriptionHandleImpl, - table as __table, + DbConnectionBuilder as __DbConnectionBuilder, + type DbConnectionConfig as __DbConnectionConfig, + DbConnectionImpl as __DbConnectionImpl, + type ErrorContextInterface as __ErrorContextInterface, + type EventContextInterface as __EventContextInterface, + makeQueryBuilder as __makeQueryBuilder, + procedures as __procedures, + type QueryBuilder as __QueryBuilder, + type ReducerEventContextInterface as __ReducerEventContextInterface, + reducers as __reducers, + type RemoteModule as __RemoteModule, + schema as __schema, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type SubscriptionHandleImpl as __SubscriptionHandleImpl, + table as __table, } from "spacetimedb"; // Import all reducer arg schemas @@ -42,6 +42,11 @@ import PlayerStateRow from "./player_state_table"; import RecipeMetaRow from "./recipe_meta_table"; import RegionRow from "./region_table"; import ResourceLocationRow from "./resource_location_table"; +import ShopInfoRow from "./shop_info_table"; +import ShopInventoryRow from "./shop_inventory_table"; +import TradeEventHistoryRow from "./trade_event_history_table"; +import TradeEventRow from "./trade_event_table"; +import TradeOrderRow from "./trade_order_table"; /** Type-only namespace exports for generated type groups. */ @@ -146,6 +151,9 @@ const tablesSchema = __schema({ { accessor: 'by_owner', name: 'craft_meta_owner_entity_id_idx_btree', algorithm: 'btree', columns: [ 'ownerEntityId', ] }, + { accessor: 'by_region', name: 'craft_meta_region_id_idx_btree', algorithm: 'btree', columns: [ + 'regionId', + ] }, ], constraints: [ { name: 'craft_meta_entity_id_key', constraint: 'unique', columns: ['entityId'] }, @@ -289,6 +297,97 @@ const tablesSchema = __schema({ { name: 'resource_location_entity_id_key', constraint: 'unique', columns: ['entityId'] }, ], }, ResourceLocationRow), + shopInfo: __table({ + name: 'shop_info', + indexes: [ + { accessor: 'by_claim', name: 'shop_info_claim_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'claimEntityId', + ] }, + { accessor: 'by_owner', name: 'shop_info_player_owner_id_idx_btree', algorithm: 'btree', columns: [ + 'playerOwnerId', + ] }, + { accessor: 'by_region', name: 'shop_info_region_id_idx_btree', algorithm: 'btree', columns: [ + 'regionId', + ] }, + { accessor: 'shop_entity_id', name: 'shop_info_shop_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'shopEntityId', + ] }, + ], + constraints: [ + { name: 'shop_info_shop_entity_id_key', constraint: 'unique', columns: ['shopEntityId'] }, + ], + }, ShopInfoRow), + shopInventory: __table({ + name: 'shop_inventory', + indexes: [ + { accessor: 'by_region', name: 'shop_inventory_region_id_idx_btree', algorithm: 'btree', columns: [ + 'regionId', + ] }, + { accessor: 'shop_entity_id', name: 'shop_inventory_shop_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'shopEntityId', + ] }, + ], + constraints: [ + { name: 'shop_inventory_shop_entity_id_key', constraint: 'unique', columns: ['shopEntityId'] }, + ], + }, ShopInventoryRow), + tradeEvent: __table({ + name: 'trade_event', + indexes: [ + { accessor: 'by_claim', name: 'trade_event_claim_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'claimEntityId', + ] }, + { accessor: 'id', name: 'trade_event_id_idx_btree', algorithm: 'btree', columns: [ + 'id', + ] }, + { accessor: 'by_region', name: 'trade_event_region_id_idx_btree', algorithm: 'btree', columns: [ + 'regionId', + ] }, + { accessor: 'by_shop', name: 'trade_event_shop_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'shopEntityId', + ] }, + ], + constraints: [ + { name: 'trade_event_id_key', constraint: 'unique', columns: ['id'] }, + ], + }, TradeEventRow), + tradeEventHistory: __table({ + name: 'trade_event_history', + indexes: [ + { accessor: 'by_claim', name: 'trade_event_history_claim_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'claimEntityId', + ] }, + { accessor: 'id', name: 'trade_event_history_id_idx_btree', algorithm: 'btree', columns: [ + 'id', + ] }, + { accessor: 'by_region', name: 'trade_event_history_region_id_idx_btree', algorithm: 'btree', columns: [ + 'regionId', + ] }, + { accessor: 'by_shop', name: 'trade_event_history_shop_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'shopEntityId', + ] }, + ], + constraints: [ + { name: 'trade_event_history_id_key', constraint: 'unique', columns: ['id'] }, + ], + }, TradeEventHistoryRow), + tradeOrder: __table({ + name: 'trade_order', + indexes: [ + { accessor: 'id', name: 'trade_order_id_idx_hash', algorithm: 'btree', columns: [ + 'id', + ] }, + { accessor: 'by_region', name: 'trade_order_region_id_idx_btree', algorithm: 'btree', columns: [ + 'regionId', + ] }, + { accessor: 'by_shop', name: 'trade_order_shop_entity_id_idx_btree', algorithm: 'btree', columns: [ + 'shopEntityId', + ] }, + ], + constraints: [ + { name: 'trade_order_id_key', constraint: 'unique', columns: ['id'] }, + ], + }, TradeOrderRow), }); /** The schema information for all reducers in this module. This is defined the same way as the reducers would have been defined in the server, except the body of the reducer is omitted in code generation. */ @@ -329,13 +428,23 @@ type __SchemaWithTableAccessorAliases = Omit & { readonly accessorName: "recipe_meta" }; /** @deprecated Use `resourceLocation` instead. This alias will be removed in the next major version. */ readonly "resource_location": Omit & { readonly accessorName: "resource_location" }; + /** @deprecated Use `shopInfo` instead. This alias will be removed in the next major version. */ + readonly "shop_info": Omit & { readonly accessorName: "shop_info" }; + /** @deprecated Use `shopInventory` instead. This alias will be removed in the next major version. */ + readonly "shop_inventory": Omit & { readonly accessorName: "shop_inventory" }; + /** @deprecated Use `tradeEvent` instead. This alias will be removed in the next major version. */ + readonly "trade_event": Omit & { readonly accessorName: "trade_event" }; + /** @deprecated Use `tradeEventHistory` instead. This alias will be removed in the next major version. */ + readonly "trade_event_history": Omit & { readonly accessorName: "trade_event_history" }; + /** @deprecated Use `tradeOrder` instead. This alias will be removed in the next major version. */ + readonly "trade_order": Omit & { readonly accessorName: "trade_order" }; }; }; /** The remote SpacetimeDB module schema, both runtime and type information. */ const REMOTE_MODULE = { versionInfo: { - cliVersion: "2.9.0" as const, + cliVersion: "2.14.0" as const, }, tables: tablesSchema.schemaType.tables as __SchemaWithTableAccessorAliases["tables"], reducers: reducersSchema.reducersType.reducers, @@ -361,6 +470,11 @@ const tableAccessorAliases = { "player_state": "playerState", "recipe_meta": "recipeMeta", "resource_location": "resourceLocation", + "shop_info": "shopInfo", + "shop_inventory": "shopInventory", + "trade_event": "tradeEvent", + "trade_event_history": "tradeEventHistory", + "trade_order": "tradeOrder", } as const; function __withTableAccessorAliases(target: T, freeze = false): T { @@ -409,6 +523,16 @@ export type DbView = __DbViewBase & { readonly "recipe_meta": __DbViewBase["recipeMeta"]; /** @deprecated Use `resourceLocation` instead. This alias will be removed in the next major version. */ readonly "resource_location": __DbViewBase["resourceLocation"]; + /** @deprecated Use `shopInfo` instead. This alias will be removed in the next major version. */ + readonly "shop_info": __DbViewBase["shopInfo"]; + /** @deprecated Use `shopInventory` instead. This alias will be removed in the next major version. */ + readonly "shop_inventory": __DbViewBase["shopInventory"]; + /** @deprecated Use `tradeEvent` instead. This alias will be removed in the next major version. */ + readonly "trade_event": __DbViewBase["tradeEvent"]; + /** @deprecated Use `tradeEventHistory` instead. This alias will be removed in the next major version. */ + readonly "trade_event_history": __DbViewBase["tradeEventHistory"]; + /** @deprecated Use `tradeOrder` instead. This alias will be removed in the next major version. */ + readonly "trade_order": __DbViewBase["tradeOrder"]; }; type __TablesBase = __QueryBuilder; @@ -441,6 +565,16 @@ export type Tables = __TablesBase & { readonly "recipe_meta": __TablesBase["recipeMeta"]; /** @deprecated Use `resourceLocation` instead. This alias will be removed in the next major version. */ readonly "resource_location": __TablesBase["resourceLocation"]; + /** @deprecated Use `shopInfo` instead. This alias will be removed in the next major version. */ + readonly "shop_info": __TablesBase["shopInfo"]; + /** @deprecated Use `shopInventory` instead. This alias will be removed in the next major version. */ + readonly "shop_inventory": __TablesBase["shopInventory"]; + /** @deprecated Use `tradeEvent` instead. This alias will be removed in the next major version. */ + readonly "trade_event": __TablesBase["tradeEvent"]; + /** @deprecated Use `tradeEventHistory` instead. This alias will be removed in the next major version. */ + readonly "trade_event_history": __TablesBase["tradeEventHistory"]; + /** @deprecated Use `tradeOrder` instead. This alias will be removed in the next major version. */ + readonly "trade_order": __TablesBase["tradeOrder"]; }; /** The tables available in this remote SpacetimeDB module. Each table reference doubles as a query builder. */ diff --git a/common/bindings/prism/shop_info_table.ts b/common/bindings/prism/shop_info_table.ts new file mode 100644 index 00000000..414f0750 --- /dev/null +++ b/common/bindings/prism/shop_info_table.ts @@ -0,0 +1,19 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import {t as __t,} from "spacetimedb"; +import {ShopType,} from "./types"; + + +export default __t.row({ + shopEntityId: __t.u64().primaryKey().name("shop_entity_id"), + regionId: __t.u8().name("region_id"), + claimEntityId: __t.u64().name("claim_entity_id"), + shopName: __t.string().name("shop_name"), + playerOwnerId: __t.u64().name("player_owner_id"), + get shopType() { + return ShopType.name("shop_type"); + }, +}); diff --git a/common/bindings/prism/shop_inventory_table.ts b/common/bindings/prism/shop_inventory_table.ts new file mode 100644 index 00000000..0a31eb22 --- /dev/null +++ b/common/bindings/prism/shop_inventory_table.ts @@ -0,0 +1,17 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import {t as __t,} from "spacetimedb"; +import {Pocket,} from "./types"; + + +export default __t.row({ + shopEntityId: __t.u64().primaryKey().name("shop_entity_id"), + regionId: __t.u8().name("region_id"), + get pockets() { + return __t.array(Pocket); + }, + cargoIndex: __t.u32().name("cargo_index"), +}); diff --git a/common/bindings/prism/trade_event_history_table.ts b/common/bindings/prism/trade_event_history_table.ts new file mode 100644 index 00000000..2baa3744 --- /dev/null +++ b/common/bindings/prism/trade_event_history_table.ts @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import {t as __t,} from "spacetimedb"; +import {BarterStallInventoryChangeReason, ItemStack,} from "./types"; + + +export default __t.row({ + id: __t.u64().primaryKey(), + regionId: __t.u8().name("region_id"), + shopEntityId: __t.u64().name("shop_entity_id"), + claimEntityId: __t.u64().name("claim_entity_id"), + actorEntityId: __t.u64().name("actor_entity_id"), + get reason() { + return BarterStallInventoryChangeReason; + }, + tradeOrderEntityId: __t.option(__t.u64()).name("trade_order_entity_id"), + tradeAmount: __t.option(__t.i32()).name("trade_amount"), + get addedItems() { + return __t.array(ItemStack).name("added_items"); + }, + get removedItems() { + return __t.array(ItemStack).name("removed_items"); + }, + treasuryCoinsAdded: __t.i32().name("treasury_coins_added"), + treasuryCoinsRemoved: __t.i32().name("treasury_coins_removed"), + timestamp: __t.timestamp(), +}); diff --git a/common/bindings/prism/trade_event_table.ts b/common/bindings/prism/trade_event_table.ts new file mode 100644 index 00000000..2baa3744 --- /dev/null +++ b/common/bindings/prism/trade_event_table.ts @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import {t as __t,} from "spacetimedb"; +import {BarterStallInventoryChangeReason, ItemStack,} from "./types"; + + +export default __t.row({ + id: __t.u64().primaryKey(), + regionId: __t.u8().name("region_id"), + shopEntityId: __t.u64().name("shop_entity_id"), + claimEntityId: __t.u64().name("claim_entity_id"), + actorEntityId: __t.u64().name("actor_entity_id"), + get reason() { + return BarterStallInventoryChangeReason; + }, + tradeOrderEntityId: __t.option(__t.u64()).name("trade_order_entity_id"), + tradeAmount: __t.option(__t.i32()).name("trade_amount"), + get addedItems() { + return __t.array(ItemStack).name("added_items"); + }, + get removedItems() { + return __t.array(ItemStack).name("removed_items"); + }, + treasuryCoinsAdded: __t.i32().name("treasury_coins_added"), + treasuryCoinsRemoved: __t.i32().name("treasury_coins_removed"), + timestamp: __t.timestamp(), +}); diff --git a/common/bindings/prism/trade_order_table.ts b/common/bindings/prism/trade_order_table.ts new file mode 100644 index 00000000..96273ba9 --- /dev/null +++ b/common/bindings/prism/trade_order_table.ts @@ -0,0 +1,24 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +/* eslint-disable */ +/* tslint:disable */ +import {t as __t,} from "spacetimedb"; +import {ItemStack,} from "./types"; + + +export default __t.row({ + id: __t.u64().primaryKey(), + shopEntityId: __t.u64().name("shop_entity_id"), + remainingStock: __t.i32().name("remaining_stock"), + get offerItems() { + return __t.array(ItemStack).name("offer_items"); + }, + get requiredItems() { + return __t.array(ItemStack).name("required_items"); + }, + claimEntityId: __t.u64().name("claim_entity_id"), + regionId: __t.u8().name("region_id"), + shopName: __t.string().name("shop_name"), + active: __t.bool(), +}); diff --git a/common/bindings/prism/types.ts b/common/bindings/prism/types.ts index 1ff73cd8..8fa18ef1 100644 --- a/common/bindings/prism/types.ts +++ b/common/bindings/prism/types.ts @@ -5,6 +5,12 @@ /* tslint:disable */ import {type Infer as __Infer, t as __t,} from "spacetimedb"; +// The tagged union or sum type for the algebraic type `BarterStallInventoryChangeReason`. +export const BarterStallInventoryChangeReason = __t.enum("BarterStallInventoryChangeReason", { + Sale: __t.unit(), +}); +export type BarterStallInventoryChangeReason = __Infer; + export const ClaimInfo = __t.object("ClaimInfo", { entityId: __t.u64(), regionId: __t.u8(), @@ -110,6 +116,7 @@ export const CraftMeta = __t.object("CraftMeta", { get status() { return CraftStatus; }, + buildingDescId: __t.i32(), }); export type CraftMeta = __Infer; @@ -146,6 +153,7 @@ export const CraftUpdate = __t.object("CraftUpdate", { public: __t.bool(), progress: __t.i32(), lastSeen: __t.timestamp(), + buildingDescId: __t.i32(), }); export type CraftUpdate = __Infer; @@ -164,6 +172,12 @@ export const ExpiringCraft = __t.object("ExpiringCraft", { }); export type ExpiringCraft = __Infer; +export const ExpiringTradeEvent = __t.object("ExpiringTradeEvent", { + eventId: __t.u64(), + scheduledAt: __t.scheduleAt(), +}); +export type ExpiringTradeEvent = __Infer; + export const GrowthTimer = __t.object("GrowthTimer", { entityId: __t.u64(), resourceId: __t.i32(), @@ -190,6 +204,30 @@ export const HerdLocation = __t.object("HerdLocation", { }); export type HerdLocation = __Infer; +// The tagged union or sum type for the algebraic type `InventoryPart`. +export const InventoryPart = __t.enum("InventoryPart", { + Items: __t.unit(), + Cargo: __t.unit(), +}); +export type InventoryPart = __Infer; + +export const ItemStack = __t.object("ItemStack", { + itemId: __t.i32(), + quantity: __t.i32(), + get itemType() { + return ItemType; + }, + durability: __t.option(__t.i32()), +}); +export type ItemStack = __Infer; + +// The tagged union or sum type for the algebraic type `ItemType`. +export const ItemType = __t.enum("ItemType", { + Item: __t.unit(), + Cargo: __t.unit(), +}); +export type ItemType = __Infer; + export const MobileMoveUpdate = __t.object("MobileMoveUpdate", { entityId: __t.u64(), regionId: __t.u8(), @@ -220,6 +258,15 @@ export const PlayerState = __t.object("PlayerState", { }); export type PlayerState = __Infer; +export const Pocket = __t.object("Pocket", { + volume: __t.i32(), + get contents() { + return __t.option(ItemStack); + }, + locked: __t.bool(), +}); +export type Pocket = __Infer; + export const RecipeMeta = __t.object("RecipeMeta", { id: __t.i32(), effortRequired: __t.i32(), @@ -257,3 +304,97 @@ export const ResourceLocation = __t.object("ResourceLocation", { }); export type ResourceLocation = __Infer; +export const ShopActiveUpdate = __t.object("ShopActiveUpdate", { + shopEntityId: __t.u64(), + active: __t.bool(), +}); +export type ShopActiveUpdate = __Infer; + +export const ShopClaimUpdate = __t.object("ShopClaimUpdate", { + shopEntityId: __t.u64(), + claimEntityId: __t.u64(), +}); +export type ShopClaimUpdate = __Infer; + +export const ShopInfo = __t.object("ShopInfo", { + shopEntityId: __t.u64(), + regionId: __t.u8(), + claimEntityId: __t.u64(), + shopName: __t.string(), + playerOwnerId: __t.u64(), + get shopType() { + return ShopType; + }, +}); +export type ShopInfo = __Infer; + +export const ShopInventory = __t.object("ShopInventory", { + shopEntityId: __t.u64(), + regionId: __t.u8(), + get pockets() { + return __t.array(Pocket); + }, + cargoIndex: __t.u32(), +}); +export type ShopInventory = __Infer; + +export const ShopInventoryUpdate = __t.object("ShopInventoryUpdate", { + shopEntityId: __t.u64(), + regionId: __t.u8(), + get part() { + return InventoryPart; + }, + get pockets() { + return __t.array(Pocket); + }, +}); +export type ShopInventoryUpdate = __Infer; + +// The tagged union or sum type for the algebraic type `ShopType`. +export const ShopType = __t.enum("ShopType", { + BarterStall: __t.i32(), + TraderStand: __t.i32(), + Unknown: __t.i32(), +}); +export type ShopType = __Infer; + +export const TradeEvent = __t.object("TradeEvent", { + id: __t.u64(), + regionId: __t.u8(), + shopEntityId: __t.u64(), + claimEntityId: __t.u64(), + actorEntityId: __t.u64(), + get reason() { + return BarterStallInventoryChangeReason; + }, + tradeOrderEntityId: __t.option(__t.u64()), + tradeAmount: __t.option(__t.i32()), + get addedItems() { + return __t.array(ItemStack); + }, + get removedItems() { + return __t.array(ItemStack); + }, + treasuryCoinsAdded: __t.i32(), + treasuryCoinsRemoved: __t.i32(), + timestamp: __t.timestamp(), +}); +export type TradeEvent = __Infer; + +export const TradeOrder = __t.object("TradeOrder", { + id: __t.u64(), + shopEntityId: __t.u64(), + remainingStock: __t.i32(), + get offerItems() { + return __t.array(ItemStack); + }, + get requiredItems() { + return __t.array(ItemStack); + }, + claimEntityId: __t.u64(), + regionId: __t.u8(), + shopName: __t.string(), + active: __t.bool(), +}); +export type TradeOrder = __Infer; + diff --git a/frontend/src/components/crafts/craft-columns.tsx b/frontend/src/components/crafts/craft-columns.tsx index 122cca37..5227fc05 100644 --- a/frontend/src/components/crafts/craft-columns.tsx +++ b/frontend/src/components/crafts/craft-columns.tsx @@ -49,7 +49,7 @@ function sinceText(ms: number, now: number, locale: string): string { return rtf.format(-Math.floor(seconds / 86400), "day"); } -function ProgressBar(props: {entry: CraftEntry}) { +export function ProgressBar(props: {entry: CraftEntry}) { return (
diff --git a/frontend/src/lib/crafts/entries.ts b/frontend/src/lib/crafts/entries.ts index 0500e8d1..fa93cfa7 100644 --- a/frontend/src/lib/crafts/entries.ts +++ b/frontend/src/lib/crafts/entries.ts @@ -56,6 +56,9 @@ export interface CraftEntry { complete: boolean; claimName: string | null; ownerName: string | null; + /** Building entity id as a decimal string; `"0"` when the relay has no building for the craft. */ + buildingEntityId: string; + buildingDescId: number; /** * True when the craft is open to anyone. A non-public craft is private to its owner. */ @@ -190,6 +193,8 @@ export function craftEntriesFrom(snapshot: CraftSnapshot, bountyAssignments?: Re complete: subject.complete, claimName: claim ? claimDisplayName(claim.name) : null, ownerName: owner?.name ?? null, + buildingEntityId: craft.buildingEntityId.toString(), + buildingDescId: craft.buildingDescId, public: craft.public, firstSeenMs, lastActiveMs: progress ? Number(progress.lastSeen.toMillis()) : firstSeenMs, diff --git a/frontend/src/lib/crafts/relay.ts b/frontend/src/lib/crafts/relay.ts index cca3a830..5e488fcb 100644 --- a/frontend/src/lib/crafts/relay.ts +++ b/frontend/src/lib/crafts/relay.ts @@ -115,6 +115,20 @@ export function craftDetailResource(craftId: bigint): ResourceSpec { }; } +/** + * The open crafts of one building entity, plus all progress rows (`craft_progress` has no building + * column to narrow by). + */ +export function craftBuildingResource(buildingEntityId: bigint): ResourceSpec { + return { + key: `crafts:building:${buildingEntityId}`, + tables: [ + prismRows(tables.craftMeta, tables.craftMeta.where(row => row.buildingEntityId.eq(buildingEntityId))), + prismTable(tables.craftProgress), + ], + }; +} + export interface CraftSnapshot { /** Crafts in scope. The browser's snapshot holds only `Active` ones — see `readSnapshot`. */ crafts: CraftMeta[]; @@ -224,6 +238,12 @@ export function readCraftSnapshot(conn: PrismConnection, craftId: bigint): Craft return {...readReference(conn), crafts}; } +/** The open crafts in one building entity, resolved against the reference tables. */ +export function readBuildingSnapshot(conn: PrismConnection, buildingEntityId: bigint): CraftSnapshot { + const crafts = conn.db.craftMeta.iter().filter(row => row.buildingEntityId === buildingEntityId && isActive(row)).toArray(); + return {...readReference(conn), crafts}; +} + function readContributions(conn: PrismConnection, craftId: bigint): CraftContribution[] { const rows: CraftContribution[] = []; for (const row of conn.db.craftContribution.iter() as Iterable) { @@ -471,6 +491,47 @@ export function createCraftDetailRelay(craftId: Accessor): CraftD }; } +/** + * Opens the relay for one building entity: the reference tables plus that building's open crafts. + * `buildingId` is an accessor because the route param is one; the per-building resource follows it. + */ +export function createBuildingRelay(buildingId: Accessor): CraftRelay { + const [snapshot, setSnapshot] = createSignal(EMPTY_SNAPSHOT); + const [ready, setReady] = createSignal(false); + const connection = useConnection(PRISM_SERVER); + + const rebuild = () => { + const conn = connection.active(); + const id = buildingId(); + if (conn && id !== null) setSnapshot(readBuildingSnapshot(conn, id)); + }; + const scheduleRebuild = leadingAndTrailing(throttle, rebuild, REBUILD_INTERVAL_MS); + onCleanup(() => scheduleRebuild.clear()); + + onMount(() => connection.requestResource(CRAFT_REFERENCE_RESOURCE, scheduleRebuild)); + + createEffect(() => { + const id = buildingId(); + setSnapshot(EMPTY_SNAPSHOT); + setReady(false); + if (id === null) return; + const request = connection.requestResource(craftBuildingResource(id), scheduleRebuild); + createEffect(() => { + const isReady = request.ready(); + if (isReady) rebuild(); + setReady(isReady); + }); + }); + + return { + snapshot, + ready, + status: connection.status, + error: connection.error, + reconnect: connection.reconnect, + }; +} + /** * The reference table for resolving player ids to their live names. */ diff --git a/frontend/src/locales/de/messages.po b/frontend/src/locales/de/messages.po index ef11797c..6b7ef0be 100644 --- a/frontend/src/locales/de/messages.po +++ b/frontend/src/locales/de/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "Tags" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" diff --git a/frontend/src/locales/en/messages.po b/frontend/src/locales/en/messages.po index 9f90cd88..087b6d18 100644 --- a/frontend/src/locales/en/messages.po +++ b/frontend/src/locales/en/messages.po @@ -497,6 +497,10 @@ msgstr "You can have at most {MAX_API_KEYS_PER_ACCOUNT} API keys. Delete one fir msgid "{0} <0/> / effort" msgstr "{0} <0/> / effort" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "Loading crafts…" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "Mark read" @@ -623,6 +627,7 @@ msgstr "Copy link to this outfit" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "private" @@ -4089,6 +4094,8 @@ msgstr "Tags" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "Building" @@ -4332,6 +4339,10 @@ msgstr "Max Equip Count" msgid "Combat Action" msgstr "Combat Action" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "No open crafts in this building." + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "Grows From" @@ -5268,6 +5279,7 @@ msgid "Moderators can't be moderated this way." msgstr "Moderators can't be moderated this way." #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "← Back to the craft browser" @@ -5711,6 +5723,10 @@ msgstr "Switch between currency/effort and effort/currency" msgid "That account doesn't exist." msgstr "That account doesn't exist." +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "That is not a building id." + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "Condition" @@ -6235,6 +6251,10 @@ msgstr "Used in Paving" msgid "Offered by" msgstr "Offered by" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "complete" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "That Discord channel isn't linked for notifications anymore." diff --git a/frontend/src/locales/es/messages.po b/frontend/src/locales/es/messages.po index 00f5a74c..56f23137 100644 --- a/frontend/src/locales/es/messages.po +++ b/frontend/src/locales/es/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "Etiquetas" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" diff --git a/frontend/src/locales/fr/messages.po b/frontend/src/locales/fr/messages.po index 97b05e18..8ff1fd30 100644 --- a/frontend/src/locales/fr/messages.po +++ b/frontend/src/locales/fr/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "Tags" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" diff --git a/frontend/src/locales/ja/messages.po b/frontend/src/locales/ja/messages.po index ffee2e95..f5e7a1eb 100644 --- a/frontend/src/locales/ja/messages.po +++ b/frontend/src/locales/ja/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "タグ" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "最大装備数" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "成長元" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" @@ -6375,4 +6395,3 @@ msgstr "Brico's Toolboxは、<0>BitCraftのアイテム、レシピ、生き #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "{buildingName}を解体" - diff --git a/frontend/src/locales/pl/messages.po b/frontend/src/locales/pl/messages.po index 2bd0a150..063db3ae 100644 --- a/frontend/src/locales/pl/messages.po +++ b/frontend/src/locales/pl/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "Tagi" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" diff --git a/frontend/src/locales/pt-BR/messages.po b/frontend/src/locales/pt-BR/messages.po index 09c46cfd..697b781e 100644 --- a/frontend/src/locales/pt-BR/messages.po +++ b/frontend/src/locales/pt-BR/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "Tags" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" diff --git a/frontend/src/locales/ru/messages.po b/frontend/src/locales/ru/messages.po index df0f49de..70a5e1f6 100644 --- a/frontend/src/locales/ru/messages.po +++ b/frontend/src/locales/ru/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "Теги" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" @@ -6375,4 +6395,3 @@ msgstr "" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "" - diff --git a/frontend/src/locales/zh-Hans/messages.po b/frontend/src/locales/zh-Hans/messages.po index 9cd562a8..aff2eb88 100644 --- a/frontend/src/locales/zh-Hans/messages.po +++ b/frontend/src/locales/zh-Hans/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "标签" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" diff --git a/frontend/src/locales/zh-Hant/messages.po b/frontend/src/locales/zh-Hant/messages.po index 47aa7f76..fda3142d 100644 --- a/frontend/src/locales/zh-Hant/messages.po +++ b/frontend/src/locales/zh-Hant/messages.po @@ -502,6 +502,10 @@ msgstr "" msgid "{0} <0/> / effort" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "" @@ -628,6 +632,7 @@ msgstr "" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "" @@ -4094,6 +4099,8 @@ msgstr "標籤" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "" @@ -4337,6 +4344,10 @@ msgstr "" msgid "Combat Action" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "" @@ -5716,6 +5728,10 @@ msgstr "" msgid "That account doesn't exist." msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "" @@ -6240,6 +6256,10 @@ msgstr "" msgid "Offered by" msgstr "" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "" diff --git a/frontend/src/locales/zu/messages.po b/frontend/src/locales/zu/messages.po index ce679d73..426f4b61 100644 --- a/frontend/src/locales/zu/messages.po +++ b/frontend/src/locales/zu/messages.po @@ -502,6 +502,10 @@ msgstr "crwdns6780:0{MAX_API_KEYS_PER_ACCOUNT}crwdne6780:0" msgid "{0} <0/> / effort" msgstr "crwdns5706:0{0}crwdne5706:0" +#: src/routes/tools/crafts/building/[id].tsx +msgid "Loading crafts…" +msgstr "" + #: src/routes/account/notifications.tsx msgid "Mark read" msgstr "crwdns5708:0crwdne5708:0" @@ -628,6 +632,7 @@ msgstr "crwdns6970:0crwdne6970:0" #: src/components/crafts/craft-columns.tsx #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "private" msgstr "crwdns5732:0crwdne5732:0" @@ -4094,6 +4099,8 @@ msgstr "crwdns5110:0crwdne5110:0" #: src/lib/crafts/filter-vocab.ts #: src/lib/recipe-stats.tsx +#: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "Building" msgstr "crwdns6336:0crwdne6336:0" @@ -4337,6 +4344,10 @@ msgstr "crwdns5144:0crwdne5144:0" msgid "Combat Action" msgstr "crwdns5580:0crwdne5580:0" +#: src/routes/tools/crafts/building/[id].tsx +msgid "No open crafts in this building." +msgstr "" + #: src/routes/database/resource/[id].tsx msgid "Grows From" msgstr "crwdns5146:0crwdne5146:0" @@ -5273,6 +5284,7 @@ msgid "Moderators can't be moderated this way." msgstr "crwdns7218:0crwdne7218:0" #: src/routes/tools/crafts/[id].tsx +#: src/routes/tools/crafts/building/[id].tsx msgid "← Back to the craft browser" msgstr "crwdns6540:0crwdne6540:0" @@ -5716,6 +5728,10 @@ msgstr "crwdns6612:0crwdne6612:0" msgid "That account doesn't exist." msgstr "crwdns6614:0crwdne6614:0" +#: src/routes/tools/crafts/building/[id].tsx +msgid "That is not a building id." +msgstr "" + #: src/components/crafts/FilterBuilder.tsx msgid "Condition" msgstr "crwdns6616:0crwdne6616:0" @@ -6240,6 +6256,10 @@ msgstr "crwdns5610:0crwdne5610:0" msgid "Offered by" msgstr "crwdns5486:0crwdne5486:0" +#: src/routes/tools/crafts/building/[id].tsx +msgid "complete" +msgstr "" + #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." msgstr "crwdns6704:0crwdne6704:0" @@ -6375,4 +6395,3 @@ msgstr "crwdns5532:0crwdne5532:0" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "crwdns5506:0{buildingName}crwdne5506:0" - diff --git a/frontend/src/routes/tools/crafts/[id].tsx b/frontend/src/routes/tools/crafts/[id].tsx index d5dfb0a6..710bb594 100644 --- a/frontend/src/routes/tools/crafts/[id].tsx +++ b/frontend/src/routes/tools/crafts/[id].tsx @@ -186,6 +186,11 @@ function OrDash(props: {value: string | null}) { ); } +/** A building desc's name, falling back to its id while the game data is loading or has no such row. */ +function BuildingName(props: {id: number}) { + return <>{BitCraftTables.BuildingDesc.indexedBy("id")().get(props.id)?.name ?? `Building #${props.id}`}; +} + /** * The "Rate" tab's amount input — same commit-on-blur/exact-ratio treatment as * `~/routes/account/bounty-rules.tsx`'s `FlatAmountField` (both wrap the shared `useAmountField`): @@ -538,6 +543,13 @@ export default function CraftDetail() {
+ + }> + + + + + {entry().regionName} —}> diff --git a/frontend/src/routes/tools/crafts/building/[id].tsx b/frontend/src/routes/tools/crafts/building/[id].tsx new file mode 100644 index 00000000..6cd56c01 --- /dev/null +++ b/frontend/src/routes/tools/crafts/building/[id].tsx @@ -0,0 +1,125 @@ +/** + * building/[id].tsx — every open craft in one building, addressed by the building *entity* id. + */ +import {msg} from "@lingui/core/macro"; +import {Trans} from "@lingui/solid/macro"; +import {A, useParams} from "@solidjs/router"; +import {createMemo, For, Show} from "solid-js"; +import {ProgressBar} from "~/components/crafts/craft-columns"; +import {OutputIcon} from "~/components/crafts/OutputIcon"; +import MainLayout from "~/components/MainLayout"; +import {ConnectionStatusBadge} from "~/components/shared/ConnectionStatusBadge"; +import {Badge} from "~/components/ui/badge"; +import {Card, CardContent} from "~/components/ui/card"; +import {BitCraftTables} from "~/lib/bitcraft-data"; +import {createBountyAssignments} from "~/lib/crafts/bounty"; +import {craftEntriesFrom} from "~/lib/crafts/entries"; +import {createBuildingRelay} from "~/lib/crafts/relay"; +import {breadcrumb} from "~/lib/game-links"; +import {uiLocale} from "~/lib/i18n"; +import {useLabel} from "~/lib/labels"; + +const BROWSE_HREF = "/tools/crafts/browse"; + +/** The building entity id from the URL; `null` for anything but a plain non-negative integer. */ +function parseBuildingId(raw: string | undefined): bigint | null { + if (!raw || !/^\d+$/.test(raw)) return null; + try { + return BigInt(raw); + } catch { + return null; + } +} + +export default function BuildingCrafts() { + const params = useParams(); + const label = useLabel(); + + const buildingId = createMemo(() => parseBuildingId(params.id as string | undefined)); + const relay = createBuildingRelay(buildingId); + const bountyAssignments = createBountyAssignments(); + + const entries = createMemo(() => + craftEntriesFrom(relay.snapshot(), bountyAssignments()) + .sort((a, b) => a.recipeName.localeCompare(b.recipeName, uiLocale())), + ); + + const buildingName = createMemo(() => { + const descId = entries().at(0)?.buildingDescId; + if (descId === undefined) return label(msg`Building`); + return BitCraftTables.BuildingDesc.indexedBy("id")().get(descId)?.name ?? `Building #${descId}`; + }); + const claimName = () => entries().find(entry => entry.claimName)?.claimName ?? null; + + return ( + +
+
+
+

{buildingName()}

+ + {name =>

{name()}

} +
+
+
+ +
+
+ + 0} + fallback={ +

+ That is not a building id.}> + Loading crafts…}> + No open crafts in this building. + + +

+ } + > + +
+ +

+ + ← Back to the craft browser + +

+
+
+ ); +} From 6b15ede2a17e9d7838980bd403cf0c770e47c0a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Nov 2026 13:29:01 +0000 Subject: [PATCH 5/8] chore: sync translations from Crowdin --- frontend/src/locales/de/messages.po | 2 +- frontend/src/locales/es/messages.po | 2 +- frontend/src/locales/fr/messages.po | 2 +- frontend/src/locales/ja/messages.po | 3 ++- frontend/src/locales/pl/messages.po | 3 ++- frontend/src/locales/pt-BR/messages.po | 2 +- frontend/src/locales/ru/messages.po | 3 ++- frontend/src/locales/zh-Hans/messages.po | 3 ++- frontend/src/locales/zh-Hant/messages.po | 3 ++- frontend/src/locales/zu/messages.po | 11 ++++++----- 10 files changed, 20 insertions(+), 14 deletions(-) diff --git a/frontend/src/locales/de/messages.po b/frontend/src/locales/de/messages.po index 6b7ef0be..4fa081cd 100644 --- a/frontend/src/locales/de/messages.po +++ b/frontend/src/locales/de/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: de\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: German\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" diff --git a/frontend/src/locales/es/messages.po b/frontend/src/locales/es/messages.po index 56f23137..f773a539 100644 --- a/frontend/src/locales/es/messages.po +++ b/frontend/src/locales/es/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: es\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Spanish\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" diff --git a/frontend/src/locales/fr/messages.po b/frontend/src/locales/fr/messages.po index 8ff1fd30..21cf3857 100644 --- a/frontend/src/locales/fr/messages.po +++ b/frontend/src/locales/fr/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: fr\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: French\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" diff --git a/frontend/src/locales/ja/messages.po b/frontend/src/locales/ja/messages.po index f5e7a1eb..0220e592 100644 --- a/frontend/src/locales/ja/messages.po +++ b/frontend/src/locales/ja/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: ja\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Japanese\n" "Plural-Forms: nplurals=1; plural=0;\n" @@ -6395,3 +6395,4 @@ msgstr "Brico's Toolboxは、<0>BitCraftのアイテム、レシピ、生き #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "{buildingName}を解体" + diff --git a/frontend/src/locales/pl/messages.po b/frontend/src/locales/pl/messages.po index 063db3ae..4faef358 100644 --- a/frontend/src/locales/pl/messages.po +++ b/frontend/src/locales/pl/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: pl\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Polish\n" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" @@ -6395,3 +6395,4 @@ msgstr "" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "" + diff --git a/frontend/src/locales/pt-BR/messages.po b/frontend/src/locales/pt-BR/messages.po index 697b781e..d85c39da 100644 --- a/frontend/src/locales/pt-BR/messages.po +++ b/frontend/src/locales/pt-BR/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: pt\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Portuguese, Brazilian\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" diff --git a/frontend/src/locales/ru/messages.po b/frontend/src/locales/ru/messages.po index 70a5e1f6..7881a19f 100644 --- a/frontend/src/locales/ru/messages.po +++ b/frontend/src/locales/ru/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: ru\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Russian\n" "Plural-Forms: nplurals=4; plural=((n%10==1 && n%100!=11) ? 0 : ((n%10 >= 2 && n%10 <=4 && (n%100 < 12 || n%100 > 14)) ? 1 : ((n%10 == 0 || (n%10 >= 5 && n%10 <=9)) || (n%100 >= 11 && n%100 <= 14)) ? 2 : 3));\n" @@ -6395,3 +6395,4 @@ msgstr "" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "" + diff --git a/frontend/src/locales/zh-Hans/messages.po b/frontend/src/locales/zh-Hans/messages.po index aff2eb88..976cdbe5 100644 --- a/frontend/src/locales/zh-Hans/messages.po +++ b/frontend/src/locales/zh-Hans/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: zh\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Plural-Forms: nplurals=1; plural=0;\n" @@ -6395,3 +6395,4 @@ msgstr "" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "" + diff --git a/frontend/src/locales/zh-Hant/messages.po b/frontend/src/locales/zh-Hant/messages.po index fda3142d..02b84ce3 100644 --- a/frontend/src/locales/zh-Hant/messages.po +++ b/frontend/src/locales/zh-Hant/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: zh\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Chinese Traditional\n" "Plural-Forms: nplurals=1; plural=0;\n" @@ -6395,3 +6395,4 @@ msgstr "" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "" + diff --git a/frontend/src/locales/zu/messages.po b/frontend/src/locales/zu/messages.po index 426f4b61..243447ff 100644 --- a/frontend/src/locales/zu/messages.po +++ b/frontend/src/locales/zu/messages.po @@ -8,7 +8,7 @@ msgstr "" "Language: zu\n" "Project-Id-Version: brico\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2026-11-20 12:29\n" +"PO-Revision-Date: 2026-11-27 13:28\n" "Last-Translator: \n" "Language-Team: Zulu\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" @@ -504,7 +504,7 @@ msgstr "crwdns5706:0{0}crwdne5706:0" #: src/routes/tools/crafts/building/[id].tsx msgid "Loading crafts…" -msgstr "" +msgstr "crwdns7292:0crwdne7292:0" #: src/routes/account/notifications.tsx msgid "Mark read" @@ -4346,7 +4346,7 @@ msgstr "crwdns5580:0crwdne5580:0" #: src/routes/tools/crafts/building/[id].tsx msgid "No open crafts in this building." -msgstr "" +msgstr "crwdns7294:0crwdne7294:0" #: src/routes/database/resource/[id].tsx msgid "Grows From" @@ -5730,7 +5730,7 @@ msgstr "crwdns6614:0crwdne6614:0" #: src/routes/tools/crafts/building/[id].tsx msgid "That is not a building id." -msgstr "" +msgstr "crwdns7296:0crwdne7296:0" #: src/components/crafts/FilterBuilder.tsx msgid "Condition" @@ -6258,7 +6258,7 @@ msgstr "crwdns5486:0crwdne5486:0" #: src/routes/tools/crafts/building/[id].tsx msgid "complete" -msgstr "" +msgstr "crwdns7298:0crwdne7298:0" #: src/lib/crafts/error-vocab.ts msgid "That Discord channel isn't linked for notifications anymore." @@ -6395,3 +6395,4 @@ msgstr "crwdns5532:0crwdne5532:0" #: src/lib/relations.ts msgid "Deconstruct {buildingName}" msgstr "crwdns5506:0{buildingName}crwdne5506:0" + From a96065e8ef3003f909764d5e364b30e65dc881d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Nov 2026 14:08:06 +0000 Subject: [PATCH 6/8] chore: update submodules to latest versions --- common/bitcraft-bindings/upstream | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bitcraft-bindings/upstream b/common/bitcraft-bindings/upstream index 5c087da4..69b0a525 160000 --- a/common/bitcraft-bindings/upstream +++ b/common/bitcraft-bindings/upstream @@ -1 +1 @@ -Subproject commit 5c087da4996055e70f4c51af04cc94dfe7320cdd +Subproject commit 69b0a525d448509af56acb7ae3a29c8391a7dd8c From ea7591e3dfd170236906f9f5de2a169067ab7259 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Nov 2026 14:09:44 +0000 Subject: [PATCH 7/8] chore: update submodules to latest versions --- frontend/public/bsatn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/bsatn b/frontend/public/bsatn index a9fb6056..69ce46c6 160000 --- a/frontend/public/bsatn +++ b/frontend/public/bsatn @@ -1 +1 @@ -Subproject commit a9fb6056035f6c12e524f4174d2dd50658403d44 +Subproject commit 69ce46c6159350888c23b56bd717c86eaf42244a From 36d70c0ae849a002f44aa544528beee09d19b22a Mon Sep 17 00:00:00 2001 From: wizjany Date: Fri, 27 Nov 2026 09:56:45 -0500 Subject: [PATCH 8/8] regen stelo bindings?? --- .../bindings/stelo/create_account_reducer.ts | 1 - ...okens_reducer.ts => delete_app_reducer.ts} | 3 +- common/bindings/stelo/index.ts | 67 +++++++------------ common/bindings/stelo/my_accounts_table.ts | 1 - .../stelo/my_accounts_tokens_table.ts | 14 ---- .../stelo/set_account_webhook_reducer.ts | 11 --- common/bindings/stelo/types.ts | 34 ++-------- common/bindings/stelo/types/procedures.ts | 6 +- common/bindings/stelo/types/reducers.ts | 6 +- ..._procedure.ts => user_search_procedure.ts} | 9 +-- 10 files changed, 40 insertions(+), 112 deletions(-) rename common/bindings/stelo/{revoke_account_tokens_reducer.ts => delete_app_reducer.ts} (81%) delete mode 100644 common/bindings/stelo/my_accounts_tokens_table.ts delete mode 100644 common/bindings/stelo/set_account_webhook_reducer.ts rename common/bindings/stelo/{create_account_token_procedure.ts => user_search_procedure.ts} (59%) diff --git a/common/bindings/stelo/create_account_reducer.ts b/common/bindings/stelo/create_account_reducer.ts index 72659cf4..e1523b1c 100644 --- a/common/bindings/stelo/create_account_reducer.ts +++ b/common/bindings/stelo/create_account_reducer.ts @@ -13,7 +13,6 @@ export default { return AccountKind; }, address: __t.option(__t.string()), - webhook: __t.option(__t.string()), label: __t.option(__t.string()), isPrimary: __t.bool(), }; diff --git a/common/bindings/stelo/revoke_account_tokens_reducer.ts b/common/bindings/stelo/delete_app_reducer.ts similarity index 81% rename from common/bindings/stelo/revoke_account_tokens_reducer.ts rename to common/bindings/stelo/delete_app_reducer.ts index 185088ec..afca9457 100644 --- a/common/bindings/stelo/revoke_account_tokens_reducer.ts +++ b/common/bindings/stelo/delete_app_reducer.ts @@ -6,6 +6,5 @@ import {t as __t,} from "spacetimedb"; export default { - accountId: __t.u64(), - tokenIds: __t.array(__t.u64()), + id: __t.identity(), }; diff --git a/common/bindings/stelo/index.ts b/common/bindings/stelo/index.ts index 16c634e0..9e6d212e 100644 --- a/common/bindings/stelo/index.ts +++ b/common/bindings/stelo/index.ts @@ -1,30 +1,30 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.10.0 (commit baca5cdf77577ed4e3f30da48a5158189c4ea43f). +// This was generated using spacetimedb cli version 2.14.0 (commit 7c3ee551755dc0152d9e0b0d5241fff939d3eda0). /* eslint-disable */ /* tslint:disable */ import { - convertToAccessorMap as __convertToAccessorMap, - DbConnectionBuilder as __DbConnectionBuilder, - type DbConnectionConfig as __DbConnectionConfig, - DbConnectionImpl as __DbConnectionImpl, - type ErrorContextInterface as __ErrorContextInterface, - type EventContextInterface as __EventContextInterface, - makeQueryBuilder as __makeQueryBuilder, - procedures as __procedures, - procedureSchema as __procedureSchema, - type QueryBuilder as __QueryBuilder, - type ReducerEventContextInterface as __ReducerEventContextInterface, - reducers as __reducers, - reducerSchema as __reducerSchema, - type RemoteModule as __RemoteModule, - schema as __schema, - SubscriptionBuilderImpl as __SubscriptionBuilderImpl, - type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, - type SubscriptionHandleImpl as __SubscriptionHandleImpl, - table as __table, + convertToAccessorMap as __convertToAccessorMap, + DbConnectionBuilder as __DbConnectionBuilder, + type DbConnectionConfig as __DbConnectionConfig, + DbConnectionImpl as __DbConnectionImpl, + type ErrorContextInterface as __ErrorContextInterface, + type EventContextInterface as __EventContextInterface, + makeQueryBuilder as __makeQueryBuilder, + procedures as __procedures, + procedureSchema as __procedureSchema, + type QueryBuilder as __QueryBuilder, + type ReducerEventContextInterface as __ReducerEventContextInterface, + reducers as __reducers, + reducerSchema as __reducerSchema, + type RemoteModule as __RemoteModule, + schema as __schema, + SubscriptionBuilderImpl as __SubscriptionBuilderImpl, + type SubscriptionEventContextInterface as __SubscriptionEventContextInterface, + type SubscriptionHandleImpl as __SubscriptionHandleImpl, + table as __table, } from "spacetimedb"; // Import all procedure arg schemas @@ -34,10 +34,10 @@ import * as AppSearchProcedure from "./app_search_procedure"; // Import all reducer arg schemas import CreateAccountReducer from "./create_account_reducer"; -import * as CreateAccountTokenProcedure from "./create_account_token_procedure"; import CreateAppTicketReducer from "./create_app_ticket_reducer"; import CreateLedgerReducer from "./create_ledger_reducer"; import CreateTransferReducer from "./create_transfer_reducer"; +import DeleteAppReducer from "./delete_app_reducer"; import FinalizeTransferReducer from "./finalize_transfer_reducer"; import GrantAccountMemberReducer from "./grant_account_member_reducer"; import LedgerAuditRow from "./ledger_audit_table"; @@ -46,18 +46,16 @@ import LedgerAuditRow from "./ledger_audit_table"; import LedgerRow from "./ledger_table"; import MyAccountsMembersRow from "./my_accounts_members_table"; import MyAccountsRow from "./my_accounts_table"; -import MyAccountsTokensRow from "./my_accounts_tokens_table"; import MyAppTicketsRow from "./my_app_tickets_table"; import MyAppsRow from "./my_apps_table"; import MyTransfersRow from "./my_transfers_table"; import MyUserRow from "./my_user_table"; import ReplaceAppTicketReducer from "./replace_app_ticket_reducer"; import RevokeAccountMemberReducer from "./revoke_account_member_reducer"; -import RevokeAccountTokensReducer from "./revoke_account_tokens_reducer"; import SetAccountLabelReducer from "./set_account_label_reducer"; import SetAccountPrimaryReducer from "./set_account_primary_reducer"; -import SetAccountWebhookReducer from "./set_account_webhook_reducer"; import UpdateAccountAddressReducer from "./update_account_address_reducer"; +import * as UserSearchProcedure from "./user_search_procedure"; import UserRow from "./user_table"; /** Type-only namespace exports for generated type groups. */ @@ -122,13 +120,6 @@ const tablesSchema = __schema({ constraints: [ ], }, MyAccountsMembersRow), - myAccountsTokens: __table({ - name: 'my_accounts_tokens', - indexes: [ - ], - constraints: [ - ], - }, MyAccountsTokensRow), myAppTickets: __table({ name: 'my_app_tickets', indexes: [ @@ -165,14 +156,13 @@ const reducersSchema = __reducers( __reducerSchema("create_app_ticket", CreateAppTicketReducer), __reducerSchema("create_ledger", CreateLedgerReducer), __reducerSchema("create_transfer", CreateTransferReducer), + __reducerSchema("delete_app", DeleteAppReducer), __reducerSchema("finalize_transfer", FinalizeTransferReducer), __reducerSchema("grant_account_member", GrantAccountMemberReducer), __reducerSchema("replace_app_ticket", ReplaceAppTicketReducer), __reducerSchema("revoke_account_member", RevokeAccountMemberReducer), - __reducerSchema("revoke_account_tokens", RevokeAccountTokensReducer), __reducerSchema("set_account_label", SetAccountLabelReducer), __reducerSchema("set_account_primary", SetAccountPrimaryReducer), - __reducerSchema("set_account_webhook", SetAccountWebhookReducer), __reducerSchema("update_account_address", UpdateAccountAddressReducer), ); @@ -181,7 +171,7 @@ const proceduresSchema = __procedures( __procedureSchema("account_lookup", AccountLookupProcedure.params, AccountLookupProcedure.returnType), __procedureSchema("account_search", AccountSearchProcedure.params, AccountSearchProcedure.returnType), __procedureSchema("app_search", AppSearchProcedure.params, AppSearchProcedure.returnType), - __procedureSchema("create_account_token", CreateAccountTokenProcedure.params, CreateAccountTokenProcedure.returnType), + __procedureSchema("user_search", UserSearchProcedure.params, UserSearchProcedure.returnType), ); type __SchemaWithTableAccessorAliases = Omit & { @@ -192,8 +182,6 @@ type __SchemaWithTableAccessorAliases = Omit & { readonly accessorName: "my_accounts" }; /** @deprecated Use `myAccountsMembers` instead. This alias will be removed in the next major version. */ readonly "my_accounts_members": Omit & { readonly accessorName: "my_accounts_members" }; - /** @deprecated Use `myAccountsTokens` instead. This alias will be removed in the next major version. */ - readonly "my_accounts_tokens": Omit & { readonly accessorName: "my_accounts_tokens" }; /** @deprecated Use `myAppTickets` instead. This alias will be removed in the next major version. */ readonly "my_app_tickets": Omit & { readonly accessorName: "my_app_tickets" }; /** @deprecated Use `myApps` instead. This alias will be removed in the next major version. */ @@ -208,7 +196,7 @@ type __SchemaWithTableAccessorAliases = Omit; -export const AccountToken = __t.object("AccountToken", { - id: __t.u64(), - accountId: __t.u64(), - token: __t.string(), - label: __t.string(), - createdBy: __t.identity(), - createdAt: __t.timestamp(), -}); -export type AccountToken = __Infer; - export const App = __t.object("App", { id: __t.identity(), name: __t.string(), @@ -184,20 +173,10 @@ export const MyAccountRow = __t.object("MyAccountRow", { }, isPrimary: __t.bool(), ownerUsername: __t.option(__t.string()), - webhook: __t.option(__t.string()), createdAt: __t.timestamp(), }); export type MyAccountRow = __Infer; -export const MyAccountTokenRow = __t.object("MyAccountTokenRow", { - id: __t.u64(), - accountId: __t.u64(), - label: __t.string(), - createdBy: __t.identity(), - createdAt: __t.timestamp(), -}); -export type MyAccountTokenRow = __Infer; - export const MyAppRow = __t.object("MyAppRow", { id: __t.identity(), name: __t.string(), @@ -316,14 +295,9 @@ export const User = __t.object("User", { }); export type User = __Infer; -export const WebhookDelivery = __t.object("WebhookDelivery", { - id: __t.u64(), - scheduledAt: __t.scheduleAt(), - accountId: __t.u64(), - transferId: __t.u64(), - url: __t.string(), - payloadJson: __t.string(), - attempts: __t.u32(), +export const UserSearchHit = __t.object("UserSearchHit", { + id: __t.identity(), + bitcraftUsername: __t.string(), }); -export type WebhookDelivery = __Infer; +export type UserSearchHit = __Infer; diff --git a/common/bindings/stelo/types/procedures.ts b/common/bindings/stelo/types/procedures.ts index 35322f04..f83fedca 100644 --- a/common/bindings/stelo/types/procedures.ts +++ b/common/bindings/stelo/types/procedures.ts @@ -9,7 +9,7 @@ import {type Infer as __Infer} from "spacetimedb"; import * as AccountLookupProcedure from "../account_lookup_procedure"; import * as AccountSearchProcedure from "../account_search_procedure"; import * as AppSearchProcedure from "../app_search_procedure"; -import * as CreateAccountTokenProcedure from "../create_account_token_procedure"; +import * as UserSearchProcedure from "../user_search_procedure"; export type AccountLookupArgs = __Infer; export type AccountLookupResult = __Infer; @@ -17,6 +17,6 @@ export type AccountSearchArgs = __Infer; export type AccountSearchResult = __Infer; export type AppSearchArgs = __Infer; export type AppSearchResult = __Infer; -export type CreateAccountTokenArgs = __Infer; -export type CreateAccountTokenResult = __Infer; +export type UserSearchArgs = __Infer; +export type UserSearchResult = __Infer; diff --git a/common/bindings/stelo/types/reducers.ts b/common/bindings/stelo/types/reducers.ts index 7bd90a86..0433bc96 100644 --- a/common/bindings/stelo/types/reducers.ts +++ b/common/bindings/stelo/types/reducers.ts @@ -10,27 +10,25 @@ import CreateAccountReducer from "../create_account_reducer"; import CreateAppTicketReducer from "../create_app_ticket_reducer"; import CreateLedgerReducer from "../create_ledger_reducer"; import CreateTransferReducer from "../create_transfer_reducer"; +import DeleteAppReducer from "../delete_app_reducer"; import FinalizeTransferReducer from "../finalize_transfer_reducer"; import GrantAccountMemberReducer from "../grant_account_member_reducer"; import ReplaceAppTicketReducer from "../replace_app_ticket_reducer"; import RevokeAccountMemberReducer from "../revoke_account_member_reducer"; -import RevokeAccountTokensReducer from "../revoke_account_tokens_reducer"; import SetAccountLabelReducer from "../set_account_label_reducer"; import SetAccountPrimaryReducer from "../set_account_primary_reducer"; -import SetAccountWebhookReducer from "../set_account_webhook_reducer"; import UpdateAccountAddressReducer from "../update_account_address_reducer"; export type CreateAccountParams = __Infer; export type CreateAppTicketParams = __Infer; export type CreateLedgerParams = __Infer; export type CreateTransferParams = __Infer; +export type DeleteAppParams = __Infer; export type FinalizeTransferParams = __Infer; export type GrantAccountMemberParams = __Infer; export type ReplaceAppTicketParams = __Infer; export type RevokeAccountMemberParams = __Infer; -export type RevokeAccountTokensParams = __Infer; export type SetAccountLabelParams = __Infer; export type SetAccountPrimaryParams = __Infer; -export type SetAccountWebhookParams = __Infer; export type UpdateAccountAddressParams = __Infer; diff --git a/common/bindings/stelo/create_account_token_procedure.ts b/common/bindings/stelo/user_search_procedure.ts similarity index 59% rename from common/bindings/stelo/create_account_token_procedure.ts rename to common/bindings/stelo/user_search_procedure.ts index 64163c60..4eafeacd 100644 --- a/common/bindings/stelo/create_account_token_procedure.ts +++ b/common/bindings/stelo/user_search_procedure.ts @@ -5,9 +5,10 @@ /* tslint:disable */ import {t as __t,} from "spacetimedb"; +import {UserSearchHit,} from "./types"; + export const params = { - accountId: __t.u64(), - label: __t.string(), - entropy: __t.string(), + term: __t.string(), + exclude: __t.array(__t.identity()), }; -export const returnType = __t.result(__t.string(), __t.string()) \ No newline at end of file +export const returnType = __t.result(__t.array(UserSearchHit), __t.string()) \ No newline at end of file