From 7384566f7f232f012f75bd2563d150ea182bfa23 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Sat, 31 Oct 2026 11:15:54 +0100 Subject: [PATCH] fix: market forms accept any whole amount (no step validation), the target placeholder shows x|y, names keep their gap, offers stack Accept under the count on phones, intervals read "1 d", a refused offer list stops loading, the merchant count turns red when none are free Co-Authored-By: Claude Opus 5.5 (1M context) --- app/components/market/Amounts.vue | 2 +- app/components/market/Interval.vue | 2 +- app/components/market/MyOffers.vue | 7 ++++--- app/components/market/Routes.vue | 2 +- app/components/market/Trades.vue | 2 +- app/components/market/WorldOffers.vue | 4 ++-- app/components/report/Trade.vue | 2 +- app/components/village/Market.vue | 2 +- app/utils/market.ts | 2 +- i18n/pages/market.ts | 5 +++-- 10 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/components/market/Amounts.vue b/app/components/market/Amounts.vue index fc45541..c5af74f 100644 --- a/app/components/market/Amounts.vue +++ b/app/components/market/Amounts.vue @@ -37,7 +37,7 @@ function most(r: TradeResource) { v-model.number="amounts[r]" type="number" min="0" - step="100" + inputmode="numeric" class="input w-20 px-1.5 py-0.5 text-right tabular-nums" :aria-label="$t('market.amount_of', { resource: $t(`resources.${r}`) })" diff --git a/app/components/market/Interval.vue b/app/components/market/Interval.vue index 7b01ab9..871eaca 100644 --- a/app/components/market/Interval.vue +++ b/app/components/market/Interval.vue @@ -24,7 +24,7 @@ const outside = computed(() => every.value < props.min || every.value > props.ma {{ $t('market.routes.h') }} - + {{ $t('market.routes.min') }}

diff --git a/app/components/market/MyOffers.vue b/app/components/market/MyOffers.vue index f92a463..04e6e96 100644 --- a/app/components/market/MyOffers.vue +++ b/app/components/market/MyOffers.vue @@ -57,13 +57,13 @@ async function submit() { - + - + @@ -78,7 +78,8 @@ async function submit() { {{ $t('market.merchants_needed', { needed: merchants, merchants: market.free }) }}

  • - {{ $t('market.mine.reserved', { amount: reserved, resource: $t(`resources.${give}`) }) }} + {{ $t('market.mine.reserved') }} + {{ reserved }}
  • {{ problem }}

    diff --git a/app/components/market/Routes.vue b/app/components/market/Routes.vue index ab3f2e4..c487632 100644 --- a/app/components/market/Routes.vue +++ b/app/components/market/Routes.vue @@ -81,7 +81,7 @@ const mapLink = (r: TradeRoute) => ({ path: `/map/${props.worldId}`, query: { x: {{ villageLabel(r.to) }} - {{ r.to.player?.name }} + {{ r.to.player?.name }} {{ $t('market.routes.every_n', { every: formatInterval(r.every, t) }) }} diff --git a/app/components/market/Trades.vue b/app/components/market/Trades.vue index 88c7a2a..6a8b539 100644 --- a/app/components/market/Trades.vue +++ b/app/components/market/Trades.vue @@ -47,7 +47,7 @@ const other = (x: Trade): VillageRef => (x.kind === 'out' ? x.to : x.from)
    {{ title(x) }} - {{ $t('market.trades.by', { player: x.from.player.name }) }} + {{ $t('market.trades.by', { player: x.from.player.name }) }}
    diff --git a/app/components/market/WorldOffers.vue b/app/components/market/WorldOffers.vue index 5cf824e..b3d13b2 100644 --- a/app/components/market/WorldOffers.vue +++ b/app/components/market/WorldOffers.vue @@ -24,7 +24,7 @@ async function load() { const filters = [give.value, want.value] const result = await props.offers(give.value, want.value) // Drop answers for filters that changed meanwhile. - if (filters[0] === give.value && filters[1] === want.value) list.value = result + if (filters[0] === give.value && filters[1] === want.value) list.value = result ?? { server_time: '', offers: [] } loading.value = false } watch([give, want], load, { immediate: true }) @@ -110,7 +110,7 @@ const mapLink = (o: WorldOffer) => ({ path: `/map/${props.worldId}`, query: { x: {{ $t('market.offers.own') }} - + ({ path: `/map/${props.worldId}`, query: { x: {{ $t(`reports.trade.${side}`) }} {{ villageLabel(report[side]) }} - {{ report[side].player?.name ?? $t('common.barbarian') }} + {{ report[side].player?.name ?? $t('common.barbarian') }} diff --git a/app/components/village/Market.vue b/app/components/village/Market.vue index ec2a2ef..c8e5114 100644 --- a/app/components/village/Market.vue +++ b/app/components/village/Market.vue @@ -37,7 +37,7 @@ const initialTarget = computed(() => (route.query.x && route.query.y ? { x: Numb
    - + {{ $t('market.merchants_free', { free: state.market.free, merchants: state.market.merchants }) }} diff --git a/app/utils/market.ts b/app/utils/market.ts index a4d0ce5..102fe98 100644 --- a/app/utils/market.ts +++ b/app/utils/market.ts @@ -8,7 +8,7 @@ export function formatInterval(seconds: number, t: Translate) { const days = Math.floor(m / 1440) const hours = Math.floor((m % 1440) / 60) const minutes = m % 60 - if (days) return t('market.interval.dh', { d: days, h: hours }) + if (days) return hours ? t('market.interval.dh', { d: days, h: hours }) : t('market.interval.d', { d: days }) if (hours && minutes) return t('market.interval.hm', { h: hours, m: minutes }) if (hours) return t('market.interval.h', { h: hours }) return t('market.interval.m', { m: minutes }) diff --git a/i18n/pages/market.ts b/i18n/pages/market.ts index 24d408e..73786ea 100644 --- a/i18n/pages/market.ts +++ b/i18n/pages/market.ts @@ -36,7 +36,7 @@ export default { merchants_needed: 'Merchants needed: {needed} of {merchants} free', merchants_per_run: 'Merchants per run: {needed} of {merchants}', target: 'Target', - target_placeholder: 'x|y', + target_placeholder: "x{'|'}y", village: 'Village', distance: 'Distance', fields: '{fields} fields', @@ -77,7 +77,7 @@ export default { count: 'Times', count_hint: 'one trade each', ratio: 'You ask {ratio} for each 1 you give; at most {max} times as much either way.', - reserved: 'Held back while the offer is open: {amount} {resource}', + reserved: 'Held back while the offer is open:', submit: 'Post offer', open: 'Open offers', merchants: 'Merchants', @@ -115,6 +115,7 @@ export default { submit: 'Create route', }, interval: { + d: '{d} d', dh: '{d} d {h} h', hm: '{h} h {m} min', h: '{h} h',