Compare commits

..

15 Commits

Author SHA1 Message Date
2eff97200a Merge pull request 'feat(add-item): photo → Claude vision suggests name + category' (#13) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 50s
Reviewed-on: #13
2026-10-30 14:32:36 +01:00
Henrik Jess Nielsen
6c0f109499 Merge remote-tracking branch 'refs/remotes/origin/main'
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 48s
2026-10-30 14:23:54 +01:00
Henrik Jess Nielsen
02a048c455 Loads of training matrial 2026-10-30 14:23:39 +01:00
5ec27cb3bf Merge pull request 'chore(header): Lübeck store, drop stale dates, link the Lübeck avis' (#12) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 41s
Reviewed-on: #12
2026-10-30 14:17:01 +01:00
d464fe9edc Merge pull request 'worktree-citti-arkiver-tur' (#11) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 49s
Reviewed-on: #11
2026-10-30 13:59:38 +01:00
dfac0f67ad Merge pull request 'worktree-citti-arkiver-tur' (#10) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 41s
Reviewed-on: #10
2026-10-30 13:46:36 +01:00
ec403f4324 Merge pull request 'worktree-citti-arkiver-tur' (#9) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 47s
Reviewed-on: #9
2026-10-30 13:29:44 +01:00
12a4e197f3 Merge pull request 'worktree-citti-arkiver-tur' (#8) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 43s
Reviewed-on: #8
2026-10-30 12:53:39 +01:00
6de7b02aba Merge pull request 'worktree-citti-arkiver-tur' (#7) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 44s
Reviewed-on: #7
2026-10-30 12:28:47 +01:00
90ed399cd9 Merge pull request 'fix(offers): survive Claude rate limits (429)' (#6) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 45s
Reviewed-on: #6
2026-10-30 12:09:37 +01:00
92fa8df574 Merge pull request 'worktree-citti-arkiver-tur' (#5) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 1m57s
Reviewed-on: #5
2026-10-30 12:00:31 +01:00
ed2121e4f8 Merge pull request 'worktree-citti-arkiver-tur' (#4) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 46s
Reviewed-on: #4
2026-10-30 11:47:44 +01:00
b7141d787b Merge pull request 'fix(offers): DE→DA translation returned nothing — disable thinking, batch big' (#3) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 41s
Reviewed-on: #3
2026-10-30 11:23:41 +01:00
21c870189f Merge pull request 'worktree-citti-arkiver-tur' (#2) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 1m4s
Reviewed-on: #2
2026-10-30 11:09:31 +01:00
b0eef226ce Merge pull request 'worktree-citti-arkiver-tur' (#1) from worktree-citti-arkiver-tur into main
All checks were successful
Build and Deploy citti / build-and-deploy (push) Successful in 1m4s
Reviewed-on: #1
2026-10-30 10:44:55 +01:00
3 changed files with 11 additions and 37 deletions

Submodule .claude/worktrees/citti-arkiver-tur added at b2390c4495

12
app.py
View File

@@ -423,12 +423,9 @@ def match_offers_ai():
# Skip the (daily) match call when the offer set hasn't changed since the
# last successful match — the avis only turns over weekly, so this avoids a
# pointless Claude call most days. The leading version forces a re-match
# whenever the matching logic/prompt changes (bump it when editing them).
MATCH_VERSION = "v2-standard-not-premium"
# pointless Claude call most days.
sig = hashlib.md5(
(MATCH_VERSION + "\n" + "\n".join(
sorted(o['id'] + '|' + (o.get('heading') or '') for o in offers)))
"\n".join(sorted(o['id'] + '|' + (o.get('heading') or '') for o in offers))
.encode('utf-8')).hexdigest()
with get_db() as c:
if _meta_get(c, 'last_match_sig') == sig and \
@@ -455,10 +452,7 @@ def match_offers_ai():
"findes. Vær striks: match kun når det tydeligt er samme varetype "
"(fx entrecôte↔entrecôte-tilbud). Match IKKE blot på mærke eller løst "
"beslægtede varer (fx 'Nutella 1kg glas' må IKKE matche 'Nutella "
"julekalender'). Når varen er generisk (fx 'Entrecote ½ kg'), vælg den "
"ALMINDELIGE/standard variant til den LAVESTE pris — undgå premium-/"
"luksus-varianter (Wagyu, Dry-Aged, US-Beef, øko-premium) medmindre varen "
"selv nævner det, da de giver et urealistisk højt estimat. Returnér KUN et "
"julekalender'). Vælg det billigste ved flere ens. Returnér KUN et "
'JSON-array [{"item_key":"...","offer_id":"..."}] med de sikre match, '
"intet andet.")
client = anthropic.Anthropic(max_retries=CLAUDE_MAX_RETRIES)

View File

@@ -71,7 +71,6 @@
.item-name { padding: 0.7rem 0.5rem; font-size: 14px; }
.item-name .note { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }
.item-name .de { font-size: 10px; color: #b0aba3; display: block; margin-top: 0; font-style: italic; }
.item-name .row-est-m { display: none; font-size: 10px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.badge { display: inline-block; font-size: 9px; padding: 1px 5px; border-radius: 3px; margin-left: 5px; vertical-align: middle; font-weight: 500; }
.badge-card { background: var(--blue-light); color: var(--blue); }
.badge-kasse { background: var(--amber-light); color: var(--amber); }
@@ -170,7 +169,6 @@
.header-actions { flex-direction: row; align-items: center; }
.item-row { grid-template-columns: 28px 1fr 64px 78px; }
.item-est { display: none; }
.item-name .row-est-m { display: block; }
.col-headers { grid-template-columns: 28px 1fr 64px 78px; }
.col-h:nth-child(4) { display: none; }
.extra-item-row { grid-template-columns: 28px 1fr auto auto; }
@@ -268,7 +266,6 @@
{% if item.get('note') %}<span class="note">{{ item.note }}</span>{% endif %}
{% set d = deals.get(item.key) %}
{% if d %}<a class="deal" href="/tilbud" title="{{ d.heading }} ({{ d.catalog }})">🏷 på tilbud: {{ "{:.2f}".format(d.price_eur).replace(".",",") }} € ≈ {{ "{:.0f}".format(d.price_eur * eur_dkk) }} kr. · {{ d.heading_da or d.heading }}</a>{% endif %}
<span class="row-est-m"></span>
</div>
<div class="item-qty">
<input type="text" value="{{ s.get('qty') or item.qty }}" placeholder="{{ item.qty }}"
@@ -712,34 +709,16 @@ function recalcAll() {
// picked offers), live from each row's data-est. Reflects add/remove/pick.
let est = 0;
document.querySelectorAll('[data-est]').forEach(r => {
const qi = r.querySelector('.item-qty input');
const offer = offerLineDkk(r); // real offer price if matched
let line;
if (offer != null) {
line = offer;
} else {
line = parseFloat(r.dataset.est) || 0;
if (qi) { // scale estimate with quantity
const cur = qtyNum(qi.value.trim() || qi.placeholder);
const def = qtyNum(qi.placeholder);
if (cur != null && def != null && def > 0) line = line * (cur / def);
}
}
est += line;
// Per-row display: computed estimate + ½kg price (for weight items). The
// est column is hidden on phones, so also fill the mobile sub-line.
if (offer != null) { est += offer; return; }
let base = parseFloat(r.dataset.est) || 0;
const qi = r.querySelector('.item-qty input'); // scale estimate with quantity
if (qi) {
const col = r.querySelector('.item-est');
if (col) col.textContent = line > 0 ? Math.round(line).toLocaleString('da-DK') : '—';
const sub = r.querySelector('.row-est-m');
if (sub) {
const kg = qtyToKg(qi.value.trim() || qi.placeholder);
const per500 = (kg > 0 && line > 0) ? Math.round(line / kg * 0.5) : null;
sub.textContent = (line > 0 ? 'est ' + Math.round(line).toLocaleString('da-DK') + ' kr' : '')
+ (per500 ? ' · ½kg ' + per500 + ' kr' : '');
}
const cur = qtyNum(qi.value.trim() || qi.placeholder);
const def = qtyNum(qi.placeholder);
if (cur != null && def != null && def > 0) base = base * (cur / def);
}
est += base;
});
document.getElementById('stat-est').textContent = est > 0 ? Math.round(est).toLocaleString('da-DK') : '—';