Don't mark a job as seen when opening it
Jobs now stay in New until 'Mark seen' is clicked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ WantedBy=multi-user.target
|
|||||||
|
|
||||||
## UI
|
## UI
|
||||||
|
|
||||||
- **New / Seen / All** tabs. Opening a job, or clicking *Mark seen*, moves it to Seen.
|
- **New / Seen / All** tabs. Click *Mark seen* to move a job to Seen (opening a job does not mark it).
|
||||||
- **no longer listed** means the job was missing from that source's latest successful scrape.
|
- **no longer listed** means the job was missing from that source's latest successful scrape.
|
||||||
- Search filters on title, company and tags. Recent scrape runs (and errors) are listed at the bottom.
|
- Search filters on title, company and tags. Recent scrape runs (and errors) are listed at the bottom.
|
||||||
|
|
||||||
|
|||||||
@@ -175,17 +175,6 @@ function page(url: URL) {
|
|||||||
}
|
}
|
||||||
document.querySelectorAll(".job").forEach((li) => {
|
document.querySelectorAll(".job").forEach((li) => {
|
||||||
li.querySelector(".toggle").addEventListener("click", () => setSeen(li, !li.classList.contains("seen")));
|
li.querySelector(".toggle").addEventListener("click", () => setSeen(li, !li.classList.contains("seen")));
|
||||||
// Opening a job counts as seeing it (the card stays until you reload).
|
|
||||||
li.querySelector(".title").addEventListener("click", () => {
|
|
||||||
if (li.classList.contains("seen")) return;
|
|
||||||
fetch("/api/jobs/" + li.dataset.id + "/seen", {
|
|
||||||
method: "POST", headers: { "content-type": "application/json" },
|
|
||||||
body: JSON.stringify({ seen: true }), keepalive: true,
|
|
||||||
});
|
|
||||||
li.classList.add("seen"); li.classList.remove("new");
|
|
||||||
li.querySelector(".new-badge")?.remove();
|
|
||||||
li.querySelector(".toggle").textContent = "Mark new";
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
document.getElementById("all-seen")?.addEventListener("click", async () => {
|
document.getElementById("all-seen")?.addEventListener("click", async () => {
|
||||||
const ids = [...document.querySelectorAll(".job.new")].map((li) => Number(li.dataset.id));
|
const ids = [...document.querySelectorAll(".job.new")].map((li) => Number(li.dataset.id));
|
||||||
|
|||||||
Reference in New Issue
Block a user