Redesign the tracker's UI
Test and publish / test (push) Successful in 51s
Test and publish / publish (push) Successful in 54s

An app shell with a sidebar (a top bar on phones) replaces the per-page
headers and back links. A token-based design system in styles.css, with a
dark set under prefers-color-scheme, replaces the paper palette and the
cv-btn/ja-input classes ported from the main site.

- Applications: header with counts and the follow-up total, the add form
  behind a "New application" button, coloured pipeline tiles, a
  "Needs follow-up" filter, sort indicators, icon row actions, compact
  phone cards. Quick reference sits beside the table on wide screens.
- Leads: profile and sources side by side, underline tabs, score rings,
  source health dots.
- Settings: status cards for capture and email.

No API or store changes. jobs-shared.css and the unused Creato font
are removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CiMoE29eGkJtia4hCzSKzT
This commit is contained in:
Adam French
2026-10-14 19:31:17 +00:00
co-authored by Claude Opus 5.5
parent ef38679a45
commit f5b722d100
12 changed files with 2281 additions and 1261 deletions
Binary file not shown.
+201 -3
View File
@@ -1,10 +1,208 @@
<script setup>
/**
* Root component. Each page draws its own header, so this is only the outlet.
* Root component: the app shell. A sidebar on wide screens, a top bar on
* narrow ones, with the three routes and the two links that leave the app;
* each page draws its own header and content inside <main>.
*/
import { RouterView } from "vue-router";
import { RouterLink, RouterView } from "vue-router";
import Icon from "@/components/Icon.vue";
// Served from web/public/ under the app's base path (/jobs/).
const userscriptUrl = `${import.meta.env.BASE_URL}job-capture.user.js`;
const NAV = [
{ to: "/", label: "Applications", icon: "briefcase" },
{ to: "/leads", label: "Leads", icon: "inbox" },
{ to: "/settings", label: "Settings", icon: "sliders" },
];
</script>
<template>
<RouterView />
<div class="shell">
<aside class="sidebar">
<RouterLink to="/" class="brand">
<span class="brand-mark">JT</span>
<span class="brand-name">Job tracker</span>
</RouterLink>
<nav class="nav" aria-label="Main">
<RouterLink
v-for="item in NAV"
:key="item.to"
:to="item.to"
class="nav-link"
exact-active-class="nav-link-active"
>
<Icon :name="item.icon" :size="17" />
<span>{{ item.label }}</span>
</RouterLink>
</nav>
<div class="sidebar-foot">
<!-- A plain link to a static file: Violentmonkey intercepts any
navigation to a URL ending in .user.js and offers to install it.
The token it then asks for is generated on the Settings page. -->
<a
class="nav-link nav-link-quiet"
:href="userscriptUrl"
target="_blank"
rel="noopener"
title="Violentmonkey userscript that adds the job you are viewing. After installing, generate a capture token on the Settings page and paste it into the script's menu: Configure job capture."
>
<Icon name="code" :size="17" />
<span>Capture script</span>
</a>
<!-- The CV is the main site's page, outside this app: a full load. -->
<a href="/cv" class="nav-link nav-link-quiet">
<Icon name="arrow-left" :size="17" />
<span>Back to CV</span>
</a>
</div>
</aside>
<main class="main">
<RouterView />
</main>
</div>
</template>
<style scoped>
.shell {
display: grid;
grid-template-columns: 232px minmax(0, 1fr);
min-height: 100vh;
}
.sidebar {
position: sticky;
top: 0;
display: flex;
flex-direction: column;
gap: 1.5rem;
height: 100vh;
padding: 1.25rem 0.85rem;
border-right: 1px solid var(--border);
background: var(--surface);
}
.brand {
display: flex;
align-items: center;
gap: 0.65rem;
padding: 0 0.5rem;
color: var(--text);
text-decoration: none;
}
.brand:hover {
text-decoration: none;
}
.brand-mark {
display: grid;
place-items: center;
width: 2rem;
height: 2rem;
border-radius: 8px;
background: var(--accent);
color: var(--accent-fg);
font-family: var(--font-heading);
font-size: 1.15rem;
letter-spacing: 0.04em;
padding-top: 2px;
}
.brand-name {
font-family: var(--font-heading);
font-size: 1.5rem;
letter-spacing: 0.03em;
line-height: 1;
padding-top: 2px;
}
.nav,
.sidebar-foot {
display: flex;
flex-direction: column;
gap: 0.15rem;
}
.sidebar-foot {
margin-top: auto;
}
.nav-link {
display: flex;
align-items: center;
gap: 0.65rem;
height: 2.25rem;
padding: 0 0.65rem;
border-radius: var(--radius-sm);
color: var(--text-2);
font-size: 0.875rem;
font-weight: 500;
text-decoration: none;
white-space: nowrap;
}
.nav-link:hover {
background: var(--surface-hover);
color: var(--text);
text-decoration: none;
}
.nav-link-active,
.nav-link-active:hover {
background: var(--accent-soft);
color: var(--accent);
}
.nav-link-quiet {
color: var(--text-3);
font-size: 0.8125rem;
}
/* Narrow screens: the sidebar folds into a top bar that scrolls sideways. */
@media (max-width: 900px) {
.shell {
grid-template-columns: minmax(0, 1fr);
/* Otherwise a short page stretches the bar to share the spare height. */
grid-template-rows: auto 1fr;
}
.sidebar {
position: sticky;
z-index: 10;
flex-direction: row;
align-items: center;
gap: 0.75rem;
height: auto;
padding: 0.6rem 1rem;
border-right: none;
border-bottom: 1px solid var(--border);
overflow-x: auto;
}
.brand {
padding: 0;
}
.brand-name {
display: none;
}
.nav,
.sidebar-foot {
flex-direction: row;
}
.sidebar-foot {
margin-top: 0;
margin-left: auto;
}
.nav-link {
padding: 0 0.6rem;
}
.nav-link-quiet span {
display: none;
}
}
</style>
+528 -98
View File
@@ -1,14 +1,15 @@
/*
* Global stylesheet: the tracker's whole look outside the components.
* Global stylesheet: the design tokens and the small set of shared primitives
* (buttons, inputs, cards, pills, alerts, the page header) that every view
* composes. Views keep only their own layout in scoped <style> blocks.
*
* Ported from the main site, where these pages ran inside CVLayout.vue, which
* re-pointed the site's dark design tokens to ink-on-paper values. This app is
* only ever light, so the paper palette is declared directly and the base
* element styles below are what that layout produced.
*
* Tailwind is here for its preflight reset, which the components were written
* Tailwind is here for its preflight reset, which the components are written
* against (box-sizing, zeroed margins, unstyled buttons). They use no utility
* classes; their own scoped <style> blocks do the layout.
* classes.
*
* Colours are semantic tokens with a dark set under prefers-color-scheme.
* Status and score tints are derived with color-mix() from one hue each, so a
* new status needs one token, not a light and a dark pair of backgrounds.
*/
@import "tailwindcss";
@@ -21,122 +22,551 @@
font-display: swap;
}
@font-face {
font-family: "CreatoDisplay";
src: url("/jobs/fonts/CreatoDisplay-Bold.woff2") format("woff2");
font-weight: normal;
font-style: normal;
font-display: swap;
:root {
color-scheme: light;
--bg: #f4f5f7;
--surface: #ffffff;
--surface-2: #f8f9fb;
--surface-hover: #f1f3f6;
--border: #e3e6eb;
--border-strong: #cdd2da;
--text: #14171c;
--text-2: #4a515c;
--text-3: #7b8390;
--accent: #4f46e5;
--accent-hover: #4338ca;
--accent-fg: #ffffff;
--accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
--danger: #dc2626;
--danger-soft: color-mix(in srgb, var(--danger) 9%, var(--surface));
--warn: #d97706;
--ok: #16a34a;
/* One hue per job status; pills and pipeline tiles tint from these. */
--st-saved: #8b93a1;
--st-applied: #4f46e5;
--st-screening: #0891b2;
--st-assessment: #d97706;
--st-interviewing: #9333ea;
--st-offer: #16a34a;
--st-rejected: #dc2626;
--st-withdrawn: #a3a9b3;
--radius: 10px;
--radius-sm: 7px;
--shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 1px 3px rgb(16 24 40 / 0.04);
--shadow-lg: 0 10px 30px -12px rgb(16 24 40 / 0.25);
--ring: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
--font-heading: "big_noodle_titling", "Arial Narrow", sans-serif;
--font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* `static` = always emit these variables, because component <style> blocks
reference them with var(). */
@theme static {
/* Paper palette */
--color-ink: #111;
--color-ink-soft: #333;
--color-ink-muted: #555;
--color-ink-faint: #999;
--color-ink-link: #0066cc;
--color-ink-danger: #c00;
--color-paper: #fff;
--color-paper-tint: #f5f5f5;
--color-paper-shade: #eee;
--color-line: #ccc;
--color-line-soft: #e0e0e0;
@media (prefers-color-scheme: dark) {
:root {
color-scheme: dark;
--font-heading: "big_noodle_titling", sans-serif;
--font-body: "CreatoDisplay", sans-serif;
--default-font-family: var(--font-body);
--bg: #0e1015;
--surface: #171a21;
--surface-2: #1c2029;
--surface-hover: #222733;
--border: #2a2f3a;
--border-strong: #3a414f;
--text: #e9ecf1;
--text-2: #b3bac6;
--text-3: #828b99;
--accent: #818cf8;
--accent-hover: #a5b4fc;
--accent-fg: #0e1015;
--accent-soft: color-mix(in srgb, var(--accent) 16%, var(--surface));
--danger: #f87171;
--danger-soft: color-mix(in srgb, var(--danger) 14%, var(--surface));
--warn: #fbbf24;
--ok: #4ade80;
--st-saved: #9aa3b2;
--st-applied: #818cf8;
--st-screening: #22d3ee;
--st-assessment: #fbbf24;
--st-interviewing: #c084fc;
--st-offer: #4ade80;
--st-rejected: #f87171;
--st-withdrawn: #6b7280;
--shadow: 0 1px 2px rgb(0 0 0 / 0.4);
--shadow-lg: 0 10px 30px -12px rgb(0 0 0 / 0.7);
}
}
html {
background: var(--bg);
}
body {
margin: 0 auto;
width: 100%;
min-height: 100vh;
overflow-x: hidden;
background: var(--color-paper-tint);
color: var(--color-ink);
background: var(--bg);
color: var(--text);
font-family: var(--font-body);
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
margin: 0;
font-family: var(--font-heading);
color: var(--color-ink);
}
h1 {
font-size: 1.5rem;
}
h2 {
font-size: 1.25rem;
}
h3,
h4 {
font-size: 1.125rem;
color: var(--text);
font-weight: 600;
line-height: 1.25;
}
p,
small,
code,
ul,
li,
a {
color: var(--color-ink);
}
input,
textarea {
color: var(--color-ink);
background: var(--color-paper);
border: 1px solid var(--color-line);
}
input::placeholder,
textarea::placeholder {
color: var(--color-ink-faint);
opacity: 1;
}
/* Buttons shared by every page */
.cv-btn {
padding: 0.4rem 1rem;
border: 1px solid var(--color-ink-soft);
border-radius: 4px;
background: var(--color-paper);
color: var(--color-ink-soft);
cursor: pointer;
font-size: 0.9rem;
white-space: nowrap;
color: var(--accent);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
code {
font-family: var(--font-mono);
font-size: 0.9em;
padding: 0.05em 0.35em;
border-radius: 4px;
background: var(--surface-2);
border: 1px solid var(--border);
}
:focus-visible {
outline: none;
box-shadow: var(--ring);
}
/* ---- Page frame --------------------------------------------------------- */
.page {
max-width: 1440px;
margin: 0 auto;
padding: 1.75rem 2rem 3rem;
}
.page-header {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 1rem;
flex-wrap: wrap;
margin-bottom: 1.5rem;
}
.page-title {
font-family: var(--font-heading);
font-weight: normal;
font-size: 2.1rem;
letter-spacing: 0.02em;
line-height: 1;
}
.page-sub {
margin-top: 0.4rem;
color: var(--text-3);
font-size: 0.875rem;
}
.page-actions {
display: flex;
align-items: center;
gap: 0.5rem;
flex-wrap: wrap;
}
@media (max-width: 640px) {
.page {
padding: 1.25rem 1rem 2.5rem;
}
.page-title {
font-size: 1.8rem;
}
}
/* ---- Buttons ------------------------------------------------------------ */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
height: 2.25rem;
padding: 0 0.9rem;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
background: var(--surface);
color: var(--text);
font-size: 0.875rem;
font-weight: 500;
white-space: nowrap;
cursor: pointer;
text-decoration: none;
box-shadow: var(--shadow);
transition:
background 0.15s,
color 0.15s;
background 0.12s,
border-color 0.12s,
color 0.12s;
}
.cv-btn:hover {
background: var(--color-paper-shade);
.btn:hover {
background: var(--surface-hover);
text-decoration: none;
}
.cv-btn:disabled {
.btn:disabled {
opacity: 0.5;
cursor: default;
}
.cv-btn-sm {
padding: 0.2rem 0.55rem;
.btn-primary {
border-color: var(--accent);
background: var(--accent);
color: var(--accent-fg);
}
.btn-primary:hover {
border-color: var(--accent-hover);
background: var(--accent-hover);
}
.btn-danger {
color: var(--danger);
}
.btn-danger:hover {
border-color: var(--danger);
background: var(--danger-soft);
}
.btn-ghost {
border-color: transparent;
background: transparent;
box-shadow: none;
color: var(--text-2);
}
.btn-ghost:hover {
background: var(--surface-hover);
color: var(--text);
}
.btn-ghost.btn-danger:hover {
border-color: transparent;
color: var(--danger);
}
.btn-sm {
height: 1.875rem;
padding: 0 0.65rem;
font-size: 0.8125rem;
}
/* Square, for a lone icon; always carries a title and aria-label. */
.btn-icon {
width: 2.25rem;
padding: 0;
}
.btn-icon.btn-sm {
width: 1.875rem;
}
/* ---- Form controls ------------------------------------------------------ */
.input {
width: 100%;
min-width: 0;
height: 2.25rem;
padding: 0 0.7rem;
border: 1px solid var(--border-strong);
border-radius: var(--radius-sm);
background: var(--surface);
color: var(--text);
font: inherit;
font-size: 0.875rem;
transition:
border-color 0.12s,
box-shadow 0.12s;
}
.input::placeholder {
color: var(--text-3);
opacity: 1;
}
.input:focus {
outline: none;
border-color: var(--accent);
box-shadow: var(--ring);
}
textarea.input {
height: auto;
padding: 0.5rem 0.7rem;
line-height: 1.45;
resize: vertical;
}
select.input {
padding-right: 2rem;
appearance: none;
cursor: pointer;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8390' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.6rem center;
}
.input-sm {
height: 1.875rem;
padding: 0 0.5rem;
font-size: 0.8125rem;
}
textarea.input-sm {
padding: 0.35rem 0.5rem;
}
.field {
display: flex;
flex-direction: column;
gap: 0.3rem;
min-width: 0;
}
.field > span {
font-size: 0.8rem;
font-weight: 500;
color: var(--text-2);
}
.cv-btn-primary,
.cv-btn.active {
background: var(--color-ink-soft);
color: var(--color-paper);
.check {
display: inline-flex;
align-items: center;
gap: 0.4rem;
font-size: 0.8125rem;
color: var(--text-2);
white-space: nowrap;
cursor: pointer;
}
.cv-btn-primary:hover {
background: var(--color-ink-muted);
.check input {
accent-color: var(--accent);
}
.cv-btn-danger {
border-color: var(--color-ink-danger);
color: var(--color-ink-danger);
/* Search box: an input with a magnifier inside its left edge. */
.search {
position: relative;
flex: 1 1 16rem;
min-width: 0;
}
.cv-btn-danger:hover {
background: #fee;
.search > svg {
position: absolute;
left: 0.7rem;
top: 50%;
transform: translateY(-50%);
color: var(--text-3);
pointer-events: none;
}
.search > .input {
padding-left: 2.1rem;
}
/* ---- Surfaces ----------------------------------------------------------- */
.card {
border: 1px solid var(--border);
border-radius: var(--radius);
background: var(--surface);
box-shadow: var(--shadow);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
padding: 0.9rem 1.1rem;
border-bottom: 1px solid var(--border);
}
.card-title {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.95rem;
font-weight: 600;
}
.card-body {
padding: 1rem 1.1rem;
}
/* A card that folds: <details class="card disclosure"><summary>… */
.disclosure > summary {
display: flex;
align-items: center;
gap: 0.6rem;
padding: 0.9rem 1.1rem;
cursor: pointer;
list-style: none;
user-select: none;
}
.disclosure > summary::-webkit-details-marker {
display: none;
}
.disclosure > summary::after {
content: "";
width: 16px;
height: 16px;
margin-left: auto;
flex: none;
background: currentColor;
color: var(--text-3);
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
center / contain no-repeat;
transition: transform 0.15s;
}
.disclosure[open] > summary::after {
transform: rotate(180deg);
}
.disclosure[open] > summary {
border-bottom: 1px solid var(--border);
}
/* ---- Feedback ----------------------------------------------------------- */
.alert {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-bottom: 1.25rem;
padding: 0.65rem 0.75rem 0.65rem 1rem;
border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
border-radius: var(--radius-sm);
background: var(--danger-soft);
color: var(--danger);
font-size: 0.875rem;
}
.muted {
color: var(--text-3);
}
.hint {
color: var(--text-3);
font-size: 0.8125rem;
}
.warn {
color: var(--danger);
font-size: 0.8125rem;
font-weight: 500;
}
.empty {
padding: 2.5rem 1rem;
text-align: center;
color: var(--text-3);
}
/* Inline count beside a label, as in tabs and card titles. */
.count {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 1.4rem;
height: 1.25rem;
padding: 0 0.4rem;
border-radius: 999px;
background: var(--surface-hover);
color: var(--text-2);
font-size: 0.75rem;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
/* Long captured posting text: scrolls inside its container. */
.posting {
max-height: 24rem;
overflow: auto;
margin: 0;
padding: 0.9rem 1rem;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--surface-2);
color: var(--text-2);
font-family: inherit;
font-size: 0.8125rem;
line-height: 1.55;
white-space: pre-wrap;
}
/* ---- Status pills ------------------------------------------------------- */
.pill {
display: inline-flex;
align-items: center;
gap: 0.4rem;
height: 1.6rem;
padding: 0 0.65rem;
border: 1px solid color-mix(in srgb, var(--st, var(--text-3)) 30%, transparent);
border-radius: 999px;
background: color-mix(in srgb, var(--st, var(--text-3)) 12%, var(--surface));
color: color-mix(in srgb, var(--st, var(--text-3)) 75%, var(--text));
font-size: 0.78rem;
font-weight: 600;
white-space: nowrap;
}
.pill::before {
content: "";
width: 0.45rem;
height: 0.45rem;
border-radius: 50%;
background: var(--st, var(--text-3));
flex: none;
}
.dot {
display: inline-block;
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background: var(--text-3);
flex: none;
}
.dot-ok {
background: var(--ok);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}
.dot-warn {
background: var(--warn);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent);
}
.status-saved { --st: var(--st-saved); }
.status-applied { --st: var(--st-applied); }
.status-screening { --st: var(--st-screening); }
.status-assessment { --st: var(--st-assessment); }
.status-interviewing { --st: var(--st-interviewing); }
.status-offer { --st: var(--st-offer); }
.status-rejected { --st: var(--st-rejected); }
.status-withdrawn { --st: var(--st-withdrawn); }
/* ---- Spinner ------------------------------------------------------------ */
.spinner {
width: 14px;
height: 14px;
border: 2px solid currentColor;
border-right-color: transparent;
border-radius: 50%;
animation: spin 0.7s linear infinite;
flex: none;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@media (prefers-reduced-motion: reduce) {
.spinner {
animation-duration: 2s;
}
}
+80
View File
@@ -0,0 +1,80 @@
<script setup>
/**
* A small inline icon set (shapes after Lucide, ISC licence), drawn in
* currentColor so an icon takes the colour of the text beside it. Inline
* rather than a package because the app needs about twenty.
*
* Decorative by default (aria-hidden): a button that is only an icon carries
* its own aria-label and title.
*/
import { computed } from "vue";
const props = defineProps({
name: { type: String, required: true },
size: { type: [Number, String], default: 16 },
});
const PATHS = {
briefcase:
'<rect width="20" height="14" x="2" y="7" rx="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/>',
inbox:
'<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>',
sliders:
'<line x1="4" x2="4" y1="21" y2="14"/><line x1="4" x2="4" y1="10" y2="3"/><line x1="12" x2="12" y1="21" y2="12"/><line x1="12" x2="12" y1="8" y2="3"/><line x1="20" x2="20" y1="21" y2="16"/><line x1="20" x2="20" y1="12" y2="3"/><line x1="2" x2="6" y1="14" y2="14"/><line x1="10" x2="14" y1="8" y2="8"/><line x1="18" x2="22" y1="16" y2="16"/>',
download:
'<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',
plus: '<path d="M5 12h14"/><path d="M12 5v14"/>',
search: '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
pencil: '<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/>',
trash:
'<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>',
file: '<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/><line x1="16" x2="8" y1="13" y2="13"/><line x1="16" x2="8" y1="17" y2="17"/>',
copy: '<rect width="14" height="14" x="8" y="8" rx="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
check: '<path d="M20 6 9 17l-5-5"/>',
external:
'<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',
"arrow-left": '<path d="m12 19-7-7 7-7"/><path d="M19 12H5"/>',
refresh:
'<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',
x: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',
"chevron-up": '<path d="m18 15-6-6-6 6"/>',
"chevron-down": '<path d="m6 9 6 6 6-6"/>',
code: '<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',
clock: '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
mail: '<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
key: '<circle cx="7.5" cy="15.5" r="5.5"/><path d="m21 2-9.6 9.6"/><path d="m15.5 7.5 3 3L22 7l-3-3"/>',
sparkles:
'<path d="M12 3 13.9 8.8 20 10l-6.1 1.2L12 17l-1.9-5.8L4 10l6.1-1.2Z"/><path d="M19 17v4"/><path d="M17 19h4"/>',
bookmark: '<path d="m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"/>',
undo: '<path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/>',
pause: '<rect x="6" y="4" width="4" height="16" rx="1"/><rect x="14" y="4" width="4" height="16" rx="1"/>',
play: '<polygon points="6 3 20 12 6 21 6 3"/>',
globe:
'<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>',
};
const svg = computed(() => PATHS[props.name] ?? "");
</script>
<template>
<svg
:width="size"
:height="size"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
aria-hidden="true"
focusable="false"
class="icon"
v-html="svg"
/>
</template>
<style scoped>
.icon {
flex: none;
}
</style>
+83 -58
View File
@@ -5,16 +5,16 @@
* row appears in the parent's table without the two having to talk.
*
* Like JobReferences.vue it reports through the parent's single error banner:
* `fail` carries the error, `ok` says a create succeeded.
*
* Its root sits inside the parent's `.ja-root`, which jobs-shared.css relies on.
* `fail` carries the error, `ok` says a create succeeded. `close` asks the
* parent to fold the form away, which it offers only when `closable`.
*/
import { ref } from "vue";
import { useJobApplicationsStore } from "@/stores/jobApplications";
import { STATUS_OPTIONS } from "./jobStatus";
import "./jobs-shared.css";
import Icon from "@/components/Icon.vue";
const emit = defineEmits(["fail", "ok"]);
defineProps({ closable: { type: Boolean, default: false } });
const emit = defineEmits(["fail", "ok", "close"]);
const store = useJobApplicationsStore();
@@ -62,68 +62,93 @@ async function createApplication() {
</script>
<template>
<form class="ja-form" @submit.prevent="createApplication">
<div class="ja-form-row">
<input
v-model="form.jobTitle"
class="ja-input"
placeholder="Job title *"
required
/>
<input
v-model="form.company"
class="ja-input"
placeholder="Company *"
required
/>
<select v-model="form.status" class="ja-input ja-select">
<option v-for="s in STATUS_OPTIONS" :key="s.value" :value="s.value">
{{ s.label }}
</option>
</select>
<form class="card" @submit.prevent="createApplication">
<div class="card-header">
<h2 class="card-title"><Icon name="plus" /> New application</h2>
<button
v-if="closable"
type="button"
class="btn btn-ghost btn-sm btn-icon"
title="Close"
aria-label="Close"
@click="emit('close')"
>
<Icon name="x" />
</button>
</div>
<div class="ja-form-row">
<input
v-model="form.location"
class="ja-input"
placeholder="Location"
/>
<input v-model="form.url" class="ja-input" placeholder="URL" />
<input
v-model="form.appliedAt"
class="ja-input"
type="date"
title="Applied date"
/>
</div>
<div class="ja-form-row">
<textarea
v-model="form.notes"
class="ja-input ja-textarea"
placeholder="Notes"
/>
<button type="submit" class="cv-btn cv-btn-primary">Add</button>
<div class="card-body af-grid">
<label class="field af-span-2">
<span>Job title *</span>
<input v-model="form.jobTitle" class="input" required />
</label>
<label class="field af-span-2">
<span>Company *</span>
<input v-model="form.company" class="input" required />
</label>
<label class="field">
<span>Status</span>
<select v-model="form.status" class="input">
<option v-for="s in STATUS_OPTIONS" :key="s.value" :value="s.value">
{{ s.label }}
</option>
</select>
</label>
<label class="field">
<span>Applied</span>
<input v-model="form.appliedAt" class="input" type="date" />
</label>
<label class="field af-span-2">
<span>Location</span>
<input v-model="form.location" class="input" placeholder="e.g. London, hybrid" />
</label>
<label class="field af-span-4">
<span>Posting URL</span>
<input v-model="form.url" class="input" placeholder="https://" />
</label>
<label class="field af-span-6">
<span>Notes</span>
<textarea v-model="form.notes" class="input" rows="2" />
</label>
<div class="af-actions af-span-6">
<button v-if="closable" type="button" class="btn" @click="emit('close')">
Cancel
</button>
<button type="submit" class="btn btn-primary">Add application</button>
</div>
</div>
</form>
</template>
<style scoped>
/* Inputs are styled by jobs-shared.css; buttons are .cv-btn from CVLayout.vue. */
.ja-form {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-bottom: 1.5rem;
.af-grid {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 0.9rem 1rem;
}
.ja-form-row {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
.af-span-2 {
grid-column: span 2;
}
.af-span-4 {
grid-column: span 4;
}
.af-span-6 {
grid-column: 1 / -1;
}
.ja-textarea {
resize: vertical;
min-height: 2.4rem;
.af-actions {
display: flex;
justify-content: flex-end;
gap: 0.5rem;
}
@media (max-width: 720px) {
.af-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.af-span-2,
.af-span-4 {
grid-column: 1 / -1;
}
}
</style>
File diff suppressed because it is too large Load Diff
+250 -266
View File
@@ -9,8 +9,8 @@
* the profile (JobSearchProfile.vue). Nothing reaches the tracker at /jobs/
* until **Track** is pressed on a lead, which adds it there as Saved.
*
* This view owns the page frame, the single error banner, the run button and
* the list. Data access is in stores/jobLeads.js; nothing here calls gql().
* This view owns the page header, the single error banner, the run buttons
* and the list. Data access is in stores/jobLeads.js; nothing here calls gql().
*
* There are three server jobs. "Check now" polls the sources and scores up to
* forty new leads; "Score unscored" polls nothing and scores the whole
@@ -26,7 +26,7 @@ import { useJobLeadsStore } from "@/stores/jobLeads";
import { useJobSearchProfileStore } from "@/stores/jobSearchProfile";
import JobSources from "./JobSources.vue";
import JobSearchProfile from "./JobSearchProfile.vue";
import "./jobs-shared.css";
import Icon from "@/components/Icon.vue";
const TABS = [
{ value: "new", label: "Inbox" },
@@ -117,6 +117,9 @@ function scoreClass(lead) {
return "jl-score-low";
}
/** Fraction of the score ring to fill; an unscored lead gets an empty ring. */
const scoreArc = (lead) => Math.max(0, Math.min(100, lead.score ?? 0));
/** The tooltip says when, which during a rescore is how to tell new from old. */
function scoreTitle(lead) {
if (lead.score == null) return "Not scored";
@@ -247,326 +250,315 @@ onBeforeUnmount(stopPolling);
</script>
<template>
<div class="ja-root jl-root">
<div class="jl-header">
<div class="jl-header-left">
<RouterLink to="/" class="jl-back">← Tracker</RouterLink>
<h2 class="jl-heading">Job Leads</h2>
<div class="page">
<header class="page-header">
<div>
<h1 class="page-title">Leads</h1>
<p class="page-sub jl-sub">
<span v-if="running" class="spinner" aria-hidden="true"></span>
{{ lastRun || "Postings found on the sources below, scored against your profile." }}
</p>
</div>
<div class="jl-header-right">
<span class="jl-hint">{{ lastRun }}</span>
<div class="page-actions">
<button
v-if="scoredCount"
class="cv-btn"
class="btn"
:disabled="running"
title="Score every inbox lead again, including ones already scored. Use after changing the profile or the model. Old scores stay until replaced."
@click="rescore"
>
<Icon name="refresh" />
Rescore all
</button>
<button
v-if="unscoredCount"
class="cv-btn"
class="btn"
:disabled="running"
title="Score every unscored lead in the inbox against the profile, without polling the sources. One Claude call per lead."
@click="start('scoreAll')"
>
Score unscored ({{ unscoredCount }})
<Icon name="sparkles" />
Score unscored
<span class="count">{{ unscoredCount }}</span>
</button>
<button
class="cv-btn cv-btn-primary"
class="btn btn-primary"
:disabled="running"
title="Poll every source now, then score up to 40 new leads. Profile and keyword changes take effect on a run."
@click="start('runSync')"
>
<span v-if="running" class="spinner" aria-hidden="true"></span>
<Icon v-else name="search" />
{{ running ? "Working…" : "Check now" }}
</button>
</div>
</div>
</header>
<div v-if="error" class="jl-error" role="alert">
<div v-if="error" class="alert" role="alert">
<span>{{ error }}</span>
<button class="cv-btn cv-btn-sm" @click="error = ''">Dismiss</button>
<button
class="btn btn-ghost btn-sm btn-icon"
title="Dismiss"
aria-label="Dismiss"
@click="error = ''"
>
<Icon name="x" />
</button>
</div>
<JobSearchProfile @fail="fail" @ok="clearError" />
<JobSources ref="sourcesBox" @fail="fail" @ok="clearError" />
<div class="jl-setup">
<JobSearchProfile @fail="fail" @ok="clearError" />
<JobSources ref="sourcesBox" @fail="fail" @ok="clearError" />
</div>
<div class="jl-tabs">
<div class="jl-tabs" role="tablist">
<button
v-for="t in TABS"
:key="t.value"
class="jl-tab"
role="tab"
:aria-selected="tab === t.value"
:class="{ 'jl-tab-active': tab === t.value }"
@click="tab = t.value"
>
<span class="jl-tab-count">{{ counts[t.value] }}</span>
<span class="jl-tab-label">{{ t.label }}</span>
{{ t.label }}
<span class="count">{{ counts[t.value] }}</span>
</button>
</div>
<div class="jl-filterbar">
<input v-model="search" class="ja-input" type="search" placeholder="Search title, company, location, reasons…" />
<select v-model="sortBy" class="ja-input ja-select jl-sort" title="Order of the list">
<div class="jl-toolbar">
<label class="search">
<Icon name="search" />
<input
v-model="search"
class="input"
type="search"
placeholder="Search title, company, location, reasons…"
aria-label="Search leads"
/>
</label>
<select v-model="sortBy" class="input jl-sort" title="Order of the list" aria-label="Sort">
<option value="score">Best score first</option>
<option value="posted">Newest posting first</option>
</select>
<label v-if="tab === 'new'" class="jl-check">
<label v-if="tab === 'new'" class="check">
<input v-model="showLowScores" type="checkbox" />
Below {{ minScore }}<template v-if="hiddenLow"> ({{ hiddenLow }} hidden)</template>
</label>
<label v-if="tab === 'new'" class="jl-check" title="Postings the keyword filter rejected. They are never scored.">
<label v-if="tab === 'new'" class="check" title="Postings the keyword filter rejected. They are never scored.">
<input :checked="showUnmatched" type="checkbox" @change="toggleUnmatched" />
Filtered out
</label>
</div>
<article
v-for="lead in visibleLeads"
:key="lead.id"
class="jl-lead"
:class="{ 'jl-lead-unmatched': !lead.matched && lead.state === 'new' }"
>
<div class="jl-score" :class="scoreClass(lead)" :title="scoreTitle(lead)">
{{ lead.score ?? "–" }}
</div>
<div class="jl-lead-body">
<div class="jl-lead-title">
<a v-if="lead.url" :href="lead.url" target="_blank" rel="noopener" class="jl-link">{{ lead.jobTitle }}</a>
<span v-else>{{ lead.jobTitle }}</span>
<span class="jl-lead-company">{{ lead.company }}</span>
<div class="jl-list">
<article
v-for="lead in visibleLeads"
:key="lead.id"
class="card jl-lead"
:class="{ 'jl-lead-unmatched': !lead.matched && lead.state === 'new' }"
>
<div
class="jl-score"
:class="scoreClass(lead)"
:style="{ '--arc': scoreArc(lead) }"
:title="scoreTitle(lead)"
>
<span>{{ lead.score ?? "–" }}</span>
</div>
<div class="jl-lead-meta">
<span v-if="lead.location">{{ lead.location }}</span>
<span>{{ SOURCE_LABELS[lead.sourceKind] ?? lead.sourceKind }}</span>
<span>{{ ageLabel(lead) }}</span>
<span v-if="!lead.matched && lead.state === 'new'">filtered out</span>
<div class="jl-lead-body">
<h3 class="jl-lead-title">
<a v-if="lead.url" :href="lead.url" target="_blank" rel="noopener">{{ lead.jobTitle }}</a>
<span v-else>{{ lead.jobTitle }}</span>
</h3>
<div class="jl-lead-meta">
<span class="jl-company">{{ lead.company }}</span>
<span v-if="lead.location">{{ lead.location }}</span>
<span>{{ SOURCE_LABELS[lead.sourceKind] ?? lead.sourceKind }}</span>
<span>{{ ageLabel(lead) }}</span>
<span v-if="!lead.matched && lead.state === 'new'" class="jl-tag">filtered out</span>
</div>
<p v-if="lead.scoreReasons" class="jl-lead-reasons">{{ lead.scoreReasons }}</p>
<pre v-if="descriptionId === lead.id" class="posting jl-desc">{{
descriptions[lead.id] === undefined ? "Loading…" : descriptions[lead.id] || "The source gave no description."
}}</pre>
</div>
<p v-if="lead.scoreReasons" class="jl-lead-reasons">{{ lead.scoreReasons }}</p>
<pre v-if="descriptionId === lead.id" class="jl-desc">{{
descriptions[lead.id] === undefined ? "Loading…" : descriptions[lead.id] || "The source gave no description."
}}</pre>
</div>
<div class="jl-lead-actions">
<button class="cv-btn cv-btn-sm" @click="toggleDescription(lead)">
{{ descriptionId === lead.id ? "Hide" : "Posting" }}
</button>
<template v-if="lead.state === 'new'">
<div class="jl-lead-actions">
<button
class="cv-btn cv-btn-sm cv-btn-primary"
:disabled="busyId === lead.id"
title="Add to the tracker as Saved"
@click="act(lead, 'promote')"
class="btn btn-ghost btn-sm"
:class="{ 'jl-action-on': descriptionId === lead.id }"
:aria-expanded="descriptionId === lead.id"
@click="toggleDescription(lead)"
>
Track
<Icon name="file" :size="14" />
{{ descriptionId === lead.id ? "Hide" : "Posting" }}
</button>
<button class="cv-btn cv-btn-sm" :disabled="busyId === lead.id" @click="act(lead, 'dismiss')">Dismiss</button>
</template>
<button v-else-if="lead.state === 'dismissed'" class="cv-btn cv-btn-sm" :disabled="busyId === lead.id" @click="act(lead, 'restore')">
Restore
</button>
<RouterLink v-else to="/" class="cv-btn cv-btn-sm jl-btn-link">In tracker</RouterLink>
</div>
</article>
<template v-if="lead.state === 'new'">
<button class="btn btn-sm" :disabled="busyId === lead.id" @click="act(lead, 'dismiss')">
<Icon name="x" :size="14" />
Dismiss
</button>
<button
class="btn btn-primary btn-sm"
:disabled="busyId === lead.id"
title="Add to the tracker as Saved"
@click="act(lead, 'promote')"
>
<Icon name="plus" :size="14" />
Track
</button>
</template>
<button
v-else-if="lead.state === 'dismissed'"
class="btn btn-sm"
:disabled="busyId === lead.id"
@click="act(lead, 'restore')"
>
<Icon name="undo" :size="14" />
Restore
</button>
<RouterLink v-else to="/" class="btn btn-sm">
<Icon name="briefcase" :size="14" />
In tracker
</RouterLink>
</div>
</article>
<p v-if="!visibleLeads.length" class="jl-empty">
<template v-if="loading">Loading…</template>
<template v-else-if="tab !== 'new'">Nothing here.</template>
<template v-else-if="hiddenLow">Nothing at or above {{ minScore }}. Tick "Below {{ minScore }}" to see the rest.</template>
<template v-else-if="!leads.length">No leads yet. Add a source above, then press "Check now".</template>
<template v-else>The inbox is empty.</template>
</p>
<div v-if="!visibleLeads.length" class="card empty">
<template v-if="loading">Loading…</template>
<template v-else-if="tab !== 'new'">Nothing here.</template>
<template v-else-if="hiddenLow">Nothing at or above {{ minScore }}. Tick "Below {{ minScore }}" to see the rest.</template>
<template v-else-if="!leads.length">No leads yet. Add a source above, then press "Check now".</template>
<template v-else>The inbox is empty.</template>
</div>
</div>
</div>
</template>
<!-- Unscoped on purpose, for the same reason as jobs-shared.css: the two child
components render the boxes these classes style, and a scoped rule stops
at a child's root element. Every selector is under .jl-root. -->
<style>
.jl-root .jl-box {
margin-bottom: 1rem;
padding: 0.75rem 1rem;
border: 1px solid var(--color-line-soft);
border-radius: 6px;
background: var(--color-paper);
}
.jl-root .jl-box-heading {
font-size: 1rem;
font-weight: 600;
color: var(--color-ink-soft);
cursor: pointer;
}
.jl-root .jl-box-heading > span {
margin-left: 0.6rem;
font-weight: 400;
}
.jl-root .jl-hint {
font-size: 0.8rem;
color: var(--color-ink-faint);
}
.jl-root p.jl-hint {
margin: 0.5rem 0 0;
}
.jl-root .jl-warn {
font-size: 0.8rem;
color: var(--color-ink-danger);
}
</style>
<style scoped>
/* Colours are the paper palette from CVLayout.vue; buttons are .cv-btn from
there too, and the inputs are styled by jobs-shared.css. The frame matches
the tracker page's (.ja-root and friends in JobApplications.vue), whose
rules are scoped to that component and so are repeated here. */
.jl-root {
padding: 1.5rem;
border-top: 2px solid var(--color-ink-soft);
background: var(--color-paper-tint);
}
.jl-header {
/* Shared primitives are in assets/styles.css; this block is the page's own
layout. */
.jl-sub {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
}
.jl-setup {
display: grid;
grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
gap: 1rem;
margin-bottom: 1rem;
align-items: start;
margin-bottom: 1.75rem;
}
.jl-header-left,
.jl-header-right {
display: flex;
align-items: center;
gap: 1rem;
}
.jl-back {
font-size: 0.85rem;
color: var(--color-ink-muted);
text-decoration: none;
}
.jl-back:hover {
color: var(--color-ink);
}
.jl-heading {
font-size: 1.1rem;
font-weight: 600;
color: var(--color-ink-soft);
}
.jl-error {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
margin-bottom: 1rem;
padding: 0.5rem 0.75rem;
border: 1px solid #b91c1c;
border-radius: 4px;
background: #fef2f2;
color: #7f1d1d;
font-size: 0.85rem;
@media (max-width: 1100px) {
.jl-setup {
grid-template-columns: minmax(0, 1fr);
}
}
.jl-tabs {
display: flex;
gap: 0.5rem;
margin-bottom: 0.75rem;
gap: 0.25rem;
margin-bottom: 1rem;
border-bottom: 1px solid var(--border);
}
.jl-tab {
display: flex;
align-items: baseline;
gap: 0.4rem;
padding: 0.4rem 0.9rem;
border: 1px solid var(--color-line-soft);
border-radius: 6px;
background: var(--color-paper);
color: var(--color-ink-muted);
display: inline-flex;
align-items: center;
gap: 0.5rem;
margin-bottom: -1px;
padding: 0.6rem 0.85rem;
border-bottom: 2px solid transparent;
color: var(--text-3);
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
}
.jl-tab-active {
border-color: var(--color-ink-soft);
color: var(--color-ink);
.jl-tab:hover {
color: var(--text);
}
.jl-tab-active,
.jl-tab-active:hover {
border-bottom-color: var(--accent);
color: var(--text);
}
.jl-tab-active .count {
background: var(--accent-soft);
color: var(--accent);
}
.jl-tab-count {
font-size: 1.05rem;
font-weight: 600;
}
.jl-tab-label {
font-size: 0.8rem;
}
.jl-filterbar {
.jl-toolbar {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 0.75rem;
flex-wrap: wrap;
margin-bottom: 1rem;
}
.jl-sort {
flex: 0 0 auto;
width: auto;
}
.jl-check {
.jl-list {
display: flex;
align-items: center;
gap: 0.35rem;
font-size: 0.8rem;
color: var(--color-ink-muted);
white-space: nowrap;
cursor: pointer;
flex-direction: column;
gap: 0.6rem;
}
.jl-lead {
display: flex;
align-items: flex-start;
gap: 0.9rem;
margin-bottom: 0.5rem;
padding: 0.7rem 0.9rem;
border: 1px solid var(--color-line-soft);
border-radius: 6px;
background: var(--color-paper);
gap: 1rem;
padding: 1rem 1.1rem;
transition: border-color 0.12s;
}
.jl-lead:hover {
border-color: var(--border-strong);
}
.jl-lead-unmatched {
opacity: 0.6;
}
/* The score reads as a number first; the tint only groups it. Same tints as
the tracker's status pills. */
/* The score reads as a number first; the ring shows it out of 100 and its
colour only groups it. */
.jl-score {
flex: 0 0 2.6rem;
padding: 0.35rem 0;
border-radius: 6px;
font-size: 1rem;
font-weight: 600;
text-align: center;
color: var(--color-ink-soft);
background: var(--color-paper-shade);
--tone: var(--text-3);
display: grid;
place-items: center;
flex: 0 0 3rem;
width: 3rem;
height: 3rem;
border-radius: 50%;
background: conic-gradient(
var(--tone) calc(var(--arc) * 1%),
color-mix(in srgb, var(--tone) 15%, var(--surface)) 0
);
}
.jl-score > span {
display: grid;
place-items: center;
width: 2.45rem;
height: 2.45rem;
border-radius: 50%;
background: var(--surface);
color: color-mix(in srgb, var(--tone) 80%, var(--text));
font-size: 0.95rem;
font-weight: 700;
font-variant-numeric: tabular-nums;
}
.jl-score-high {
background: #dcfce7;
color: #14532d;
--tone: var(--ok);
}
.jl-score-mid {
background: #fef9c3;
color: #713f12;
--tone: var(--warn);
}
.jl-score-none {
color: var(--color-ink-faint);
.jl-score-low {
--tone: var(--danger);
}
.jl-lead-body {
@@ -575,86 +567,78 @@ onBeforeUnmount(stopPolling);
}
.jl-lead-title {
font-size: 0.95rem;
font-size: 1rem;
font-weight: 600;
color: var(--color-ink);
}
.jl-lead-company {
margin-left: 0.5rem;
font-weight: 400;
color: var(--color-ink-muted);
.jl-lead-title a {
color: var(--text);
}
.jl-link {
color: var(--color-ink-link);
.jl-lead-title a:hover {
color: var(--accent);
text-decoration: none;
}
.jl-link:hover {
text-decoration: underline;
}
.jl-lead-meta {
display: flex;
flex-wrap: wrap;
gap: 0.25rem 0.9rem;
align-items: center;
gap: 0.2rem 0;
margin-top: 0.15rem;
font-size: 0.8rem;
color: var(--color-ink-faint);
color: var(--text-3);
font-size: 0.8125rem;
}
.jl-lead-meta > span + span::before {
content: "·";
margin: 0 0.5rem;
color: var(--border-strong);
}
.jl-company {
color: var(--text-2);
font-weight: 500;
}
.jl-tag {
color: var(--warn);
}
.jl-lead-reasons {
margin: 0.4rem 0 0;
font-size: 0.85rem;
color: var(--color-ink-soft);
margin-top: 0.5rem;
color: var(--text-2);
font-size: 0.875rem;
line-height: 1.55;
}
/* The posting text is long, so it scrolls inside the card. */
.jl-desc {
max-height: 22rem;
overflow: auto;
margin: 0.6rem 0 0;
padding: 0.6rem;
border: 1px solid var(--color-line-soft);
border-radius: 4px;
background: var(--color-paper-tint);
font-family: inherit;
font-size: 0.8rem;
white-space: pre-wrap;
margin-top: 0.75rem;
}
.jl-lead-actions {
display: flex;
gap: 0.4rem;
white-space: nowrap;
flex: none;
}
.jl-btn-link {
text-decoration: none;
.jl-action-on {
background: var(--accent-soft);
color: var(--accent);
}
.jl-empty {
color: var(--color-ink-faint);
font-size: 0.9rem;
}
@media (max-width: 640px) {
.jl-header,
.jl-filterbar {
flex-wrap: wrap;
}
@media (max-width: 720px) {
.jl-lead {
flex-wrap: wrap;
}
.jl-lead-body {
flex-basis: calc(100% - 3.5rem);
flex-basis: calc(100% - 4rem);
}
.jl-lead-actions {
flex-basis: 100%;
}
.jl-lead-actions > * {
flex: 1;
}
}
</style>
+186 -108
View File
@@ -1,6 +1,6 @@
<script setup>
/**
* The "Quick Reference" box on `/jobs/`: reusable profile/experience snippets
* The "Quick reference" panel on `/jobs/`: reusable profile/experience snippets
* to copy into application forms, with inline editing. Rendered only by
* JobApplications.vue; data comes from stores/jobAppReferences.js.
*
@@ -8,12 +8,13 @@
* so failures are emitted as `fail` (with the error) and every successful
* mutation emits `ok` so the parent can clear a stale message.
*
* Its root sits inside the parent's `.ja-root`, which jobs-shared.css relies on.
* It sits in a narrow column beside the table on wide screens, so each
* snippet stacks its label over its value and the add form folds away.
*/
import { ref, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { useJobAppReferencesStore } from "@/stores/jobAppReferences";
import "./jobs-shared.css";
import Icon from "@/components/Icon.vue";
const emit = defineEmits(["fail", "ok"]);
@@ -24,6 +25,10 @@ const refForm = ref({ category: "profile", label: "", value: "" });
const editingRefId = ref(null);
const editRefForm = ref({});
const REF_CATEGORIES = ["profile", "experience"];
const adding = ref(false);
// The snippet whose Copy button last succeeded, for a moment's tick.
const copiedId = ref(null);
let copiedTimer = null;
async function fetchReferences() {
// The store's fetch() records its failure instead of throwing.
@@ -40,6 +45,7 @@ async function createReference() {
value: refForm.value.value,
});
refForm.value = { category: refForm.value.category, label: "", value: "" };
adding.value = false;
emit("ok");
} catch (err) {
emit("fail", err);
@@ -88,47 +94,105 @@ function refsByCategory(category) {
return references.value.filter((r) => r.category === category);
}
function copyToClipboard(text) {
navigator.clipboard.writeText(text);
async function copyToClipboard(ref) {
try {
await navigator.clipboard.writeText(ref.value);
} catch {
// Clipboard access can be refused; the value is on screen to select.
emit("fail", "Could not copy — select the text and copy it by hand.");
return;
}
copiedId.value = ref.id;
clearTimeout(copiedTimer);
copiedTimer = setTimeout(() => (copiedId.value = null), 1500);
}
onMounted(fetchReferences);
</script>
<template>
<div class="ja-ref-section">
<h3 class="ja-ref-heading">Quick Reference</h3>
<div v-for="cat in REF_CATEGORIES" :key="cat" class="ja-ref-category">
<h4 class="ja-ref-cat-label">{{ cat }}</h4>
<section class="card">
<div class="card-header">
<h2 class="card-title"><Icon name="bookmark" /> Quick reference</h2>
<button
class="btn btn-ghost btn-sm"
:aria-expanded="adding"
@click="adding = !adding"
>
<Icon :name="adding ? 'x' : 'plus'" :size="14" />
{{ adding ? "Cancel" : "Add" }}
</button>
</div>
<form v-if="adding" class="qr-form" @submit.prevent="createReference">
<select v-model="refForm.category" class="input input-sm qr-cap" aria-label="Category">
<option v-for="c in REF_CATEGORIES" :key="c" :value="c">
{{ c }}
</option>
</select>
<input
v-model="refForm.label"
class="input input-sm"
placeholder="Label *"
aria-label="Label"
required
/>
<textarea
v-model="refForm.value"
class="input input-sm"
rows="3"
placeholder="Value *"
aria-label="Value"
required
/>
<button type="submit" class="btn btn-primary btn-sm">Add snippet</button>
</form>
<div v-for="cat in REF_CATEGORIES" :key="cat" class="qr-category">
<h3 class="qr-cat-label">{{ cat }}</h3>
<div
v-for="ref in refsByCategory(cat)"
:key="ref.id"
class="ja-ref-item"
class="qr-item"
>
<template v-if="editingRefId !== ref.id">
<span class="ja-ref-label">{{ ref.label }}</span>
<span class="ja-ref-value" :title="ref.value">{{ ref.value }}</span>
<button
class="cv-btn cv-btn-sm"
@click="copyToClipboard(ref.value)"
title="Copy"
>
Copy
</button>
<button class="cv-btn cv-btn-sm" @click="startRefEdit(ref)">
Edit
</button>
<button
class="cv-btn cv-btn-sm cv-btn-danger"
@click="deleteReference(ref)"
>
Delete
</button>
<div class="qr-text">
<span class="qr-label">{{ ref.label }}</span>
<span class="qr-value" :title="ref.value">{{ ref.value }}</span>
</div>
<div class="qr-actions">
<button
class="btn btn-ghost btn-sm btn-icon"
:class="{ 'qr-copied': copiedId === ref.id }"
:title="copiedId === ref.id ? 'Copied' : 'Copy'"
:aria-label="`Copy ${ref.label}`"
@click="copyToClipboard(ref)"
>
<Icon :name="copiedId === ref.id ? 'check' : 'copy'" />
</button>
<button
class="btn btn-ghost btn-sm btn-icon qr-reveal"
title="Edit"
:aria-label="`Edit ${ref.label}`"
@click="startRefEdit(ref)"
>
<Icon name="pencil" />
</button>
<button
class="btn btn-ghost btn-danger btn-sm btn-icon qr-reveal"
title="Delete"
:aria-label="`Delete ${ref.label}`"
@click="deleteReference(ref)"
>
<Icon name="trash" />
</button>
</div>
</template>
<template v-else>
<form v-else class="qr-edit" @submit.prevent="saveRefEdit(ref.id)">
<select
v-model="editRefForm.category"
class="ja-input ja-input-sm ja-select"
class="input input-sm qr-cap"
aria-label="Category"
>
<option v-for="c in REF_CATEGORIES" :key="c" :value="c">
{{ c }}
@@ -136,115 +200,129 @@ onMounted(fetchReferences);
</select>
<input
v-model="editRefForm.label"
class="ja-input ja-input-sm"
class="input input-sm"
placeholder="Label"
aria-label="Label"
/>
<input
<textarea
v-model="editRefForm.value"
class="ja-input ja-input-sm"
class="input input-sm"
rows="3"
placeholder="Value"
aria-label="Value"
/>
<button
class="cv-btn cv-btn-sm cv-btn-primary"
@click="saveRefEdit(ref.id)"
>
Save
</button>
<button class="cv-btn cv-btn-sm" @click="cancelRefEdit">
Cancel
</button>
</template>
<div class="qr-edit-actions">
<button type="button" class="btn btn-sm" @click="cancelRefEdit">
Cancel
</button>
<button type="submit" class="btn btn-primary btn-sm">Save</button>
</div>
</form>
</div>
<p v-if="!refsByCategory(cat).length" class="ja-ref-empty">
No {{ cat }} items yet.
<p v-if="!refsByCategory(cat).length" class="hint qr-empty">
No {{ cat }} snippets yet.
</p>
</div>
<form class="ja-ref-form" @submit.prevent="createReference">
<select v-model="refForm.category" class="ja-input ja-select">
<option v-for="c in REF_CATEGORIES" :key="c" :value="c">
{{ c }}
</option>
</select>
<input
v-model="refForm.label"
class="ja-input"
placeholder="Label *"
required
/>
<input
v-model="refForm.value"
class="ja-input"
placeholder="Value *"
required
/>
<button type="submit" class="cv-btn cv-btn-primary">Add</button>
</form>
</div>
</section>
</template>
<style scoped>
/* Colours are the paper palette from CVLayout.vue; buttons are .cv-btn from
there too, and the inputs are styled by jobs-shared.css. */
.ja-ref-section {
margin-bottom: 1.5rem;
padding: 1rem;
border: 1px solid var(--color-line-soft);
border-radius: 6px;
background: var(--color-paper);
.qr-form,
.qr-edit {
display: flex;
flex-direction: column;
gap: 0.45rem;
}
.ja-ref-heading {
font-size: 1rem;
font-weight: 600;
margin-bottom: 0.75rem;
color: var(--color-ink-soft);
.qr-form {
padding: 0.9rem 1.1rem;
border-bottom: 1px solid var(--border);
background: var(--surface-2);
}
.ja-ref-category {
margin-bottom: 0.75rem;
}
.ja-ref-cat-label {
font-size: 0.85rem;
font-weight: 600;
color: var(--color-ink-muted);
.qr-cap {
text-transform: capitalize;
margin-bottom: 0.35rem;
}
.ja-ref-item {
.qr-category {
padding: 0.75rem 0.6rem 0.6rem;
}
.qr-category + .qr-category {
border-top: 1px solid var(--border);
}
.qr-cat-label {
padding: 0 0.5rem 0.35rem;
color: var(--text-3);
font-size: 0.7rem;
font-weight: 600;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.qr-item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.3rem 0;
padding: 0.45rem 0.5rem;
border-radius: var(--radius-sm);
}
.qr-item:hover {
background: var(--surface-2);
}
.qr-item:has(.qr-edit) {
display: block;
background: var(--accent-soft);
}
.ja-ref-label {
font-size: 0.85rem;
font-weight: 500;
color: var(--color-ink-soft);
min-width: 80px;
}
.ja-ref-value {
font-size: 0.85rem;
color: var(--color-ink-muted);
.qr-text {
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
}
.qr-label {
font-size: 0.8125rem;
font-weight: 600;
}
.qr-value {
overflow: hidden;
color: var(--text-2);
font-size: 0.8125rem;
text-overflow: ellipsis;
white-space: nowrap;
}
.ja-ref-empty {
font-size: 0.8rem;
color: var(--color-ink-faint);
margin: 0.2rem 0;
.qr-actions {
display: flex;
flex: none;
}
.ja-ref-form {
/* Edit and delete wait for a hover so the column reads as a list of values;
on touch screens, which have no hover, they are always there. */
@media (hover: hover) {
.qr-reveal {
opacity: 0;
}
.qr-item:hover .qr-reveal,
.qr-reveal:focus-visible {
opacity: 1;
}
}
.qr-copied {
color: var(--ok);
}
.qr-edit-actions {
display: flex;
gap: 0.5rem;
margin-top: 0.75rem;
flex-wrap: wrap;
justify-content: flex-end;
gap: 0.4rem;
}
.qr-empty {
padding: 0 0.5rem 0.25rem;
}
</style>
+37 -49
View File
@@ -14,7 +14,7 @@
import { ref, computed, watch, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { useJobSearchProfileStore } from "@/stores/jobSearchProfile";
import "./jobs-shared.css";
import Icon from "@/components/Icon.vue";
const emit = defineEmits(["fail", "ok"]);
@@ -66,44 +66,46 @@ onMounted(async () => {
</script>
<template>
<details class="jl-box" :open="isEmpty">
<summary class="jl-box-heading">
Search profile
<span v-if="isEmpty" class="jl-warn">empty — leads will not be scored</span>
<details class="card disclosure" :open="isEmpty">
<summary>
<Icon name="sparkles" />
<span class="card-title">Search profile</span>
<span v-if="isEmpty" class="warn">Empty — leads will not be scored</span>
<span v-else-if="profile" class="hint">Hiding below {{ profile.minScore }}</span>
</summary>
<form class="jl-profile" @submit.prevent="save">
<label class="jl-field jl-field-wide">
<form class="sp-form" @submit.prevent="save">
<label class="field sp-wide">
<span>About you and what you want</span>
<textarea
v-model="form.profile"
class="ja-input jl-textarea"
rows="8"
class="input"
rows="7"
placeholder="Experience, skills, the kind of role, level, location and working arrangement you are after. Each lead is scored against this text and nothing else."
></textarea>
</label>
<label class="jl-field">
<label class="field">
<span>Title must include one of</span>
<textarea v-model="form.includeKeywords" class="ja-input jl-textarea" rows="4" placeholder="engineer&#10;developer"></textarea>
<textarea v-model="form.includeKeywords" class="input" rows="4" placeholder="engineer&#10;developer"></textarea>
</label>
<label class="jl-field">
<label class="field">
<span>Title must not include</span>
<textarea v-model="form.excludeKeywords" class="ja-input jl-textarea" rows="4" placeholder="intern&#10;principal"></textarea>
<textarea v-model="form.excludeKeywords" class="input" rows="4" placeholder="intern&#10;principal"></textarea>
</label>
<label class="jl-field">
<label class="field">
<span>Location must include one of</span>
<textarea v-model="form.locations" class="ja-input jl-textarea" rows="4" placeholder="london&#10;remote"></textarea>
<textarea v-model="form.locations" class="input" rows="4" placeholder="london&#10;remote"></textarea>
</label>
<p class="jl-hint jl-field-wide">
<p class="hint sp-wide">
One entry per line; an empty list is no restriction. Title keywords match whole words, so
"intern" does not exclude "Internal". Only leads that pass are shown and scored.
</p>
<div class="jl-profile-actions jl-field-wide">
<label class="jl-inline">
<div class="sp-actions sp-wide">
<label class="sp-inline">
Hide leads scoring below
<input v-model="form.minScore" class="ja-input jl-num" type="number" min="0" max="100" />
<input v-model="form.minScore" class="input input-sm sp-num" type="number" min="0" max="100" />
</label>
<button type="button" class="cv-btn cv-btn-sm" :disabled="!dirty || saving" @click="reset">Reset</button>
<button type="submit" class="cv-btn cv-btn-sm cv-btn-primary" :disabled="!dirty || saving">
<button type="button" class="btn btn-sm" :disabled="!dirty || saving" @click="reset">Reset</button>
<button type="submit" class="btn btn-primary btn-sm" :disabled="!dirty || saving">
{{ saving ? "Saving…" : "Save" }}
</button>
</div>
@@ -112,56 +114,42 @@ onMounted(async () => {
</template>
<style scoped>
/* The box and its heading (.jl-box, .jl-box-heading, .jl-hint, .jl-warn) are
in JobLeads.vue's unscoped block, shared with JobSources.vue. */
.jl-profile {
.sp-form {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.75rem;
margin-top: 0.75rem;
gap: 0.9rem;
padding: 1rem 1.1rem 1.1rem;
}
.jl-field {
display: flex;
flex-direction: column;
gap: 0.25rem;
font-size: 0.8rem;
color: var(--color-ink-muted);
}
.jl-field-wide {
.sp-wide {
grid-column: 1 / -1;
}
.jl-textarea {
resize: vertical;
font-family: inherit;
line-height: 1.4;
}
.jl-profile-actions {
.sp-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.jl-inline {
.sp-inline {
display: flex;
align-items: center;
gap: 0.5rem;
margin-right: auto;
font-size: 0.8rem;
color: var(--color-ink-muted);
color: var(--text-2);
font-size: 0.8125rem;
}
.jl-num {
flex: 0 0 4.5rem;
min-width: 0;
.sp-num {
width: 4.5rem;
}
@media (max-width: 640px) {
.jl-profile {
.sp-form {
grid-template-columns: 1fr;
}
.sp-actions {
flex-wrap: wrap;
}
}
</style>
+134 -77
View File
@@ -16,7 +16,7 @@
import { ref, computed, onMounted } from "vue";
import { storeToRefs } from "pinia";
import { useJobSourcesStore } from "@/stores/jobSources";
import "./jobs-shared.css";
import Icon from "@/components/Icon.vue";
const emit = defineEmits(["fail", "ok"]);
@@ -89,111 +89,168 @@ onMounted(fetchSources);
</script>
<template>
<details class="jl-box" :open="!sources.length">
<summary class="jl-box-heading">
Sources
<span class="jl-hint">{{ sources.filter((s) => s.enabled).length }} watched</span>
<span v-if="sources.some((s) => s.lastError)" class="jl-warn">one or more failing</span>
<details class="card disclosure" :open="!sources.length">
<summary>
<Icon name="globe" />
<span class="card-title">Sources</span>
<span class="hint">{{ sources.filter((s) => s.enabled).length }} watched</span>
<span v-if="sources.some((s) => s.lastError)" class="warn">One or more failing</span>
</summary>
<div v-for="source in sources" :key="source.id" class="jl-source" :class="{ 'jl-source-off': !source.enabled }">
<span class="jl-source-kind">{{ kindOf(source.kind).label }}</span>
<span class="jl-source-label">{{ source.label }}</span>
<span class="jl-source-what" :title="describe(source)">{{ describe(source) }}</span>
<span v-if="source.lastError" class="jl-warn jl-source-status" :title="source.lastError">{{ source.lastError }}</span>
<span v-else class="jl-hint jl-source-status">{{ lastPoll(source) }}</span>
<button class="cv-btn cv-btn-sm" @click="toggleEnabled(source)">
{{ source.enabled ? "Pause" : "Resume" }}
</button>
<button class="cv-btn cv-btn-sm cv-btn-danger" @click="deleteSource(source)">Delete</button>
</div>
<p v-if="!sources.length" class="jl-hint">
<ul v-if="sources.length" class="src-list">
<li v-for="source in sources" :key="source.id" class="src" :class="{ 'src-off': !source.enabled }">
<span
class="dot"
:class="source.lastError ? 'dot-warn' : source.enabled ? 'dot-ok' : ''"
:title="source.lastError ? 'Failing' : source.enabled ? 'Watching' : 'Paused'"
></span>
<div class="src-text">
<div class="src-top">
<span class="src-label">{{ source.label }}</span>
<span class="src-kind">{{ kindOf(source.kind).label }}</span>
</div>
<div class="src-what" :title="describe(source)">{{ describe(source) }}</div>
<div v-if="source.lastError" class="warn src-status" :title="source.lastError">{{ source.lastError }}</div>
<div v-else class="hint src-status">{{ lastPoll(source) }}</div>
</div>
<div class="src-actions">
<button
class="btn btn-ghost btn-sm btn-icon"
:title="source.enabled ? 'Pause' : 'Resume'"
:aria-label="`${source.enabled ? 'Pause' : 'Resume'} ${source.label}`"
@click="toggleEnabled(source)"
>
<Icon :name="source.enabled ? 'pause' : 'play'" />
</button>
<button
class="btn btn-ghost btn-danger btn-sm btn-icon"
title="Delete"
:aria-label="`Delete ${source.label}`"
@click="deleteSource(source)"
>
<Icon name="trash" />
</button>
</div>
</li>
</ul>
<p v-else class="hint src-none">
Nothing is being watched. Add a company's job board, or a keyword search, below.
</p>
<form class="jl-source-form" @submit.prevent="createSource">
<select v-model="form.kind" class="ja-input ja-select">
<form class="src-form" @submit.prevent="createSource">
<select v-model="form.kind" class="input input-sm src-kind-select" aria-label="Source kind">
<option v-for="k in KINDS" :key="k.value" :value="k.value">{{ k.label }}</option>
</select>
<template v-if="formKind.board">
<input v-model="form.label" class="ja-input" placeholder="Company name *" required />
<input v-model="form.token" class="ja-input" :placeholder="`Board slug * — ${formKind.hint}`" required />
<input v-model="form.label" class="input input-sm" placeholder="Company name *" aria-label="Company name" required />
<input v-model="form.token" class="input input-sm" :placeholder="`Board slug * — ${formKind.hint}`" aria-label="Board slug" required />
</template>
<template v-else>
<input v-model="form.query" class="ja-input" placeholder="Keywords * — e.g. golang backend" required />
<input v-model="form.location" class="ja-input" placeholder="Location — e.g. London" />
<input v-model="form.query" class="input input-sm" placeholder="Keywords * — e.g. golang backend" aria-label="Keywords" required />
<input v-model="form.location" class="input input-sm" placeholder="Location — e.g. London" aria-label="Location" />
</template>
<button type="submit" class="cv-btn cv-btn-primary">Add</button>
<button type="submit" class="btn btn-primary btn-sm">
<Icon name="plus" :size="14" />
Add
</button>
<p v-if="!formKind.board" class="hint src-wide">
{{ formKind.label }} needs its API key set under Admin → Environment → Job leads.
</p>
</form>
<p v-if="!formKind.board" class="jl-hint">
{{ formKind.label }} needs its API key set under Admin → Environment → Job leads.
</p>
</details>
</template>
<style scoped>
/* The box and its heading (.jl-box, .jl-box-heading, .jl-hint, .jl-warn) are
in JobLeads.vue's unscoped block, shared with JobSearchProfile.vue. */
.jl-source {
.src-list {
margin: 0;
padding: 0.4rem 0.6rem;
list-style: none;
}
.src {
display: flex;
align-items: center;
gap: 0.6rem;
padding: 0.3rem 0;
font-size: 0.85rem;
align-items: flex-start;
gap: 0.75rem;
padding: 0.55rem 0.5rem;
border-radius: var(--radius-sm);
}
.src:hover {
background: var(--surface-2);
}
.src > .dot {
margin-top: 0.4rem;
}
.jl-source:first-of-type {
margin-top: 0.75rem;
}
.jl-source-off {
.src-off {
opacity: 0.55;
}
.jl-source-kind {
flex: 0 0 6.5rem;
color: var(--color-ink-muted);
}
.jl-source-label {
flex: 0 0 9rem;
font-weight: 500;
color: var(--color-ink-soft);
}
.jl-source-what {
flex: 1 1 6rem;
.src-text {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--color-ink-muted);
}
.jl-source-status {
flex: 1 1 10rem;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: right;
}
.jl-source-form {
.src-top {
display: flex;
align-items: baseline;
gap: 0.5rem;
margin-top: 0.75rem;
flex-wrap: wrap;
}
@media (max-width: 640px) {
.jl-source {
flex-wrap: wrap;
}
.src-label {
font-weight: 600;
}
.jl-source-status {
flex-basis: 100%;
text-align: left;
}
.src-kind {
color: var(--text-3);
font-size: 0.75rem;
}
.src-what,
.src-status {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.src-what {
color: var(--text-2);
font-size: 0.8125rem;
}
.src-status {
font-size: 0.75rem;
}
.src-actions {
display: flex;
flex: none;
}
.src-none {
padding: 1rem 1.1rem 0;
}
.src-form {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
padding: 0.9rem 1.1rem 1.1rem;
border-top: 1px solid var(--border);
}
.src-none + .src-form {
border-top: none;
}
.src-form > .input {
flex: 1 1 11rem;
}
.src-form > .src-kind-select {
flex: 0 0 9.5rem;
}
.src-wide {
flex-basis: 100%;
}
</style>
+154 -132
View File
@@ -15,9 +15,8 @@
* panel.
*/
import { ref, onMounted } from "vue";
import { RouterLink } from "vue-router";
import { api } from "@/api";
import "./jobs-shared.css";
import Icon from "@/components/Icon.vue";
const error = ref("");
const busy = ref(false);
@@ -130,162 +129,185 @@ onMounted(() => {
</script>
<template>
<div class="ja-root st-root">
<div class="ja-header">
<div class="ja-header-left">
<RouterLink to="/" class="ja-back">← Tracker</RouterLink>
<h2 class="ja-heading">Settings</h2>
<div class="page st-page">
<header class="page-header">
<div>
<h1 class="page-title">Settings</h1>
<p class="page-sub">
The capture script's token and the email pipeline. API keys, the mailbox and the
timers are the container's environment, on the main site's admin panel.
</p>
</div>
</header>
<div v-if="error" class="alert" role="alert">
<span>{{ error }}</span>
<button
class="btn btn-ghost btn-sm btn-icon"
title="Dismiss"
aria-label="Dismiss"
@click="error = ''"
>
<Icon name="x" />
</button>
</div>
<p v-if="error" class="ja-error" @click="error = ''">{{ error }}</p>
<section class="st-box">
<h3 class="st-heading">Job capture</h3>
<p class="st-hint">
The credential for the
<a :href="userscriptUrl" target="_blank" rel="noopener">job capture userscript</a>.
Generate one, then paste it into the script's <em>Configure job capture</em> menu
command. Only a hash is stored, so it takes effect at once and cannot be recovered —
generate again to replace it.
</p>
<template v-if="capture">
<p class="st-hint">
<template v-if="capture.set">
Active, generated {{ new Date(capture.createdAt).toLocaleString() }}.
</template>
<template v-else>No token: capture is switched off.</template>
<section class="card">
<div class="card-header">
<h2 class="card-title"><Icon name="key" /> Job capture</h2>
<span v-if="capture" class="st-state">
<span class="dot" :class="{ 'dot-ok': capture.set }"></span>
{{ capture.set ? "Active" : "Off" }}
</span>
</div>
<div class="card-body st-body">
<p class="st-text">
The credential for the
<a :href="userscriptUrl" target="_blank" rel="noopener">job capture userscript</a>.
Generate one, then paste it into the script's <em>Configure job capture</em> menu
command. Only a hash is stored, so it takes effect at once and cannot be recovered —
generate again to replace it.
</p>
<div v-if="newToken" class="st-secret">
<p class="st-hint">Copy this now. It will not be shown again.</p>
<code class="st-token">{{ newToken }}</code>
<button class="cv-btn cv-btn-sm" @click="copyToken">
{{ copied ? "Copied" : "Copy" }}
</button>
</div>
<div class="st-actions">
<button class="cv-btn" :disabled="busy" @click="generate">
{{ capture.set ? "Regenerate" : "Generate token" }}
</button>
<button v-if="capture.set" class="cv-btn cv-btn-danger" :disabled="busy" @click="revoke">
Revoke
</button>
</div>
</template>
</section>
<section class="st-box">
<h3 class="st-heading">Email</h3>
<template v-if="email">
<p v-if="!email.backend" class="st-hint">
Not configured: set <code>EMAIL_BACKEND</code> to <code>graph</code> or
<code>imap</code> and the matching credentials.
</p>
<template v-else>
<p class="st-hint">
Reading mail over <strong>{{ email.backend === "graph" ? "Microsoft Graph" : "IMAP" }}</strong>.
<template v-if="email.ready">
{{ email.enabled ? "Syncs on a timer." : "The timer is off; sync by hand below." }}
<template v-if="capture">
<p class="hint">
<template v-if="capture.set">
Generated {{ new Date(capture.createdAt).toLocaleString() }}.
</template>
<template v-else-if="email.authUrl">Not signed in yet.</template>
<template v-else>Not ready: check the tracker's log.</template>
</p>
<p v-if="email.authUrl" class="st-hint">
<a :href="email.authUrl" rel="noopener">Sign in to Microsoft</a>. After signing in,
restart the tracker so the timer picks the session up; "Sync now" works at once.
<template v-else>No token: capture is switched off.</template>
</p>
<div v-if="newToken" class="st-secret">
<p class="st-secret-note">Copy this now. It will not be shown again.</p>
<div class="st-secret-row">
<code class="st-token">{{ newToken }}</code>
<button class="btn btn-sm" @click="copyToken">
<Icon :name="copied ? 'check' : 'copy'" :size="14" />
{{ copied ? "Copied" : "Copy" }}
</button>
</div>
</div>
<div class="st-actions">
<button class="cv-btn" :disabled="busy || !email.ready" @click="syncNow">
{{ busy ? "Syncing…" : "Sync now" }}
<button class="btn" :class="{ 'btn-primary': !capture.set }" :disabled="busy" @click="generate">
<Icon :name="capture.set ? 'refresh' : 'key'" />
{{ capture.set ? "Regenerate" : "Generate token" }}
</button>
<button v-if="capture.set" class="btn btn-danger" :disabled="busy" @click="revoke">
Revoke
</button>
<span class="st-hint">{{ syncResult }}</span>
</div>
</template>
</template>
</div>
</section>
<section class="card">
<div class="card-header">
<h2 class="card-title"><Icon name="mail" /> Email</h2>
<span v-if="email" class="st-state">
<span class="dot" :class="email.ready ? 'dot-ok' : email.backend ? 'dot-warn' : ''"></span>
{{ email.ready ? "Connected" : email.backend ? "Not ready" : "Not configured" }}
</span>
</div>
<div class="card-body st-body">
<template v-if="email">
<p v-if="!email.backend" class="st-text">
Not configured: set <code>EMAIL_BACKEND</code> to <code>graph</code> or
<code>imap</code> and the matching credentials.
</p>
<template v-else>
<p class="st-text">
Reading mail over <strong>{{ email.backend === "graph" ? "Microsoft Graph" : "IMAP" }}</strong>.
<template v-if="email.ready">
{{ email.enabled ? "Syncs on a timer." : "The timer is off; sync by hand below." }}
</template>
<template v-else-if="email.authUrl">Not signed in yet.</template>
<template v-else>Not ready: check the tracker's log.</template>
</p>
<p v-if="email.authUrl" class="st-text">
<a :href="email.authUrl" rel="noopener">Sign in to Microsoft</a>. After signing in,
restart the tracker so the timer picks the session up; "Sync now" works at once.
</p>
<div class="st-actions">
<button class="btn" :disabled="busy || !email.ready" @click="syncNow">
<span v-if="busy" class="spinner" aria-hidden="true"></span>
<Icon v-else name="refresh" />
{{ busy ? "Syncing…" : "Sync now" }}
</button>
<span class="hint">{{ syncResult }}</span>
</div>
</template>
</template>
<p v-else class="hint">Loading…</p>
</div>
</section>
</div>
</template>
<style scoped>
/* Page frame, matching JobApplications.vue's (scoped there). */
.ja-root {
padding: 1.5rem;
border-top: 2px solid var(--color-ink-soft);
background: var(--color-paper-tint);
min-height: 100vh;
}
.ja-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
}
.ja-header-left {
display: flex;
align-items: center;
gap: 1rem;
}
.ja-back {
font-size: 0.85rem;
color: var(--color-ink-muted);
text-decoration: none;
}
.ja-back:hover {
color: var(--color-ink);
}
.ja-heading {
font-size: 1.1rem;
font-weight: 600;
color: var(--color-ink-soft);
}
.ja-error {
margin-bottom: 1rem;
padding: 0.5rem 0.75rem;
border: 1px solid #b91c1c;
border-radius: 4px;
background: #fef2f2;
color: #7f1d1d;
font-size: 0.85rem;
cursor: pointer;
.st-page {
max-width: 820px;
margin: 0;
}
.st-box {
background: var(--color-paper);
border: 1px solid var(--color-line-soft);
border-radius: 6px;
padding: 1rem 1.25rem;
margin-bottom: 1.25rem;
display: flex;
flex-direction: column;
gap: 0.6rem;
.st-page > .card + .card {
margin-top: 1.25rem;
}
.st-heading {
font-size: 1.1rem;
}
.st-hint {
color: var(--color-ink-muted);
font-size: 0.9rem;
}
.st-hint a {
color: var(--color-ink-link);
}
.st-secret {
display: flex;
flex-wrap: wrap;
.st-state {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.6rem;
background: var(--color-paper-tint);
border-radius: 4px;
color: var(--text-2);
font-size: 0.8125rem;
font-weight: 500;
}
.st-body {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.st-text {
color: var(--text-2);
}
.st-secret {
padding: 0.85rem 1rem;
border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
border-radius: var(--radius-sm);
background: color-mix(in srgb, var(--warn) 8%, var(--surface));
}
.st-secret-note {
margin-bottom: 0.5rem;
color: color-mix(in srgb, var(--warn) 75%, var(--text));
font-size: 0.8125rem;
font-weight: 600;
}
.st-secret-row {
display: flex;
align-items: center;
gap: 0.6rem;
}
.st-token {
font-size: 0.85rem;
flex: 1;
min-width: 0;
padding: 0.4rem 0.6rem;
background: var(--surface);
word-break: break-all;
color: var(--color-ink);
}
.st-actions {
display: flex;
align-items: center;
gap: 0.75rem;
gap: 0.6rem;
flex-wrap: wrap;
}
@media (max-width: 640px) {
.st-secret-row {
flex-wrap: wrap;
}
}
</style>
-39
View File
@@ -1,39 +0,0 @@
/*
* Form controls shared by the job tracker's components (JobApplications.vue and
* the JobReferences / JobApplicationForm components it renders).
*
* These lived in JobApplications.vue's scoped block until the page was split.
* Scoped styles stop at a child component's root element, so the inputs inside
* the children would have lost them; this file is imported by each component
* instead. It is unscoped, so every selector is prefixed with the page's
* `.ja-root` class — which also keeps the specificity at (0,2,0), the same as
* the scoped originals, so they still beat CVLayout's `.cv-layout input`.
*
* Colours are the paper palette from CVLayout.vue.
*/
.ja-root .ja-input {
padding: 0.35rem 0.6rem;
border: 1px solid var(--color-line);
border-radius: 4px;
font-size: 0.85rem;
background: var(--color-paper);
flex: 1;
min-width: 120px;
}
.ja-root .ja-input:focus {
outline: none;
border-color: var(--color-ink-muted);
}
.ja-root .ja-select {
cursor: pointer;
}
.ja-root .ja-input-sm {
padding: 0.2rem 0.4rem;
font-size: 0.8rem;
width: 100%;
min-width: 0;
}