Opening a listing's detail sheet for >3s now passively marks it `seen` and snapshots its current `total_price`. Seen listings are hidden from the main list by default but automatically resurface when the price changes (any direction). Distinct from `disliked` — explicit like/dislike always overrides the passive seen state. New "Hidden (N)" toggle on the FilterBar appears whenever at least one listing is currently being hidden by the seen filter. Toggling it reveals those rows in-place (without unmarking them) so the user can review or explicitly clear via the existing Like/Dislike/Clear flow. ## Backend - Alembic f7a8b9c0d1e2: `ALTER TABLE listingdecision ADD COLUMN price_at_decision FLOAT NULL`. - `models/decision.py`: ListingDecision gains nullable `price_at_decision: float | None`. - `services/decision_service.py`: adds `seen` to VALID_DECISIONS; set_decision accepts an optional `price_at_decision`; it's only forwarded to the repo for decision='seen' (other types null-out the column to keep semantics clean). - `repositories/decision_repository.py`: upsert_decision now carries price_at_decision through the MySQL + SQLite upsert paths. - `api/decision_routes.py`: SetDecisionRequest + DecisionResponse expose the new field. ## Frontend - `types/index.ts`: DecisionType = 'liked' | 'disliked' | 'seen'; ListingDecision gains `price_at_decision?: number | null`. - `services/decisionService.ts`: setDecision sends the price only for decision='seen' (and only when it's a finite number). - `hooks/useDecisions.ts`: rewritten to store `Map<key, DecisionEntry>` (decision + price snapshot). New `markSeen(id, price, type)` short- circuits on existing liked/disliked. New `getDecisionEntry`, `seenCount`. - `App.tsx`: 3s `setTimeout` dwell timer fires markSeen when the detail sheet stays open. Filter logic in `processedListingData` hides `seen` rows whose `total_price === price_at_decision`, with `showHidden` bypass. Computes `hiddenCount` to drive the toggle. - `components/FilterBar.tsx`: new conditional "Hidden (N)" / "Showing hidden (N)" toggle button (Eye / EyeOff lucide icons), surfaces only when hiddenCount > 0. ## Tests - pytest: 2 new (test_set_seen_carries_price, test_liked_drops_price_ even_if_supplied) + 1 updated to assert the new 5-arg repo signature. 24 passed. - vitest: 6 new for useDecisions (markSeen liked/disliked skip, price snapshot, re-mark, null price, seenCount) + 5 new for decisionService payload shape. 221 total passed, tsc clean. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| .github/workflows | ||
| .woodpecker | ||
| alembic | ||
| api | ||
| cli | ||
| config | ||
| docs | ||
| frontend | ||
| grafana | ||
| k8s | ||
| models | ||
| rec | ||
| repositories | ||
| scripts | ||
| services | ||
| tasks | ||
| tests | ||
| utils | ||
| .dockerignore | ||
| .env.sample | ||
| .gitignore | ||
| .style.yapf | ||
| alembic.ini | ||
| celery_app.py | ||
| CLAUDE.md | ||
| csv_exporter.py | ||
| data_access.py | ||
| database.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| GUIDE | ||
| listing_processor.py | ||
| logging_config.py | ||
| main.py | ||
| notifications.py | ||
| podman-compose.yml | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
| redis_repository.py | ||
| requirements.txt | ||
| runall.sh | ||
| start.sh | ||
| TASKS.md | ||
| ui_exporter.py | ||
Setup
- Instal deps:
poetry install && cp .env.sample .env
- Check
.envif you want to customize settings for broker and db - run
./start.sh
This starts the backend
To start the fronend:
cd frontend && cp .env.sample .env
Change the DEV_HOST to any name you want to use to access the web interface.
Next, setup the DNS record (e.g in your /etc/hosts) file. This is important as auth is done via external [authentik] service that needs to redirect to a name.
Run ./start.sh
This starts a Caddy proxy with correct certificates, and npm dev server.
All requests going to the frontend are forwarded to the npm server and the ones for the backed (that go to /api/*) are forwarded to the backend service.
Lastly, reachout to Viktor to allowlist your DEV_HOST so that authentik can authorize callbacks to your host.
Formatting
yapf --style .style.yapf --recursive .
For VSCode - install yapf extension. Enable formatting using yap and the style file in this repo (there may be an easier way; I put this in my user settings json):
{
"[python]": {
"editor.formatOnSaveMode": "file",
"editor.formatOnSave": true,
"editor.defaultFormatter": "eeyore.yapf",
"editor.formatOnType": false
},
"yapf.args": ["--style", "/home/wizard/code/realestate-crawler/crawler/.style.yapf"]
}
ADB commands (from /Applications/BlueStacks.app/Contents/MacOS):
Set proxy
./hd-adb shell settings put global http_proxy 192.168.9.110:8080
Disable proxy:
/hd-adb shell settings put global http_proxy :0
Connect adb
./hd-adb connect 127.0.0.1:5555
Disconnect adb
/hd-adb disconnect