Add persisted market location selector for Jita-default price lookups #48

Closed
opened 2026-08-06 07:22:34 +02:00 by Sirttas · 0 comments
Owner

Summary

Several pages fetch market prices without passing a locationId, which silently defaults to Jita server-side. Add a market location selector, persisted to localStorage, so users can price against a location of their choosing instead of the implicit Jita default.

Scope

  • New useMarketLocationStore in src/market/location/location.ts (alongside the existing MarketLocation.ts), following the useMarketTaxStore (src/market/tax/tax.ts) localStorage-backed Pinia pattern.
    • Holds a single global selection — one MarketLocation shared by all call sites below, not a per-page choice.
    • The ref is non-optional (MarketLocation, not MarketLocation | undefined) and seeded on first use with a hardcoded Jita stub:
      { id: 60003760, name: 'Jita IV - Moon 4 - Caldari Navy Assembly Plant', systemId: 30000142, systemName: 'Jita', regionId: 10000002, regionName: 'The Forge' }
      
    • The selector is never clearable back to "no selection" — it always holds a concrete location.
  • Add a MarketLocationInput (existing component, currently only used locally in CompareAppraisal.vue) bound to this store directly on each of the 4 pages below — not a shared sidebar/topbar control:
    • TypeInfo.vue — wire store.location.id into getPrice(item)
    • Appraise.vue — wire store.location.id into appraise(items)
    • AcquisitionsPanel.vue — wire store.location.id into getPrices(types) (shared by Acquisitions.vue and ViewLedgerAcquisitions.vue)
    • ViewLedger.vue — wire store.location.id into appraiseItemBalances's getPrices call
    • All four call sites already accept an optional locationId param — no backend/API changes needed.
  • Price refresh on location change happens through each page's existing reactivity/refresh mechanism only — no new auto-refresh watchers are added:
    • TypeInfo.vue / ViewLedger.vue: naturally reactive via existing computedAsync.
    • AcquisitionsPanel.vue: picked up on the existing manual "Refresh" button / auto-refresh toggle.
    • Appraise.vue: picked up on the existing "Send" button.

Explicitly out of scope

  • CompareAppraisal.vue's own from/to selectors — those are already explicit per-comparison inputs, not the Jita-default path this issue targets.
  • Endpoints with no locationId parameter at all (scanMarketType, scanMarket, findQuartiles) — server-fixed location, unaffected by a client-side selector.
  • Any new reactivity/auto-refresh plumbing beyond what each page already has.

Acceptance criteria

  • useMarketLocationStore exists, persists to localStorage, and is seeded with the Jita stub on first use.
  • All four call sites pass store.location.id as locationId and show a MarketLocationInput bound to the store.
  • Changing the location on one page updates the same global selection reflected by the input on the other three pages.
  • CompareAppraisal.vue behavior is unchanged.

Related

Part of the item-comparison epic (appraise & compare items across market locations).

## Summary Several pages fetch market prices without passing a `locationId`, which silently defaults to Jita server-side. Add a market location selector, persisted to localStorage, so users can price against a location of their choosing instead of the implicit Jita default. ## Scope - New `useMarketLocationStore` in `src/market/location/location.ts` (alongside the existing `MarketLocation.ts`), following the `useMarketTaxStore` (`src/market/tax/tax.ts`) localStorage-backed Pinia pattern. - Holds a single **global** selection — one `MarketLocation` shared by all call sites below, not a per-page choice. - The ref is **non-optional** (`MarketLocation`, not `MarketLocation | undefined`) and seeded on first use with a hardcoded Jita stub: ```ts { id: 60003760, name: 'Jita IV - Moon 4 - Caldari Navy Assembly Plant', systemId: 30000142, systemName: 'Jita', regionId: 10000002, regionName: 'The Forge' } ``` - The selector is never clearable back to "no selection" — it always holds a concrete location. - Add a `MarketLocationInput` (existing component, currently only used locally in `CompareAppraisal.vue`) bound to this store directly on each of the 4 pages below — not a shared sidebar/topbar control: - `TypeInfo.vue` — wire `store.location.id` into `getPrice(item)` - `Appraise.vue` — wire `store.location.id` into `appraise(items)` - `AcquisitionsPanel.vue` — wire `store.location.id` into `getPrices(types)` (shared by `Acquisitions.vue` and `ViewLedgerAcquisitions.vue`) - `ViewLedger.vue` — wire `store.location.id` into `appraiseItemBalances`'s `getPrices` call - All four call sites already accept an optional `locationId` param — no backend/API changes needed. - Price refresh on location change happens through each page's **existing** reactivity/refresh mechanism only — no new auto-refresh watchers are added: - `TypeInfo.vue` / `ViewLedger.vue`: naturally reactive via existing `computedAsync`. - `AcquisitionsPanel.vue`: picked up on the existing manual "Refresh" button / auto-refresh toggle. - `Appraise.vue`: picked up on the existing "Send" button. ## Explicitly out of scope - `CompareAppraisal.vue`'s own `from`/`to` selectors — those are already explicit per-comparison inputs, not the Jita-default path this issue targets. - Endpoints with no `locationId` parameter at all (`scanMarketType`, `scanMarket`, `findQuartiles`) — server-fixed location, unaffected by a client-side selector. - Any new reactivity/auto-refresh plumbing beyond what each page already has. ## Acceptance criteria - [x] `useMarketLocationStore` exists, persists to localStorage, and is seeded with the Jita stub on first use. - [x] All four call sites pass `store.location.id` as `locationId` and show a `MarketLocationInput` bound to the store. - [x] Changing the location on one page updates the same global selection reflected by the input on the other three pages. - [x] `CompareAppraisal.vue` behavior is unchanged. ## Related Part of the `item-comparison` epic (appraise & compare items across market locations).
Sirttas added the item-comparison
Priority
Medium
3
Kind/Feature
Status
To Refine
labels 2026-08-06 07:22:34 +02:00
Sirttas removed the
Status
To Refine
label 2026-08-06 07:31:30 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eveal/gemory#48