Cabin names, unsaved-change highlight, collapsible matches

- Cabins are Economy / Premium / Business everywhere; the config stores
  economy/premium/business and still accepts AG/AP/AB and Go/Plus
- Config fields that differ from the saved config get a faded yellow
  background, new rows are highlighted in full, removed rows are counted;
  reverting a field clears its highlight and Save disables when clean
- Current matches collapse per watch to a summary row: flight counts,
  bookable seats per cabin with lost seats in red, latest "since";
  open/closed state is remembered

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Måns SivertssonandClaude Opus 5.5 committed 2026-10-13 08:37:40 +02:00
1 parent f1acd53a9c
commit cb3528d8b0
3 files changed
+136 -55

No files matched your search

+11 -6
View File
@@ -4,7 +4,7 @@ A Tampermonkey / Violentmonkey userscript that watches SAS EuroBonus award avail
seats you care about appear. It runs inside your own browser, so requests to sas.se are ordinary same-origin
browser requests and it keeps working behind sas.se's Cloudflare protection.
- Any number of **watches**: origins, destinations, one travel window, cabins (Go / Plus / Business), seats, max stops
- Any number of **watches**: origins, destinations, one travel window, cabins (Economy / Premium / Business), seats, max stops
- Finds **outbound and return** flights inside the window; optionally only alerts when both legs exist, with min/max nights
- **Gentle on sas.se**: about one request a minute, a full sweep at most every 15 minutes, backs off when refused
- Alerts via **ntfy** (phone push), **Discord**, **Slack**, any **webhook**, and desktop notifications
@@ -34,7 +34,7 @@ In the **Config** section of the dashboard:
| On | Pause a watch without deleting it |
| From / To | Airport codes, comma-separated (`ARN, CPH`). Every From × To pair is checked |
| Earliest / Latest | Travel window. Outbound **and** return flights departing in it are found |
| Cabins | Go (AG), Plus (AP), Business (AB) |
| Cabins | Economy, Premium (premium economy), Business |
| Seats | Seats needed **on the same flight** |
| Stops | Any, direct only, or at most 1 / 2 stops |
| Both legs | Only alert when an outbound has a later return in the window (default on). Off = alert for either direction on its own |
@@ -60,10 +60,15 @@ Under the tables, **JSON – export / import / reset** holds the same config as
*Download .json* for a backup, *Load file…* or paste + *Apply JSON to tables* to restore,
*Reset to example* to start over. Nothing takes effect until you press **Save & restart**.
Fields that differ from the saved config are highlighted in yellow until you save or discard; new rows are
highlighted in full.
## Dashboard
- **Current matches** per watch:
- `Go ×8 −2` – bookable now; the red number is how many seats were taken since the highest count seen
- **Current matches** per watch, collapsed to a summary row by default (click the header or the summary to expand):
- summary: number of flights, bookable seats per cabin with how many were lost in red (`Economy ×30 −6`), and
when the most recent flight appeared
- `Economy ×8 −2` – bookable now; the red number is how many seats were taken since the highest count seen
- red, struck through, *gone 12 okt 13:42* – sold out (or below your seat count); kept for two weeks or until departure
- grey, *no matching return* – still has seats, but its return disappeared (with Both legs)
- **Recent changes**: `+` new / back, `▲` more seats, `▼` fewer seats, `−` gone, `○` lost its return
@@ -98,7 +103,7 @@ Only one tab polls at a time, so opening the dashboard twice does not double the
The script header points Tampermonkey at this repo:
```
// @version 1.1.1
// @version 1.2.0
// @updateURL https://gitea.mscloud.site/mans/sas-bonus-watch/raw/branch/main/sas-bonus-watch.user.js
// @downloadURL https://gitea.mscloud.site/mans/sas-bonus-watch/raw/branch/main/sas-bonus-watch.user.js
```
@@ -121,7 +126,7 @@ Requirements:
1. Edit `sas-bonus-watch.user.js`.
2. Run the tests: `node --test` (Node 20+).
3. **Bump `@version`** (e.g. 1.1.1 → 1.1.2). Without this, nobody gets the update.
3. **Bump `@version`** (e.g. 1.2.0 → 1.2.1). Without this, nobody gets the update.
4. Commit and push to `main`.
## Development