diff --git a/src/components/PriceCell.vue b/src/components/PriceCell.vue index a8d9cc9..70c9068 100644 --- a/src/components/PriceCell.vue +++ b/src/components/PriceCell.vue @@ -35,7 +35,7 @@ const vFocus = { mounted: (el: HTMLElement) => el.focus() } const props = defineProps<{ itemId: string }>() -const { getPrice, isManualPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices() +const { getPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices() const { filters } = useFilters() const editing = ref(false) @@ -46,25 +46,22 @@ const city = computed(() => filters.value.city) const entry = computed(() => getPrice(props.itemId, city.value)) const currentPrice = computed(() => entry.value?.sell_price_min ?? 0) -const isManual = computed(() => isManualPrice(props.itemId, city.value)) const displayText = computed(() => currentPrice.value > 0 ? formatSilver(currentPrice.value) : '—' ) -const cellClass = computed(() => { - if (isManual.value) return 'text-amber-400 hover:text-amber-200' - if (currentPrice.value === 0) return 'text-gray-600 hover:text-amber-400' - return 'text-gray-300 hover:text-gray-100' -}) +const cellClass = computed(() => + currentPrice.value > 0 ? 'text-amber-400 hover:text-amber-200' : 'text-gray-600 hover:text-amber-400' +) const tooltip = computed(() => { - const exact = currentPrice.value > 0 ? currentPrice.value.toLocaleString() : null const e = getManualEntry(props.itemId, city.value) - if (e && isManual.value) { - return exact ? `${exact} — set ${formatLastUpdated(new Date(e.editedAt))} — click to edit` : `Set ${formatLastUpdated(new Date(e.editedAt))} — click to edit` + if (e) { + const exact = currentPrice.value.toLocaleString() + return `${exact} — set ${formatLastUpdated(new Date(e.editedAt))} — click to edit` } - return exact ? `${exact} — click to edit` : 'Click to set price' + return 'Click to set price' }) function startEdit(initial?: number) { diff --git a/src/components/table/ProfitRow.vue b/src/components/table/ProfitRow.vue index ed8014c..2ba1af7 100644 --- a/src/components/table/ProfitRow.vue +++ b/src/components/table/ProfitRow.vue @@ -263,7 +263,7 @@ const props = defineProps<{ result: ProfitResult }>() -const { isManualPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices() +const { getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices() const { filters } = useFilters() const { upsert, remove, getQty, inOrder } = useProductionOrder() @@ -345,23 +345,16 @@ function ageDotTitle(result: ProfitResult): string { // ─── Price cell helpers ─────────────────────────────────────────────────────── -function priceButtonClass(itemId: string, currentPrice: number): string { - if (isManualPrice(itemId, filters.value.city)) { - return 'text-amber-400 hover:text-amber-200' - } - if (currentPrice === 0) { - return 'text-gray-500 hover:text-amber-400' - } - return 'text-gray-300 hover:text-gray-100' +function priceButtonClass(_itemId: string, currentPrice: number): string { + return currentPrice > 0 ? 'text-amber-400 hover:text-amber-200' : 'text-gray-500 hover:text-amber-400' } function priceTitle(itemId: string, currentPrice: number): string { - const exact = currentPrice > 0 ? currentPrice.toLocaleString() : null const entry = getManualEntry(itemId, filters.value.city) - if (entry && isManualPrice(itemId, filters.value.city)) { - return exact ? `${exact} — set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit` : `Set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit` + if (entry) { + return `${currentPrice.toLocaleString()} — set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit` } - return exact ? `${exact} — click to set price` : 'Click to set price' + return 'Click to set price' } // ─── Edit state ─────────────────────────────────────────────────────────────── diff --git a/src/pages/PricesPage.vue b/src/pages/PricesPage.vue index cc3b60e..72c8380 100644 --- a/src/pages/PricesPage.vue +++ b/src/pages/PricesPage.vue @@ -6,7 +6,7 @@

Price Editor

- Amber = manual override · Click any price to edit · Empty field to clear override + Amber = price set · Click any price to edit · Leave empty to clear
diff --git a/src/pages/ProductionPage.vue b/src/pages/ProductionPage.vue index 0ba172f..4b1851c 100644 --- a/src/pages/ProductionPage.vue +++ b/src/pages/ProductionPage.vue @@ -238,7 +238,7 @@ import type { Tier, JournalType } from '../types/crafting' const vFocus = { mounted: (el: HTMLElement) => el.focus() } const { orderItems, upsert, remove, clear } = useProductionOrder() -const { getPrice, isManualPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices() +const { getPrice, getManualEntry, setManualPrice, clearManualPrice } = useAlbionPrices() const { filters } = useFilters() // ─── Inline price editing ───────────────────────────────────────────────────── @@ -267,21 +267,16 @@ function cancelEdit() { inputValue.value = '' } -function priceButtonClass(itemId: string, currentPrice: number): string { - if (isManualPrice(itemId, filters.value.city)) return 'text-amber-400 hover:text-amber-200' - if (currentPrice === 0) return 'text-gray-500 hover:text-amber-400' - return 'text-gray-300 hover:text-gray-100' +function priceButtonClass(_itemId: string, currentPrice: number): string { + return currentPrice > 0 ? 'text-amber-400 hover:text-amber-200' : 'text-gray-500 hover:text-amber-400' } function priceTitle(itemId: string, currentPrice: number): string { - const exact = currentPrice > 0 ? currentPrice.toLocaleString() : null const entry = getManualEntry(itemId, filters.value.city) - if (entry && isManualPrice(itemId, filters.value.city)) { - return exact - ? `${exact} — set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit` - : `Set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit` + if (entry) { + return `${currentPrice.toLocaleString()} — set ${formatLastUpdated(new Date(entry.editedAt))} — click to edit` } - return exact ? `${exact} — click to set price` : 'Click to set price' + return 'Click to set price' } // ─── Order sort ───────────────────────────────────────────────────────────────