diff --git a/CLAUDE.md b/CLAUDE.md index 252c24e..7716f50 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -105,7 +105,7 @@ backend/alembic/ env + 0001_initial (pgcrypto, create_enum_types, create_all) + 0005_workflow (the workflow tables + custom_field + the event log; idempotent by catalog; on the platform drops the local, empty module_event; refuses downgrade there) backend/scripts/ license_gate · deploy_check -frontend/ index.html · app.css · app.js (no build step) +frontend/ index.html · app.css · app.js · InterVariable.woff2 (no build step) Tabler icon path data vendored into app.js's ICN map (CREDITS.md) db/init/ 01-roles.sh (creates the app + migrator roles — local stack only) db/managed/ provision.sql (rendered by dredd-core; CI checks it) · README.md (managed-database runbook) diff --git a/CREDITS.md b/CREDITS.md index e920f7f..74b0815 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -25,9 +25,10 @@ gate (`backend/scripts/license_gate.py`) fails the build on GPL, AGPL or SSPL. | Project | License | Why | |---|---|---| | [Open Color](https://yeun.github.io/open-color/) | MIT | the colour palette, light and dark | +| [Inter](https://rsms.me/inter/) | SIL OFL 1.1 | the console typeface, the same file Atrium ships — self-hosted as `frontend/InterVariable.woff2` (licence beside it in `LICENSE-Inter.txt`), never loaded from a CDN | | [Tabler Icons](https://tabler.io/icons) | MIT | outline icon set — path data is **vendored** into `frontend/app.js`'s `ICN` map, never loaded from a CDN, because the console's CSP allows no third-party origins | -No framework, no bundler, no CDN: the console is `index.html` + `app.css` + `app.js`. +No framework, no bundler, no CDN: the console is `index.html` + `app.css` + `app.js` + the font. ## Design credit diff --git a/backend/tests/e2e/test_console.py b/backend/tests/e2e/test_console.py index 67797b8..0010d2c 100644 --- a/backend/tests/e2e/test_console.py +++ b/backend/tests/e2e/test_console.py @@ -122,6 +122,8 @@ def test_expense_happy_path(tmp_path: Path) -> None: go(mod, "#/settings") def add(kind_title: str): + # One tab per kind; the card only exists once its tab is the one rendered. + mod.locator(".tabs a", has_text=kind_title).click() mod.locator(".card", has=mod.locator("h3", has_text=kind_title)) \ .get_by_role("button", name="Dodaj", exact=True).click() mod.wait_for_selector("#modalRoot .modal") @@ -152,6 +154,7 @@ def test_expense_happy_path(tmp_path: Path) -> None: second.locator('[data-f="name"]').fill(stage2) second.locator('[data-f="users"]').select_option([people["dyrektor"]["id"]]) modal_save(mod) + expect(mod.locator("#content")).to_contain_text(f"{stage1} → {stage2}") add("Typy wniosków") mod.fill("#sfName", type_name) @@ -159,12 +162,14 @@ def test_expense_happy_path(tmp_path: Path) -> None: mod.select_option("#sfFields", label=[amount, category]) mod.select_option("#sfTemplate", label=tpl) modal_save(mod) - expect(mod.locator("#content")).to_contain_text(f"{stage1} → {stage2}") + expect(mod.locator("#content")).to_contain_text(type_name) # ── the filer: a request on the type's default template ──────────────────────────── filer = sign_in(browser, problems, people["wnioskodawca"]["email"], PASSWORD) - go(filer, "#/requests/new") - filer.select_option("#nrType", label=type_name) + # „Nowa sprawa”: step 1 picks the request type by its card, step 2 is its form. + go(filer, "#/new") + filer.locator("a.choice", has_text=type_name).click() + filer.wait_for_selector("#nrTitle") expect(filer.locator("#lpTemplate option:checked")).to_have_text(tpl) filer.fill("#nrTitle", title) filer.locator("#nrFields label", has_text=amount).locator("input").fill("4200") @@ -178,7 +183,7 @@ def test_expense_happy_path(tmp_path: Path) -> None: go(clerk, "#/inbox") clerk.get_by_role("link", name=title).click() clerk.wait_for_url(re.compile(re.escape(run_hash) + "$")) - clerk.locator("#content .card .row").get_by_role("button", name="Zatwierdź", exact=True).click() + clerk.locator("#runActs").get_by_role("button", name="Zatwierdź", exact=True).click() clerk.locator("#modalRoot").get_by_role("button", name="Zatwierdź", exact=True).click() expect(clerk.locator(".stages li.on")).to_contain_text(stage2) @@ -187,7 +192,7 @@ def test_expense_happy_path(tmp_path: Path) -> None: go(boss, "#/inbox") boss.get_by_role("link", name=title).click() boss.wait_for_url(re.compile(re.escape(run_hash) + "$")) - boss.locator("#content .card .row").get_by_role("button", name="Odrzuć", exact=True).click() + boss.locator("#runActs").get_by_role("button", name="Odrzuć", exact=True).click() boss.fill("#raNote", note) boss.locator("#modalRoot").get_by_role("button", name="Odrzuć", exact=True).click() expect(boss.locator(".stages li.on")).to_contain_text(stage1) diff --git a/frontend/InterVariable.woff2 b/frontend/InterVariable.woff2 new file mode 100644 index 0000000..5a8d3e7 Binary files /dev/null and b/frontend/InterVariable.woff2 differ diff --git a/frontend/LICENSE-Inter.txt b/frontend/LICENSE-Inter.txt new file mode 100644 index 0000000..9b2ca37 --- /dev/null +++ b/frontend/LICENSE-Inter.txt @@ -0,0 +1,92 @@ +Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION AND CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/frontend/app.css b/frontend/app.css index 955bfd2..d309402 100644 --- a/frontend/app.css +++ b/frontend/app.css @@ -1,103 +1,106 @@ -/* Workflow console. +/* Workflow console — direction A: white cards on a quiet sidebar, Inter, generous radius. UI chrome stays monochrome (near-black light / near-white dark) — buttons, emphasis, text. - The brand is Open Color **gray #495057** (gray7 — the one tile hue no other family module wears), and it is confined to things that read as - an identity rather than a control: the app mark, icon tiles, the avatar, the focus ring. Nav - and toolbar glyphs stay monochrome, or the whole console turns into a colour field and nothing - stands out. - Semantic colour (overdue / warning / ok) is a separate axis from the brand and earns its - place: something that needs attention has to read at a glance. - Dark mode lightens the brand for text-weight use — a shade-8 on a near-black ground is legible - as a filled background but too dim as a 2px stroke. */ + The brand is Open Color **gray #495057** (gray7 — the one tile hue no other family module wears), + confined to identity: the app mark, icon tiles, the avatar, the focus ring. + Semantic colour (ok / warn / err) is a separate axis and earns its place: something that needs + attention has to read at a glance. */ + +/* Self-hosted like Atrium's (frontend/ui/v1 there) — the CSP allows no third-party origin. */ +@font-face { + font-family: "Inter Variable"; + font-style: normal; + font-weight: 100 900; + font-display: swap; + src: url("InterVariable.woff2") format("woff2"); +} :root { - --bg: #f6f7f8; + --bg: #ffffff; + --side: #f7f7f8; --surface: #ffffff; - --surface-2: #f0f2f3; - --surface-hover: #e9ecee; - --border: #dfe3e6; - --border-input: #c8ced3; - --text: #14181b; - --text-secondary: #4c565e; - --text-muted: #6d7880; - --text-faint: #98a2a9; - --accent: #14181b; + --surface-2: #f7f7f8; + --surface-hover: #efeff1; + --border: #e8e8eb; + --border-input: #dcdce0; + --text: #18181b; + --text-secondary: #3f3f46; + --text-muted: #6b6b74; + --text-faint: #9f9fa9; + --line-faint: #d4d4d8; + --accent: #18181b; --accent-text: #ffffff; - /* `--brand-bg` carries ICONS (3:1 against the glyph is the bar for graphics). - `--brand-ink` is one step darker for the one filled shape that carries TEXT — the avatar's - initials — where 4.5:1 applies. Same family, one step, rather than a second colour. */ + /* `--brand-bg` carries icons (3:1 is the bar for graphics), `--brand-ink` the avatar's initials + (4.5:1). Same family, same shade here. */ --brand: #495057; --brand-bg: #495057; --brand-ink: #495057; --brand-fg: #f8f9fa; - --ok: #1f7a4d; - --ok-bg: #e7f5ee; - --warn: #9a6200; - --warn-bg: #fdf3e0; - --err: #b02525; - --err-bg: #fdeceb; + --ok: #15803d; + --ok-bg: #ecfdf3; + --warn: #a15c07; + --warn-bg: #fef6e7; + --err: #b42318; + --err-bg: #fef3f2; - --radius: 8px; - --radius-sm: 6px; - --shadow: 0 1px 2px rgba(20, 24, 27, .06), 0 4px 12px rgba(20, 24, 27, .05); + --radius: 16px; + --radius-sm: 10px; + --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 8px 24px rgba(24, 24, 27, .06); --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; - --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + --sans: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { - --bg: #101315; - --surface: #181c1f; - --surface-2: #1f2427; - --surface-hover: #272d31; - --border: #2b3236; - --border-input: #3a4247; - --text: #eef1f2; - --text-secondary: #b3bbc0; - --text-muted: #8b959b; - --text-faint: #69737a; - --accent: #eef1f2; - --accent-text: #101315; - /* A lighter shade for stroke-weight use; the filled grounds stay put so a tile looks the - same in both themes. */ + --bg: #0e0e10; + --side: #131316; + --surface: #17171a; + --surface-2: #1d1d21; + --surface-hover: #232328; + --border: #2a2a2f; + --border-input: #36363c; + --text: #ededf0; + --text-secondary: #c8c8ce; + --text-muted: #a0a0aa; + --text-faint: #6e6e78; + --line-faint: #3f3f46; + --accent: #ededf0; + --accent-text: #0e0e10; + /* A lighter shade for stroke-weight use; filled grounds stay put. */ --brand: #ced4da; - --brand-bg: #495057; - --brand-ink: #495057; - --brand-fg: #f8f9fa; --ok: #5cc98f; - --ok-bg: #16281f; + --ok-bg: #132219; --warn: #e8b45c; - --warn-bg: #2a2115; + --warn-bg: #261e12; --err: #f08a80; - --err-bg: #2c1a18; - --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3); + --err-bg: #2a1716; + --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3); } } :root[data-theme="dark"] { - --bg: #101315; - --surface: #181c1f; - --surface-2: #1f2427; - --surface-hover: #272d31; - --border: #2b3236; - --border-input: #3a4247; - --text: #eef1f2; - --text-secondary: #b3bbc0; - --text-muted: #8b959b; - --text-faint: #69737a; - --accent: #eef1f2; - --accent-text: #101315; + --bg: #0e0e10; + --side: #131316; + --surface: #17171a; + --surface-2: #1d1d21; + --surface-hover: #232328; + --border: #2a2a2f; + --border-input: #36363c; + --text: #ededf0; + --text-secondary: #c8c8ce; + --text-muted: #a0a0aa; + --text-faint: #6e6e78; + --line-faint: #3f3f46; + --accent: #ededf0; + --accent-text: #0e0e10; --brand: #ced4da; - --brand-bg: #495057; - --brand-ink: #495057; - --brand-fg: #f8f9fa; --ok: #5cc98f; - --ok-bg: #16281f; + --ok-bg: #132219; --warn: #e8b45c; - --warn-bg: #2a2115; + --warn-bg: #261e12; --err: #f08a80; - --err-bg: #2c1a18; - --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3); + --err-bg: #2a1716; + --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3); } * { box-sizing: border-box; } @@ -110,361 +113,408 @@ body { color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; + font-feature-settings: "cv11", "ss01"; } .hidden { display: none !important; } a { color: inherit; cursor: pointer; text-decoration: none; } a:hover { text-decoration: underline; } -:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; } +:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; } /* ── login ─────────────────────────────────────────────────────────────── */ #login { min-height: 100vh; - display: flex; - align-items: center; - justify-content: center; - padding: 24px; - background: var(--bg); + display: flex; align-items: center; justify-content: center; + padding: 24px; background: var(--side); } .login-tools { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 5; } -.login-tools .iconbtn { background: var(--surface); border: 1px solid var(--border-input); } +.login-tools .iconbtn { background: var(--surface); border: 1px solid var(--border); } .login-card { - width: 100%; - max-width: 360px; - background: var(--surface); - border: 1px solid var(--border); - border-radius: 12px; - padding: 32px; - box-shadow: var(--shadow); + width: 100%; max-width: 380px; + background: var(--surface); border: 1px solid var(--border); + border-radius: 20px; padding: 36px; box-shadow: var(--shadow); } .login-card .logo { width: 40px; height: 40px; display: block; } -.login-card h1 { font-size: 22px; margin: 16px 0 2px; letter-spacing: -.01em; } -.lsub { color: var(--text-muted); font-size: 13px; margin-bottom: 22px; } +.login-card h1 { font-size: 24px; font-weight: 600; margin: 18px 0 2px; letter-spacing: -.025em; } +.lsub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 24px; } .login-card .banner { margin: 14px 0 0; } -.login-card .btn { margin-top: 18px; width: 100%; justify-content: center; } +.login-card .btn { margin-top: 20px; width: 100%; justify-content: center; } /* ── shell ─────────────────────────────────────────────────────────────── */ #app { display: flex; min-height: 100vh; } .sidebar { - width: 232px; - flex: none; - background: var(--surface); - border-right: 1px solid var(--border); - display: flex; - flex-direction: column; - position: sticky; - top: 0; - height: 100vh; + width: 248px; flex: none; + background: var(--side); border-right: 1px solid var(--border); + display: flex; flex-direction: column; + position: sticky; top: 0; height: 100vh; } -.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; } -.brand .logo { width: 26px; height: 26px; flex: none; } -.brand .nm { font-weight: 650; letter-spacing: -.01em; font-size: 16px; } -.nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; } -.sidebar-foot { flex: none; border-top: 1px solid var(--border); padding-bottom: 10px; } +.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; } +.brand .logo { width: 28px; height: 28px; flex: none; } +.brand .nm { font-weight: 600; letter-spacing: -.015em; font-size: 16px; } +.newcase { margin: 4px 14px 14px; justify-content: center; height: 40px; } +.nav { flex: 1; overflow-y: auto; padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; } +.sidebar-foot { flex: none; padding-bottom: 14px; } .nav-item { display: flex; align-items: center; gap: 10px; - padding: 8px 10px; border-radius: var(--radius-sm); - color: var(--text-secondary); cursor: pointer; font-size: 13.5px; + height: 36px; padding: 0 10px; border-radius: var(--radius-sm); + color: var(--text-muted); cursor: pointer; font-size: 14px; font-weight: 450; } .nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; } -.nav-item.on { background: var(--surface-2); color: var(--text); font-weight: 550; } -.nav-item svg { flex: none; color: var(--text-muted); } -.nav-item.on svg { color: var(--text); } +.nav-item.on { background: var(--surface); color: var(--text); font-weight: 550; + box-shadow: 0 0 0 1px var(--border); } +.nav-item svg { flex: none; } .nav-item .cnt { - margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; - background: var(--surface-hover); color: var(--text-secondary); - border-radius: 999px; padding: 1px 7px; + margin-left: auto; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; + background: var(--accent); color: var(--accent-text); + border-radius: 999px; padding: 0 7px; line-height: 19px; } -.nav-item .cnt.hot { background: var(--err-bg); color: var(--err); } -.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; - color: var(--text-faint); padding: 14px 10px 4px; } .main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .topbar { - display: flex; align-items: center; gap: 8px; - padding: 10px 18px; border-bottom: 1px solid var(--border); - background: var(--surface); position: sticky; top: 0; z-index: 4; + display: flex; align-items: center; gap: 6px; + height: 64px; padding: 0 32px; border-bottom: 1px solid var(--border); + background: var(--bg); position: sticky; top: 0; z-index: 4; } .spacer { flex: 1; } -.vdiv { width: 1px; height: 20px; background: var(--border); margin: 0 4px; } -.crumb { display: flex; align-items: center; gap: 6px; min-width: 0; +.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; color: var(--text-muted); } .crumb::-webkit-scrollbar { display: none; } -.crumb b { color: var(--text); font-weight: 600; } -.crumb .sep { color: var(--text-faint); } -.content { padding: 22px; max-width: 1180px; width: 100%; } +.crumb b { color: var(--text); font-weight: 550; } +.crumb .sep { color: var(--line-faint); } +.content { padding: 36px 40px 56px; max-width: 1240px; width: 100%; } #navToggle { display: none; } #navScrim { display: none; } .appcard.m-only { display: none; } -/* ── global search ─────────────────────────────────────────────────────── */ -/* Looks like an input, is a button: the field itself is in the overlay, so there is one place - the query lives rather than two that can disagree. */ -.searchbar { - display: inline-flex; align-items: center; gap: 8px; - min-width: 210px; padding: 5px 8px 5px 10px; - border: 1px solid var(--border-input); border-radius: var(--radius-sm); - background: var(--bg); color: var(--text-muted); - font: inherit; font-size: 13px; cursor: text; -} -.searchbar:hover { background: var(--surface-hover); } -.searchbar .sp { flex: 1; text-align: left; } -.searchbar kbd { - font: inherit; font-size: 10.5px; color: var(--text-faint); - border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; -} /* ── controls ──────────────────────────────────────────────────────────── */ .btn { - display: inline-flex; align-items: center; gap: 7px; - padding: 7px 13px; border-radius: var(--radius-sm); + display: inline-flex; align-items: center; gap: 8px; + height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-input); background: var(--surface); - color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; + color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; + white-space: nowrap; } .btn:hover { background: var(--surface-hover); } -/* A .btn that is an because it navigates rather than acts — the sign-in link on a platform - module's login card. Without this it picks up the global `a:hover` underline and is the one - button in the console that behaves like a link. Same reset .nav-item and a.appcard already do. */ +/* An that navigates rather than acts must not pick up the global link underline. */ a.btn:hover { text-decoration: none; } .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); } .btn.primary:hover { opacity: .88; } -.btn.danger { color: var(--err); border-color: var(--border-input); } +.btn.danger { color: var(--err); } .btn.danger:hover { background: var(--err-bg); } .btn:disabled { opacity: .5; cursor: not-allowed; } -.btn.sm { padding: 4px 9px; font-size: 12.5px; } +.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; } .iconbtn { display: inline-flex; align-items: center; justify-content: center; - width: 32px; height: 32px; border-radius: var(--radius-sm); + width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; - color: var(--text-secondary); cursor: pointer; position: relative; + color: var(--text-muted); cursor: pointer; position: relative; flex: none; } .iconbtn:hover { background: var(--surface-hover); color: var(--text); } -.iconbtn.txt { font: 600 11.5px/1 var(--sans); letter-spacing: .04em; } -/* Unread badge. Semantic red — it means "something needs you", which is separate from brand. */ +.iconbtn:disabled { opacity: .35; cursor: not-allowed; } +.iconbtn.bordered { border-color: var(--border-input); } +.iconbtn.txt { font: 600 12px/1 var(--sans); letter-spacing: .04em; } +/* Unread badge. Semantic red — "something needs you" is separate from brand. */ .iconbtn .cnt { - position: absolute; top: 1px; right: 0; - min-width: 15px; height: 15px; padding: 0 3px; + position: absolute; top: 3px; right: 2px; + min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--err); color: #fff; - font: 600 10px/15px var(--sans); text-align: center; + font: 600 10px/16px var(--sans); text-align: center; font-variant-numeric: tabular-nums; } -/* Launcher — how sibling apps appear side by side once they share a shell. */ +/* Lists inside a dialog: notifications and the account sheet. */ .applist { display: grid; gap: 8px; } .appcard { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); - border-radius: var(--radius); background: var(--surface); color: inherit; + border-radius: 12px; background: var(--surface); color: inherit; } a.appcard:hover, button.appcard:hover { background: var(--surface-hover); text-decoration: none; } button.appcard { width: 100%; font: inherit; text-align: left; cursor: pointer; } -.appcard.on { background: var(--surface-2); } .appcard .ai { - width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm); + width: 34px; height: 34px; flex: none; border-radius: var(--radius-sm); background: var(--brand-bg); color: var(--brand-fg); display: inline-flex; align-items: center; justify-content: center; } -.appcard .an { font-weight: 550; } -.appcard > svg:last-child { margin-left: auto; color: var(--text-faint); flex: none; } +.appcard .an { font-weight: 500; } .avatar { padding: 0; font-family: inherit; line-height: 1; - width: 30px; height: 30px; flex: none; border-radius: 50%; - /* --brand-ink, not --brand-bg: these are initials, and text needs 4.5:1. */ + width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--brand-ink); border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; - font-size: 11.5px; font-weight: 650; color: var(--brand-fg); cursor: pointer; + font-size: 12px; font-weight: 600; color: var(--brand-fg); cursor: pointer; } +/* A person in a table row: initials beside the name. */ +.who { display: inline-flex; align-items: center; gap: 8px; } +.who .avatar { width: 26px; height: 26px; font-size: 10.5px; cursor: default; } -.field { display: block; font-size: 12.5px; color: var(--text-secondary); } +.field { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); } .field > input, .field > select, .field > textarea, .pw-field > input { - display: block; width: 100%; margin-top: 5px; - padding: 8px 10px; border-radius: var(--radius-sm); + display: block; width: 100%; margin-top: 6px; + height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-input); background: var(--surface); - color: var(--text); font: inherit; font-size: 13.5px; + color: var(--text); font: inherit; font-size: 14px; font-weight: 400; +} +.field > select[multiple] { height: auto; padding: 6px; } +.field > input[type="file"] { padding: 8px 12px; height: auto; } +.field > textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; } +.field > input:focus, .field > select:focus, .field > textarea:focus, .pw-field > input:focus { + outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--surface-hover); } -.field > textarea { min-height: 78px; resize: vertical; } .pw-field { position: relative; display: block; } .pw-eye { - position: absolute; right: 6px; top: 50%; transform: translateY(-50%); - width: 26px; height: 26px; border: 0; background: transparent; + position: absolute; right: 7px; top: 50%; transform: translateY(-50%); + width: 28px; height: 28px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; } -.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } -.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; } -@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } } +input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; } +.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } +@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } } +/* A checkbox with its explanation, in a quiet panel. */ +.check { + display: flex; gap: 12px; align-items: flex-start; + padding: 14px 16px; border-radius: 12px; background: var(--surface-2); cursor: pointer; +} +.check input { margin-top: 2px; } +.check b { font-weight: 550; display: block; } /* ── page furniture ────────────────────────────────────────────────────── */ -.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; } -.page-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; } -.page-head .sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; } +.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; } +.page-head h2 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; } +.page-head .sub { color: var(--text-muted); font-size: 14px; margin-top: 6px; } +.page-head .eyebrow { color: var(--text-muted); font-size: 13px; font-weight: 500; margin-bottom: 8px; } +.page-head .eyebrow a { text-decoration: underline; text-underline-offset: 3px; } +.page-head h2 .chip { vertical-align: middle; margin-left: 10px; font-size: 12.5px; letter-spacing: 0; } /* `flex-wrap` on both, so a row of actions drops below the title instead of pushing the page sideways — a horizontally scrolling body is the one layout bug with no acceptable version. */ -.page-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; } +.page-head .acts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; } .card { background: var(--surface); border: 1px solid var(--border); - border-radius: var(--radius); padding: 16px; + border-radius: var(--radius); padding: 24px; } -.card + .card { margin-top: 14px; } -.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; } -.card h3 .n { color: var(--text-faint); font-weight: 500; margin-left: 6px; } +.card + .card { margin-top: 20px; } +.card h3 { margin: 0 0 18px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; } +.card h3 .n { color: var(--text-faint); font-weight: 500; margin-left: 8px; } +.card .intro { color: var(--text-muted); margin: -10px 0 18px; } +/* A card whose content is a table: the table runs edge to edge. */ +.card.flush { padding: 0; overflow: hidden; } +.card.flush > h3 { padding: 22px 24px 0; } -.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; } +.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; } .tile { background: var(--surface); border: 1px solid var(--border); - border-radius: var(--radius); padding: 14px 16px; + border-radius: var(--radius); padding: 20px 22px; } a.tile { color: inherit; text-decoration: none; } -a.tile:hover { border-color: var(--brand); } -.tile .k { font-size: 12px; color: var(--text-muted); } -.tile .v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; - letter-spacing: -.02em; margin-top: 2px; } -.tile.hot { border-color: var(--err); } -.tile.hot .v { color: var(--err); } -.tile.warn { border-color: var(--warn); } -.tile.warn .v { color: var(--warn); } +a.tile:hover { border-color: var(--accent); } +.tile .k { font-size: 13px; color: var(--text-muted); font-weight: 500; } +.tile .v { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; + letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; } .tablewrap { overflow-x: auto; } -table { width: 100%; border-collapse: collapse; font-size: 13.5px; } +table { width: 100%; border-collapse: collapse; font-size: 14px; } th { - text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; - color: var(--text-faint); font-weight: 600; padding: 6px 10px; + text-align: left; font-size: 12.5px; font-weight: 500; + color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; } -td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; } +td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; } +th:first-child, td:first-child { padding-left: 24px; } +th:last-child, td:last-child { padding-right: 24px; } tr:last-child td { border-bottom: 0; } -tbody tr.click:hover { background: var(--surface-2); cursor: pointer; } +tbody tr:hover { background: var(--surface-2); } +tr.faint td { color: var(--text-faint); } +td .ttl { font-weight: 550; } td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; } -td.mono { font-family: var(--mono); font-size: 12.5px; } +td.acts-cell .row { justify-content: flex-end; flex-wrap: nowrap; } +.mono { font-family: var(--mono); font-size: 12.5px; } .chip { - display: inline-flex; align-items: center; gap: 5px; - padding: 1px 8px; border-radius: 999px; font-size: 11.5px; + display: inline-flex; align-items: center; gap: 6px; + height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); white-space: nowrap; } .chip.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; } .chip.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; } .chip.err { background: var(--err-bg); color: var(--err); border-color: transparent; } - -/* A severity stripe reads faster than a number when you are scanning a list for the one row - that will ruin your week. */ -.stripe { border-left: 3px solid transparent; padding-left: 9px; } -.stripe.s3 { border-left-color: var(--err); } -.stripe.s2 { border-left-color: var(--warn); } -.stripe.s1 { border-left-color: var(--border-input); } +.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; } +.path { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-faint); } .banner { - padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; + padding: 12px 14px; border-radius: 12px; font-size: 13.5px; border: 1px solid var(--border); background: var(--surface-2); } .banner.err { background: var(--err-bg); color: var(--err); border-color: transparent; } .banner.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; } .banner.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; } -.banner + .banner, .card > .banner:first-child { margin-bottom: 12px; } +.banner + .banner, .card > .banner:first-child, .card > h3 + .banner { margin-bottom: 14px; } .empty { - padding: 40px 20px; text-align: center; color: var(--text-muted); - border: 1px dashed var(--border); border-radius: var(--radius); font-size: 13.5px; + padding: 48px 20px; text-align: center; color: var(--text-muted); + border: 1px dashed var(--line-faint); border-radius: var(--radius); font-size: 14px; } +.card.flush > .empty { border: 0; } .faint { color: var(--text-muted); } -.tiny { font-size: 12px; } +.tiny { font-size: 12.5px; } .wrap { overflow-wrap: anywhere; } -.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } -.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; } +.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } +.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; } .toolbar input, .toolbar select { - padding: 7px 10px; border-radius: var(--radius-sm); + height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-input); background: var(--surface); - color: var(--text); font: inherit; font-size: 13.5px; + color: var(--text); font: inherit; font-size: 14px; } -.toolbar input[type="search"] { min-width: 220px; } +.toolbar label.row { gap: 8px; } + +/* ── settings tabs ─────────────────────────────────────────────────────── */ +.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--border); margin-bottom: 24px; + overflow-x: auto; scrollbar-width: none; } +.tabs::-webkit-scrollbar { display: none; } +.tabs a { + display: inline-flex; align-items: center; gap: 8px; padding: 0 0 12px; + color: var(--text-muted); font-weight: 500; white-space: nowrap; + border-bottom: 2px solid transparent; margin-bottom: -1px; +} +.tabs a:hover { color: var(--text); text-decoration: none; } +.tabs a.on { color: var(--text); border-bottom-color: var(--accent); } +.tabs .n { font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; } + +/* ── new case: step 1, the choice ──────────────────────────────────────── */ +.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; } +.section-label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin: 0 0 12px; } +.choices + .section-label { margin-top: 32px; } +a.choice { + display: flex; flex-direction: column; gap: 6px; + padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); + background: var(--surface); color: inherit; transition: border-color .15s, box-shadow .15s; +} +a.choice:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(0, 0, 0, .06); text-decoration: none; } +.choice .ic { + width: 36px; height: 36px; border-radius: var(--radius-sm); margin-bottom: 8px; + background: var(--surface-2); color: var(--text); + display: inline-flex; align-items: center; justify-content: center; +} +.choice b { font-size: 15px; font-weight: 600; } +.choice .d { color: var(--text-muted); font-size: 13.5px; } +.choice .path { margin-top: 6px; font-size: 12.5px; } +.choice .path span { color: var(--text-secondary); } + +/* ── new case: step 2, the form beside its approval path ───────────────── */ +.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; } +.split .card + .card { margin-top: 0; } +.split .side .grid2 { grid-template-columns: 1fr; } +.form-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; } +.preview { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; } +.preview li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; + border-radius: 12px; background: var(--surface-2); } +.preview .num { width: 24px; height: 24px; border-radius: 50%; flex: none; font-size: 12px; font-weight: 600; + display: inline-flex; align-items: center; justify-content: center; + background: var(--surface); border: 1px solid var(--border); } /* ── modal ─────────────────────────────────────────────────────────────── */ #modalRoot:empty { display: none; } .scrim { - position: fixed; inset: 0; background: rgba(0, 0, 0, .4); + position: fixed; inset: 0; background: rgba(9, 9, 11, .45); display: flex; align-items: flex-start; justify-content: center; - padding: 40px 16px; z-index: 40; overflow-y: auto; + padding: 56px 16px; z-index: 40; overflow-y: auto; } -.modal, .search-modal { +.modal { background: var(--surface); border: 1px solid var(--border); - border-radius: 10px; box-shadow: var(--shadow); width: 100%; + border-radius: 20px; box-shadow: var(--shadow); width: 100%; + max-width: 560px; padding: 28px; } -.modal { max-width: 560px; padding: 20px; } -.modal.wide { max-width: 760px; } -.modal h3 { margin: 0 0 4px; font-size: 16px; } -.modal .msub { color: var(--text-muted); font-size: 12.5px; margin-bottom: 16px; } -.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; } -.modal .field + .field, .modal .grid2 + .field, .modal .field + .grid2 { margin-top: 12px; } +.modal.wide { max-width: 780px; } +.modal h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; } +.modal .msub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 20px; } +.modal h3 + #modalBody { margin-top: 18px; } +.modal .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; } +.modal .field + .field, .modal .grid2 + .field, .modal .field + .grid2, +.modal .field + .row, .modal .row + .field { margin-top: 14px; } /* The start screens: a form on the page rather than in a dialog. */ -.form > *, .form fieldset > *, #nrFields > * { margin-top: 12px; } -.form > :first-child, .form fieldset > :first-child { margin-top: 0; } +.form > *, .form fieldset > *, #nrFields > * { margin-top: 16px; } +.form > :first-child, .form fieldset > :first-child, #nrFields > :first-child { margin-top: 0; } +#nrFields:not(:empty) { margin-top: 16px; } +#nrFields.grid2 > * { margin-top: 0; } +#nrFields:empty { display: none; } fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; } fieldset.plain:disabled { opacity: .6; } /* The stage editor (settings, start screens, "add a stage") and its collapsed advanced settings. */ -.stage { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 10px; min-width: 0; } -.stage > .grid2, .stage > .field { margin-top: 10px; } -.adv { margin-top: 14px; } -.adv > summary { cursor: pointer; font-weight: 600; font-size: 13px; } -.adv > .grid2, .adv > .field, .adv > .row { margin-top: 10px; } -/* A run's detail: its stages (the current one marked) and the timeline, one list per round. */ -.stages, .timeline { margin: 0 0 10px; padding-left: 22px; } -.stages li, .timeline li { padding: 6px 0; } -.stages li.on { font-weight: 600; } -.stages li > * + * { margin-left: 8px; } -.timeline li + li { border-top: 1px solid var(--border); } -.tl-note { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; } +.stage { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; min-width: 0; } +.stage > .grid2, .stage > .field { margin-top: 12px; } +.adv { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; } +.adv > summary { cursor: pointer; font-weight: 550; font-size: 13.5px; } +.adv > .grid2, .adv > .field, .adv > .row { margin-top: 12px; } +.field .row { margin-top: 8px; font-weight: 400; } -/* ── command palette ───────────────────────────────────────────────────── */ -/* After the modal on purpose: it sits on the dialog's `.scrim` and overrides its padding at equal - specificity by coming later. It shares the dialog's box (see `.modal, .search-modal`) but not its - padding, so its dividers run edge to edge. It sits higher than a dialog — reached from anywhere, - including from on top of one — and lands where the eye already is rather than centred. */ -.search-scrim { padding-top: 12vh; } -.search-modal { max-width: 620px; overflow: hidden; } -.search-modal .sin { - display: flex; align-items: center; gap: 10px; - padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); +/* ── run detail ────────────────────────────────────────────────────────── */ +.run-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 20px; } +.run-grid .card + .card { margin-top: 20px; } + +/* The stages as a horizontal path; the current one is ringed, the ones still ahead dashed. */ +.stages { list-style: none; margin: 0; padding: 0; display: flex; gap: 12px; } +.stages li { flex: 1; min-width: 0; position: relative; } +.stages li:not(:last-child)::after { + content: ""; position: absolute; top: 15px; left: 42px; right: 4px; + height: 1px; background: var(--border); } -.search-modal .sin input { - flex: 1; border: 0; background: none; color: var(--text); - font: inherit; font-size: 15px; outline: none; padding: 0; +.stages .dot { + width: 32px; height: 32px; border-radius: 50%; margin-bottom: 12px; + display: inline-flex; align-items: center; justify-content: center; + font-size: 13px; font-weight: 600; background: var(--surface); + border: 1px dashed var(--line-faint); color: var(--text-muted); } -.search-results { max-height: 58vh; overflow-y: auto; overflow-x: hidden; } -.search-results .sgroup { - padding: 8px 14px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; - text-transform: uppercase; color: var(--text-faint); +.stages li.done .dot { border: 0; background: var(--ok-bg); color: var(--ok); } +.stages li.on .dot { border: 0; background: var(--accent); color: var(--accent-text); + box-shadow: 0 0 0 4px var(--surface-hover); } +.stages .nm { font-weight: 600; display: block; } +.stages li.todo .nm { color: var(--text-muted); font-weight: 500; } +.stages .meta { font-size: 12.5px; color: var(--text-muted); display: block; margin-top: 2px; } +.stages .you { font-size: 12.5px; color: var(--text); font-weight: 550; display: block; margin-top: 4px; } +.round-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); } + +.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; } +.facts .k { font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; } +.facts .v { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; } +.lock { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; + border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; } + +/* Newest first, on a rail; the dot's colour is what happened. */ +.timeline { list-style: none; margin: 0; padding: 0; } +.timeline li { position: relative; padding: 0 0 22px 26px; } +.timeline li::before { + content: ""; position: absolute; left: 0; top: 6px; + width: 10px; height: 10px; border-radius: 50%; background: var(--line-faint); + box-shadow: 0 0 0 3px var(--surface); } -.search-results .sitem { - display: flex; align-items: center; gap: 10px; width: 100%; - padding: 8px 14px; border: 0; background: none; color: var(--text); - font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; +.timeline li:not(:last-child)::after { + content: ""; position: absolute; left: 4.5px; top: 18px; bottom: 2px; + width: 1px; background: var(--border); } -.search-results .sitem:hover, .search-results .sitem.on { background: var(--surface-hover); } -.search-results .sitem .ic { color: var(--text-muted); flex: none; display: flex; } -.search-results .sitem .sb { min-width: 0; flex: 1; } -/* Block, or the ellipsis never applies: overflow clipping needs a box, and these are spans. */ -.search-results .sitem .st, .search-results .sitem .ss { display: block; } -.search-results .sitem .st { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.search-results .sitem .ss { - font-size: 12px; color: var(--text-muted); - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; +.timeline li:last-child { padding-bottom: 0; } +.timeline li.k-ok::before { background: var(--ok); } +.timeline li.k-err::before { background: var(--err); } +.timeline li.k-warn::before { background: var(--warn); } +.timeline li.k-start::before { background: var(--accent); } +.timeline .what { font-weight: 550; } +.timeline .meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; } +.tl-note { + white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 4px; + padding: 10px 12px; border-radius: 10px; background: var(--surface-2); + border-left: 2px solid var(--line-faint); font-size: 13.5px; } -.search-modal .shint { - padding: 8px 14px; border-top: 1px solid var(--border); - font-size: 11.5px; color: var(--text-faint); -} -.search-empty { padding: 22px 14px; text-align: center; color: var(--text-muted); font-size: 13px; } /* ── toast ─────────────────────────────────────────────────────────────── */ -#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; } +#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; } .toast { background: var(--accent); color: var(--accent-text); - padding: 9px 15px; border-radius: var(--radius-sm); - font-size: 13px; box-shadow: var(--shadow); + padding: 10px 16px; border-radius: 12px; + font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow); } @media (prefers-reduced-motion: reduce) { @@ -474,48 +524,53 @@ fieldset.plain:disabled { opacity: .6; } /* ── narrow screens ─────────────────────────────────────────────────────── */ /* Breakpoints are last in the file on purpose, widest first: a media query adds no specificity, so an override only wins if it comes after the rule it overrides. */ +@media (max-width: 1100px) { + .run-grid, .split { grid-template-columns: 1fr; } +} + @media (max-width: 880px) { /* `visibility` as well as `transform`: a closed drawer must not be clickable or reachable by keyboard, and a translated-off panel still is. */ .sidebar { position: fixed; z-index: 20; transform: translateX(-100%); visibility: hidden; - /* Only `transform` transitions. `visibility` flips instantly in both directions, and is - deliberately NOT delayed to animate the slide-out: any transition on visibility — even a - 0s one with a delay — needs the transition machinery to tick, and when frames are - throttled (a background tab, a compositor that is not running) the drawer gets stuck in - whichever state it was in. An instant close is worth more than 180ms of slide. */ + /* Only `transform` transitions. Any transition on visibility needs the transition machinery to + tick, and when frames are throttled the drawer gets stuck in whichever state it was in. */ transition: transform .18s; } .sidebar.open { transform: none; visibility: visible; } #navToggle { display: inline-flex; } #navScrim.on { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 19; } - .content { padding: 16px; } + .content { padding: 20px 16px 40px; } - /* Nine controls at 30px each leave the breadcrumb exactly 0 pixels. On a phone the top bar - keeps only what you need constantly, and the rest moves into the account sheet. */ + /* On a phone the top bar keeps only what you need constantly; the rest moves into the account sheet. */ .topbar .js-tool { display: none; } .appcard.m-only { display: flex; } - .search-modal .shint { display: none; } /* no Esc key on a phone */ - .search-results { max-height: 62vh; } - .topbar { padding: 10px 12px; gap: 6px; } - .page-head { margin-bottom: 14px; } + .topbar { height: 56px; padding: 0 12px; gap: 4px; } + .page-head { margin-bottom: 20px; } + .page-head h2 { font-size: 24px; } .page-head .acts { margin-left: 0; width: 100%; } .page-head .acts .btn { flex: 1; justify-content: center; } - .toolbar input[type="search"] { min-width: 0; flex: 1; } + .card { padding: 18px; } + .card.flush > h3 { padding: 18px 18px 0; } .scrim { padding: 12px; } - .search-scrim { padding-top: 8vh; } - .modal { padding: 16px; } + .modal { padding: 20px; } .modal .acts { flex-wrap: wrap; } .modal .acts .btn { flex: 1; justify-content: center; } - .tile .v { font-size: 20px; } + .tile .v { font-size: 26px; } + .stages { flex-direction: column; gap: 16px; } + .stages li { display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; } + .stages .dot { margin: 0; grid-row: span 3; } + .stages li:not(:last-child)::after { display: none; } + .facts { grid-template-columns: 1fr; } + .form-foot .btn { flex: 1; justify-content: center; } } /* ── phones: data tables become stacked cards ──────────────────────────── */ @media (max-width: 640px) { table.rt thead { display: none; } table.rt, table.rt tbody, table.rt tr { display: block; width: 100%; } - table.rt tr { padding: 10px 0; border-bottom: 1px solid var(--border); } + table.rt tr { padding: 12px 18px; border-bottom: 1px solid var(--border); } table.rt tr:last-child { border-bottom: 0; } table.rt td { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; @@ -523,9 +578,9 @@ fieldset.plain:disabled { opacity: .6; } } table.rt td::before { content: attr(data-label); flex: none; text-align: left; padding-top: 2px; - font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); + font-size: 12px; color: var(--text-muted); } - table.rt td:first-child { justify-content: flex-start; text-align: left; font-weight: 600; padding-bottom: 6px; } + table.rt td:first-child { justify-content: flex-start; text-align: left; padding-bottom: 8px; } table.rt td:first-child::before, table.rt td.acts-cell::before { content: none; } table.rt td.acts-cell { justify-content: flex-end; padding-top: 8px; } table.rt td:not(:first-child) .row { justify-content: flex-end; } diff --git a/frontend/app.js b/frontend/app.js index ae788fc..b525a89 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -155,6 +155,8 @@ const ICN = { up: '', // tabler: arrow-down down: '', + // tabler: lock + lock: '', // tabler: logout logout: '', }; @@ -372,6 +374,23 @@ const I18N = { 'Potwierdź przeczytaną wersję.': 'Confirm the version you read.', 'Obieg zmienił się w międzyczasie': 'The run changed in the meantime', 'Zmiana wniosku unieważnia dotychczasowe zatwierdzenia.': 'Changing the request voids the approvals given so far.', + 'Nowa sprawa': 'New case', + 'Krok 1 z 2': 'Step 1 of 2', + 'Krok 2 z 2': 'Step 2 of 2', + 'Czego dotyczy sprawa?': 'What is the case about?', + 'Wybierz, a pokażemy właściwy formularz i ścieżkę akceptacji.': 'Choose, and you get the right form and approval path.', + 'Dokument do zatwierdzenia': 'A document to approve', + 'Plik z komputera': 'A file from your computer', + 'Wgraj plik i ustal, kto go zatwierdza.': 'Upload a file and decide who approves it.', + 'Wybierz dokument z repozytorium kancelarii.': "Pick a document from the firm's repository.", + 'Zmień rodzaj sprawy': 'Change the kind of case', + 'Wstecz': 'Back', + 'Ścieżka obiegu': 'Approval path', + 'Bez tego pola zablokują się po złożeniu.': 'Without it the fields lock once filed.', + 'Szczegóły': 'Details', + 'czeka na Ciebie': 'waiting for you', + 'Złożono': 'Filed', + 'Szablony': 'Templates', }; let LANG = (function () { @@ -528,11 +547,9 @@ const isModerator = () => !!(state.user && state.user.is_moderator); hiding them is only about not offering a door that answers 403. */ const NAV = [ { hash: '#/', icon: 'dashboard', label: 'Pulpit' }, - { hash: '#/inbox', icon: 'inbox', label: 'Czeka na mnie' }, + { hash: '#/inbox', icon: 'inbox', label: 'Czeka na mnie', badge: 'inbox' }, { hash: '#/mine', icon: 'folder', label: 'Moje' }, { hash: '#/archive', icon: 'archive', label: 'Archiwum' }, - { hash: '#/requests/new', icon: 'file', label: 'Nowy wniosek' }, - { hash: '#/runs/new', icon: 'plus', label: 'Nowy obieg' }, { hash: '#/settings', icon: 'settings', label: 'Ustawienia', mod: true }, ]; @@ -565,8 +582,9 @@ function pageHead(title, sub, actions) { return `

${esc(title)}

${sub ? `
${esc(sub)}
` : ''}
${actions ? `
${actions}
` : ''}
`; } -function field(label, value) { - return `
${esc(label)}
${value == null || value === '' ? '—' : esc(String(value))}
`; +/* One fact of a run's subject: a label in the console's words over a value that is people's text. */ +function field(label, value, cls) { + return `
${esc(label)}
${value == null || value === '' ? '—' : esc(String(value))}
`; } function parseHash() { @@ -587,15 +605,17 @@ async function router() { const path = seg.join('/'); C.innerHTML = '
Wczytywanie…
'; refreshNotes(); + refreshCounts(); try { if (!seg.length) await viewDashboard(C); else if (path === 'inbox') await viewList(C, '/inbox', 'Czeka na mnie'); else if (path === 'mine') await viewList(C, '/mine', 'Moje'); else if (path === 'archive') await viewArchive(C, q); - else if (path === 'requests/new') await viewNewRequest(C); - else if (path === 'runs/new') await viewNewRun(C); + else if (path === 'new') await viewNewCase(C); + else if (path === 'requests/new') await viewNewRequest(C, q); + else if (path === 'runs/new') await viewNewRun(C, q); else if (seg[0] === 'runs' && seg.length === 2) await viewRun(C, seg[1]); - else if (path === 'settings' && isModerator()) await viewSettings(C); + else if (path === 'settings' && isModerator()) await viewSettings(C, q); else if (seg[0] === 'admin') await viewAdmin(C); else C.innerHTML = '
Nie znaleziono strony.
'; } catch (ex) { @@ -612,10 +632,22 @@ async function router() { the stats contract keeps the number and the screen behind it equal. */ async function viewDashboard(C) { setCrumb([{ label: 'Pulpit' }]); - const stats = await api('GET', '/stats'); + const [stats, inbox] = await Promise.all([api('GET', '/stats'), api('GET', '/inbox')]); C.innerHTML = pageHead('Pulpit', state.user.full_name || state.user.email) + `
${stats.tiles.map((t) => ` -
${esc(t.label)}
${esc(t.count)}
`).join('')}
`; +
${esc(t.label)}
${esc(t.count)}
`).join('')}` + + `

Czeka na mnie

${runTable(inbox)}
`; +} + +/* The inbox badge in the menu: the same /stats tile the dashboard shows. Never awaited, never + fatal, like the notification badge. */ +async function refreshCounts() { + try { + const stats = await api('GET', '/stats'); + const t = stats.tiles.find((x) => x.link === 'inbox'); + state.counts = { inbox: t ? t.count : 0 }; + } catch { return; } + renderNav(state.counts); } /* ── runs: lists ────────────────────────────────────────────────────────── */ @@ -642,16 +674,17 @@ function typeName(key) { function runTable(rows) { if (!rows.length) return '
Brak wyników
'; return `
- + ${rows.map((r) => { const [label, cls] = RUN_STATE[r.state] || [r.state, '']; + const who = userName(r.started_by); return ` - -
${esc(KIND[r.subject_kind] || r.subject_kind)}${r.request_type - ? `
${esc(typeName(r.request_type))}
` : ''}
+
- ${esc(label)} - ${esc(userName(r.started_by))} + ${esc(label)} + ${esc(who)} `; }).join('')}
PrzedmiotRodzajEtapStanInicjatorRozpoczętoPrzedmiotEtapStanInicjatorRozpoczęto
${esc(r.title)}
${esc(r.title)} +
${esc(KIND[r.subject_kind] || r.subject_kind)}${r.request_type + ? ` · ${esc(typeName(r.request_type))}` : ''}
${esc(r.stage_name || '—')}${fmtDateTime(r.created_at)}
`; @@ -660,7 +693,7 @@ function runTable(rows) { async function viewList(C, path, title) { setCrumb([{ label: title }]); const rows = await api('GET', path); - C.innerHTML = pageHead(title, '') + `
${runTable(rows)}
`; + C.innerHTML = pageHead(title, '') + `
${runTable(rows)}
`; } /* The filters live in the hash, so a filtered archive is a link and the CSV is the same query. */ @@ -690,7 +723,7 @@ async function viewArchive(C, q) { Wyczyść ` - + `
${runTable(rows)}
`; + + `
${runTable(rows)}
`; } /* The query is read at click time, never spliced into the onclick: an attribute's entities are @@ -716,10 +749,14 @@ async function loadStart() { const templateOptions = (templateId) => state.start.templates .map((p) => option(p.id, p.name, p.id === templateId)).join('') + option('', _tr('Własny obieg'), !templateId); +/* The path card of a start screen: the template, its stages as a preview, and the editor once the + starter wants them changed. */ function layoutPicker(templateId) { - return `
Szablon obiegu
- -
`; + return `

Ścieżka obiegu

+ +
    + +
    `; } /* Switching the template starts the editor again from it: the base changed, so do the stages. */ @@ -728,7 +765,10 @@ function layoutChanged() { const t = state.start.templates.find((p) => p.id === id); $('lpChangeRow').classList.toggle('hidden', !t); const own = !t || $('lpChange').checked; - $('lpEditor').innerHTML = !own ? '' : `
    Etapy
    + $('lpPreview').innerHTML = own ? '' : t.stages.map((s, i) => + `
  1. ${i + 1}${esc(s.name)}
  2. `).join(''); + $('lpPreview').classList.toggle('hidden', own); + $('lpEditor').innerHTML = !own ? '' : `
    Etapy
    ${stageEditor('lpStages', t ? t.stages : [], { allowRole: state.start.allowRole, groups: state.start.groups })} ${settingsEditor('lpSet', t ? t.settings : null)} ${isModerator() ? `
    ` : ''}`; @@ -764,37 +804,57 @@ function saveLayoutAsTemplate() { const goToRun = (res) => { location.hash = `#/runs/${encodeURIComponent(res.run_id)}`; }; -/* Nowy obieg: an upload, or — only when this deployment knows a Galena (`/options` - galena_enabled) — a Galena document by id and path, re-pinned by the server at start. */ -async function viewNewRun(C) { - setCrumb([{ label: 'Nowy obieg' }]); - const [opts] = await Promise.all([api('GET', '/options'), loadStart()]); - const galena = !!opts.galena_enabled; - C.innerHTML = pageHead('Nowy obieg', '') - + `
    - ${galena ? `
    Przedmiot obiegu - -
    ` : ''} - - ${galena ? `` : ''} - ${layoutPicker(null)} -
    -
    `; - layoutChanged(); +/* Nowa sprawa, step 1: one door for every start. A request type is a card (its fields and its + default path say what it is); a file is a card; a Galena document is a card only when this + deployment knows a Galena (`/options` galena_enabled). Step 2 is the matching form. */ +async function viewNewCase(C) { + setCrumb([{ label: 'Nowa sprawa' }]); + const [opts, templates, fields] = await Promise.all([ + api('GET', '/options'), api('GET', '/templates'), api('GET', '/request-fields')]); + const byKey = Object.fromEntries(fields.map((f) => [f.key, f])); + const path = (id) => { + const t = templates.find((p) => p.id === id); + return t ? `
    ${t.stages.map((s) => `${esc(s.name)}`).join(' → ')}
    ` : ''; + }; + const card = (href, icon, name, desc, extra) => ` + ${svg(icon, 18)}${name}${desc}${extra || ''}`; + const types = state.types.map((t) => card(`#/requests/new?type=${encodeURIComponent(t.id)}`, ICN.file, + `${esc(t.name)}`, + `${esc(t.field_keys.map((k) => byKey[k] && byKey[k].label).filter(Boolean).join(', ') || '—')}`, + path(t.default_template_id))).join(''); + C.innerHTML = `
    Krok 1 z 2

    Czego dotyczy sprawa?

    +
    Wybierz, a pokażemy właściwy formularz i ścieżkę akceptacji.
    +
    Wniosek
    + ${types ? `
    ${types}
    ` : '
    Moderator nie zdefiniował jeszcze typów wniosków.
    '} +
    Dokument do zatwierdzenia
    +
    ${card('#/runs/new?kind=file', ICN.download, 'Plik z komputera', 'Wgraj plik i ustal, kto go zatwierdza.')}${opts.galena_enabled + ? card('#/runs/new?kind=document', ICN.folder, 'Dokument z Galeny', 'Wybierz dokument z repozytorium kancelarii.') : ''}
    `; } -/* A Galena role is a stage only a document can have, so the editor offers it only then. */ -function subjectKind(kind) { - const doc = kind === 'document'; - $('nsFileRow').classList.toggle('hidden', doc); - $('nsDocRow').classList.toggle('hidden', !doc); +/* The step-2 head: where it came from and the way back to the choice. `title` is already escaped. */ +function stepHead(title) { + return `
    Krok 2 z 2 · Zmień rodzaj sprawy
    +

    ${title}

    `; +} +const stepFoot = (label) => `
    Wstecz +
    `; + +/* Nowa sprawa, a document: an upload, or a Galena document by id and path, re-pinned by the server + at start. A Galena role is a stage only a document can have, so the editor offers it only then. */ +async function viewNewRun(C, q) { + const [opts] = await Promise.all([api('GET', '/options'), loadStart()]); + const doc = q.kind === 'document' && !!opts.galena_enabled; + const name = doc ? 'Dokument z Galeny' : 'Plik z komputera'; + setCrumb([{ label: 'Nowa sprawa', href: '#/new' }, { label: name }]); state.start.allowRole = doc; - if ($('lpStages')) { - _stageOpts.lpStages.allowRole = doc; - setStages('lpStages', readStages('lpStages')); - } + C.innerHTML = stepHead(esc(name)) + + `
    +

    Przedmiot obiegu

    ${doc + ? ` + ` + : ''}
    + ${layoutPicker(null)}
    ${stepFoot('Rozpocznij obieg')}
    `; + layoutChanged(); } function startRun(e) { @@ -814,36 +874,32 @@ function startRun(e) { }); } -/* Nowy wniosek: the type's form, then the run. Filing and starting are two calls, so a run that - is refused leaves a filed request: its id is kept and its part of the form locked, and the next - click only retries the start. */ +/* Nowa sprawa, a request: the type chosen in step 1, its form, then the run. Filing and starting + are two calls, so a run that is refused leaves a filed request: its id is kept and its part of + the form locked, and the next click only retries the start. */ let _filed = null; -async function viewNewRequest(C) { - setCrumb([{ label: 'Nowy wniosek' }]); +async function viewNewRequest(C, q) { + const t = state.types.find((x) => x.id === q.type); + if (!t) { location.hash = '#/new'; return; } // no type (an old link, an archived one): choose + setCrumb([{ label: 'Nowa sprawa', href: '#/new' }, { label: t.name }]); _filed = null; const [fields] = await Promise.all([api('GET', '/request-fields'), loadStart()]); - state.start.fields = fields; - if (!state.types.length) { - C.innerHTML = pageHead('Nowy wniosek', '') + '
    Moderator nie zdefiniował jeszcze typów wniosków.
    '; - return; - } - C.innerHTML = pageHead('Nowy wniosek', '') - + `
    -
    - + const byKey = Object.fromEntries(fields.map((f) => [f.key, f])); + // Archived fields are left out: core refuses a new value for them. + const inputs = t.field_keys.map((k) => byKey[k]).filter((f) => f && !f.archived).map((f) => fieldInput(f)).join(''); + C.innerHTML = stepHead(`Wniosek: ${esc(t.name)}`) + + `
    +

    Wniosek

    -
    - -
    -
    -
    - `; - requestType(); +
    ${inputs}
    + ${t.attachments_allowed ? '' : ''} + +
    + ${layoutPicker(t.default_template_id)}${stepFoot('Złóż wniosek')}`; + layoutChanged(); } -/* The chosen type's fields (archived ones are left out: core refuses a new value for them), its - attachments, and its default template preselected. */ /* One request field as a form control, prefilled with `v` (the edit form's current value). */ function fieldInput(f, v) { const a = `data-v="${esc(f.key)}"`; @@ -855,17 +911,6 @@ function fieldInput(f, v) { return ``; } -function requestType() { - const t = state.types.find((x) => x.id === $('nrType').value); - const byKey = Object.fromEntries(state.start.fields.map((f) => [f.key, f])); - $('nrFields').innerHTML = t.field_keys.map((k) => byKey[k]).filter((f) => f && !f.archived).map((f) => fieldInput(f)).join('') - + (t.attachments_allowed ? '' : ''); - $('nrLayout').innerHTML = layoutPicker(t.default_template_id); - localize($('nrFields')); - localize($('nrLayout')); - layoutChanged(); -} - /* Only what was filled in is sent; a yes / no field is always an answer. An edit (`clear`) sends an emptied field as null, which is how a partial write clears it. */ function readValues(rootId, clear) { @@ -931,31 +976,32 @@ async function viewRun(C, id) { _run = Object.assign(run, { request, fields }); setCrumb([{ label: 'Moje', href: '#/mine' }, { label: run.title }]); const [label, cls] = RUN_STATE[run.state] || [run.state, '']; - C.innerHTML = `

    ${esc(run.title)}

    -
    ${esc(KIND[run.subject_kind] || run.subject_kind)}${run.template_name - ? ` · ${esc(run.template_name)}` : ''} · ${esc(userName(run.started_by))} - · ${fmtDateTime(run.created_at)}
    -
    ${esc(label)}
    ` - + runActions() + subjectCard() + stagesCard() + timelineCard(); + C.innerHTML = `
    +
    ${esc(KIND[run.subject_kind] || run.subject_kind)}${run.template_name + ? ` · ${esc(run.template_name)}` : ''}
    +

    ${esc(run.title)}${esc(label)}

    +
    ${esc(userName(run.started_by))} · ${fmtDateTime(run.created_at)}
    + ${runActions()}
    ` + + stagesCard() + + `
    ${subjectCard()}
    ${timelineCard()}
    `; } -/* The action bar: only what the flags allow, and the stage's own way of approving it. */ +/* The action bar, in the page head: only what the flags allow, the stage's own way of approving + last (the primary one, where the eye ends). */ function runActions() { const r = _run; const stage = stageAt(r.current); const b = (action, primary) => ``; const out = []; - if (r.can_act) { - out.push(b(stage && stage.type === 'podpis_papierowy' ? 'paper_scan' : 'approve', true), b('reject')); - if (r.current > 0) out.push(b('back')); - } + if (mayEditRequest()) out.push(``); if (r.can_add_stage) out.push(``); if (r.can_refresh) out.push(b('refresh')); if (r.can_cancel) out.push(b('cancel')); - if (mayEditRequest()) out.push(``); - if (!out.length) return ''; - return `
    ${stage - ? `Bieżący etap ${esc(stage.name)}` : ''}${out.join('')}
    `; + if (r.can_act) { + if (r.current > 0) out.push(b('back')); + out.push(b('reject'), b(stage && stage.type === 'podpis_papierowy' ? 'paper_scan' : 'approve', true)); + } + return out.length ? `
    ${out.join('')}
    ` : ''; } /* requests.update's rule as far as this screen knows it: the filer or a moderator, while this run @@ -972,12 +1018,11 @@ function subjectCard() { const gone = r.subject_available ? '' : ''; let body = ''; if (r.subject_kind === 'file') { - body = `
    ${field('Plik', s.name)}
    sha256
    ${esc(shortHash(s.sha256))}
    - ${r.subject_available ? `
    ` : ''}`; + body = `
    ${field('Plik', s.name)}${field('sha256', shortHash(s.sha256), 'mono')}
    + ${r.subject_available ? `
    ` : ''}`; } else if (r.subject_kind === 'document') { - body = `
    Ścieżka dokumentu
    ${esc(s.path)}
    -
    Commit
    ${esc(shortHash(s.commit_sha))}
    -
    Dokument czytasz w Galenie; ten obieg zatwierdza wskazany commit.
    `; + body = `
    ${field('Ścieżka dokumentu', s.path, 'mono')}${field('Commit', shortHash(s.commit_sha), 'mono')}
    +
    ${svg(ICN.folder, 14)}Dokument czytasz w Galenie; ten obieg zatwierdza wskazany commit.
    `; } else if (r.request) { const q = r.request; const byKey = Object.fromEntries(r.fields.map((f) => [f.key, f])); @@ -987,17 +1032,18 @@ function subjectCard() { if (f && f.kind === 'choice') { const o = f.options.find((x) => x.key === v); return o ? o.label : v; } return v; }; + // Field labels are people's text, so the label stays untranslated too. const rows = Object.keys(q.values).filter((k) => q.values[k] != null) - .map((k) => `
    ${esc(byKey[k] ? byKey[k].label : k)}
    ${esc(show(k, q.values[k]))}
    `).join(''); - const files = q.attachments.map((a, i) => ``).join(''); - body = `
    ${field('Typ wniosku', typeName(r.request_type))}${field('Inicjator', userName(q.created_by))}${rows}
    - ${files ? `
    Załączniki
    ${files}
    ` : ''} -
    ${q.editable_in_run ? 'Można edytować w trakcie obiegu' : 'Zablokowany w trakcie obiegu'}
    `; + .map((k) => `
    ${esc(byKey[k] ? byKey[k].label : k)}
    ${esc(show(k, q.values[k]))}
    `).join(''); + const files = q.attachments.map((a, i) => ``).join(''); + body = `
    ${rows}${field('Typ wniosku', typeName(r.request_type))}${field('Inicjator', userName(q.created_by))}
    + ${files ? `
    Załączniki
    ${files}
    ` : ''} +
    ${svg(ICN.lock, 14)}${q.editable_in_run ? 'Można edytować w trakcie obiegu' : 'Zablokowany w trakcie obiegu'}
    `; } - const scan = r.scan ? `
    Skan podpisanego dokumentu
    ${r.scan.file_id - ? `` + const scan = r.scan ? `
    Skan podpisanego dokumentu
    ${r.scan.file_id + ? `` : `${esc(r.scan.path || '')}(w Galenie)`}
    ` : ''; - return `

    Przedmiot

    ${gone}${body}${scan}
    `; + return `

    Szczegóły

    ${gone}${body}${scan}
    `; } /* Bytes only as a download, by an id read at click time. */ @@ -1005,13 +1051,20 @@ function downloadSubject() { downloadFile(`/files/${encodeURIComponent(_run.subj function downloadAttachment(i) { downloadFile(`/files/${encodeURIComponent(_run.request.attachments[i].file_id)}`); } function downloadScan() { downloadFile(`/files/${encodeURIComponent(_run.scan.file_id)}`); } +/* The stages as a path: behind the current one done, the current one ringed, the rest dashed. A + finished run shows no current stage; an approved or signed one shows every stage done. */ function stagesCard() { const r = _run; - return `

    Etapy${esc(r.stages.length)}

      ${r.stages.map((s, i) => ` -
    1. ${esc(s.name)} - ${esc(STAGE_TYPE[s.type] || s.type)} · ${esc(QUORUM[s.quorum] || s.quorum)} - ${i === r.current ? 'Bieżący etap' : ''}
    2. `).join('')}
    - ${r.state === 'w_toku' ? `
    Runda ${esc(r.round)}
    ` : ''}
    `; + const running = r.state === 'w_toku'; + const done = (i) => r.state === 'zatwierdzony' || r.state === 'podpisany' || (running && i < r.current); + return `

    Etapy${esc(r.stages.length)}

      ${r.stages.map((s, i) => { + const on = running && i === r.current; + return `
    1. ${done(i) ? svg(ICN.check, 14) : esc(i + 1)} + ${esc(s.name)} + ${esc(STAGE_TYPE[s.type] || s.type)} · ${esc(QUORUM[s.quorum] || s.quorum)} + ${on && r.can_act ? 'czeka na Ciebie' : ''}
    2. `; + }).join('')}
    + ${running && r.round > 1 ? `
    Runda ${esc(r.round)}
    ` : ''}
    `; } /* The evidence an entry rests on: a document's commit, the hash of the file, of the request's @@ -1022,21 +1075,26 @@ function evidenceHtml(e) { const from = stageAt(e.stage_from); const what = from && from.type === 'podpis_papierowy' && e.kind !== 'start' ? 'Hash skanu' : _run.subject_kind === 'request' ? 'Hash migawki' : 'Hash pliku'; - return `
    ${ev.commit_sha ? `Commit ${esc(shortHash(ev.commit_sha))} · ` : ''}${ev.sha256 + return `
    ${ev.commit_sha ? `Commit ${esc(shortHash(ev.commit_sha))} · ` : ''}${ev.sha256 ? `${what} ${esc(shortHash(ev.sha256))}` : ''}
    `; } +/* The dot's colour is what happened. */ +const TL_TONE = { + start: 'k-start', zatwierdzenie: 'k-ok', zakonczenie: 'k-ok', + odrzucenie: 'k-err', cofniecie: 'k-warn', anulowanie: 'k-warn', +}; + +/* Newest first, one rail; the round is named on each entry once there has been more than one. */ function timelineCard() { - const rounds = new Map(); - _run.timeline.forEach((e) => rounds.set(e.round, (rounds.get(e.round) || []).concat([e]))); const name = (i) => (stageAt(i) ? stageAt(i).name : '—'); - const item = (e) => `
  3. ${esc(NOTE_KIND[e.kind] || e.kind)} - ${esc(userName(e.actor_id))} · ${fmtDateTime(e.created_at)}
    - ${e.stage_from != null || e.stage_to != null ? `
    ${esc(name(e.stage_from))} → ${esc(name(e.stage_to))}
    ` : ''} + const rounds = new Set(_run.timeline.map((e) => e.round)).size > 1; + const item = (e) => `
  4. ${esc(NOTE_KIND[e.kind] || e.kind)}
    +
    ${rounds ? `Runda ${esc(e.round)} · ` : ''}${esc(userName(e.actor_id))} · ${fmtDateTime(e.created_at)}
    + ${e.stage_from != null || e.stage_to != null ? `
    ${esc(name(e.stage_from))} → ${esc(name(e.stage_to))}
    ` : ''} ${e.note ? `
    ${esc(e.note)}
    ` : ''}${evidenceHtml(e)}
  5. `; - return `

    Oś czasu

    ${[...rounds].map(([n, events]) => ` -
    Runda ${esc(n)}
      ${events.map(item).join('')}
    `).join('') - || '
    —
    '}
    `; + return `

    Oś czasu

    ${_run.timeline.length + ? `
      ${[..._run.timeline].reverse().map(item).join('')}
    ` : '
    —
    '}
    `; } const noteField = (required) => ``; @@ -1375,39 +1433,48 @@ const ADMIN = { }, }; -async function viewSettings(C) { +/* One tab per kind, the tab in the hash (`#/settings?tab=type`) so a save, which re-renders through + the router, lands back on it. */ +async function viewSettings(C, q) { setCrumb([{ label: 'Ustawienia' }]); const kinds = Object.keys(ADMIN); const lists = await Promise.all(kinds.map((k) => api('GET', ADMIN[k].path))); kinds.forEach((k, i) => { state.admin[ADMIN[k].list] = lists[i]; }); const A = state.admin; + const tab = ADMIN[q.tab] ? q.tab : kinds[0]; const names = (ids, all, key, label) => ids.map((id) => { const x = all.find((y) => y[key] === id); return x ? x[label] : '—'; }).join(', '); + const live = (kind) => A[ADMIN[kind].list].filter((x) => !x.archived).length; const card = (kind, heads, cells) => { const rows = A[ADMIN[kind].list]; - return `

    ${esc(ADMIN[kind].title)}${rows.length} + return `

    ${esc(ADMIN[kind].title)}

    ${rows.length ? `
    ${heads.map((h) => ``).join('')} - ${rows.map((x, i) => `${cells(x)}${rows.map((x, i) => `${cells(x)}`).join('')} -
    ${esc(h)}
    ${x.archived +
    ${x.archived ? 'Zarchiwizowane' - : `
    -
    `}
    ` : '
    Brak wyników
    '}
    `; + : `
    +
    `}`).join('')} +

    ` : '
    Brak wyników
    '}
    `; }; - C.innerHTML = pageHead('Ustawienia', 'Grupy, pola i typy wniosków, szablony obiegów') - + card('group', ['Nazwa', 'Członkowie'], (g) => `${esc(g.name)} - ${esc(g.member_ids.map(userName).join(', ') || '—')}`) - + card('field', ['Nazwa', 'Rodzaj pola', 'Opcje listy'], (f) => `${esc(f.label)} + const chips = (p) => p.stages.map((s) => `${esc(s.name)}`).join(' → '); + const CARDS = { + group: () => card('group', ['Nazwa', 'Członkowie'], (g) => `${esc(g.name)} + ${esc(g.member_ids.map(userName).join(', ') || '—')}`), + field: () => card('field', ['Nazwa', 'Rodzaj pola', 'Opcje listy'], (f) => `${esc(f.label)} ${esc(FIELD_KIND[f.kind] || f.kind)} - ${esc(f.options.filter((o) => !o.archived).map((o) => o.label).join(', ') || '—')}`) - + card('type', ['Nazwa', 'Pola wniosku', 'Szablon domyślny'], (t) => `
    ${esc(t.name)} + ${esc(f.options.filter((o) => !o.archived).map((o) => o.label).join(', ') || '—')}`), + type: () => card('type', ['Nazwa', 'Pola wniosku', 'Szablon domyślny'], (t) => `
    ${esc(t.name)}
    ${esc(t.key)}
    ${esc(names(t.field_keys, A.fields, 'key', 'label') || '—')} - ${esc(t.default_template_id ? names([t.default_template_id], A.templates, 'id', 'name') : '—')}`) - + card('template', ['Nazwa', 'Etapy'], (p) => `${esc(p.name)} - ${esc(p.stages.map((s) => s.name).join(' → '))}`); + ${esc(t.default_template_id ? names([t.default_template_id], A.templates, 'id', 'name') : '—')}`), + template: () => card('template', ['Nazwa', 'Etapy'], (p) => `${esc(p.name)} + ${chips(p)}`), + }; + C.innerHTML = pageHead('Ustawienia', 'Grupy, pola i typy wniosków, szablony obiegów') + + `` + + CARDS[tab](); } /* The form's subject between opening and saving: { kind, x } with x = null for a new one. */ @@ -1548,7 +1615,7 @@ async function viewAdmin(C) { C.innerHTML = pageHead('Administracja', '', hub ? '' : ``) - + `

    Użytkownicy${state.users.length}

    + + `

    Użytkownicy${state.users.length}

    ${state.users.map((u) => ` @@ -1557,11 +1624,11 @@ async function viewAdmin(C) { ${role(u)}
    ${u.is_active ? 'active' : 'inactive'}
    `).join('')}
    NazwaE-mailRolaStatus
    - ${hub ? `
    + ${hub ? `
    Osobami i hasłami zarządza się w jednym miejscu dla całej platformy. Dodanie kogoś, zmiana nazwy, reset hasła czy wyłączenie konta dzieją się tam — i obowiązują od razu wszędzie. Tu ustawiasz tylko to, co dana osoba widzi w tym module.
    ` : ''}
    ` - + `

    Audit${audit.length}

    + + `

    Audit${audit.length}

    ${audit.length ? `
    ${audit.map((a) => ` diff --git a/frontend/index.html b/frontend/index.html index 911222d..0829500 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -67,6 +67,8 @@ Workflow + + Nowa sprawa @@ -76,8 +78,7 @@
    - - +
    UtworzonoActionEntityResult