@kabmo-labs/kabmo 0.57.1 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +523 -506
- package/dist/client/static/js/Body-karkrzkc.js +3 -0
- package/dist/client/static/js/{CsvGrid-563qmmmr.js → CsvGrid-j03knmbe.js} +2 -2
- package/dist/client/static/js/{DocxView-5j69q3s0.js → DocxView-e8408vzs.js} +2 -2
- package/dist/client/static/js/{DrawioView-gd6k3hvn.js → DrawioView-fj4mfzch.js} +2 -2
- package/dist/client/static/js/{HtmlPreview-6gnktzzp.js → HtmlPreview-9g8xwzgw.js} +1 -1
- package/dist/client/static/js/ImageView-sz4fzz9k.js +1 -0
- package/dist/client/static/js/LayoutWrapper-q6q4h04a.js +2 -0
- package/dist/client/static/js/MergeDiffView-b8f013ws.js +1 -0
- package/dist/client/static/js/Modal-ahecatp5.js +60 -0
- package/dist/client/static/js/{PdfView-n1zq27td.js → PdfView-8jtdx5hd.js} +1 -1
- package/dist/client/static/js/SessionsView-jwp8xvw5.js +1 -0
- package/dist/client/static/js/{SheetView-nes7j86v.js → SheetView-hwx8s864.js} +11 -11
- package/dist/client/static/js/{SvgPreview-vv0qzkt7.js → SvgPreview-ete36nzv.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-02g96sn6.js → abnfDiagram-O67JEVCF-7nsqzz6z.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-dc7zys46.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-7qj2fpwt.js → architectureDiagram-NJMV4G6O-xvpkfq2f.js} +11 -11
- package/dist/client/static/js/{astro-asmathwv.js → astro-rsrqgjjx.js} +1 -1
- package/dist/client/static/js/bash-n5d0esqg.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-grdr1j2h.js → blockDiagram-BEXU5L5S-0saahcs6.js} +7 -7
- package/dist/client/static/js/c-pk766wx0.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-7y980xpx.js → c4Diagram-YGBWAQC7-ktpqnb4a.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-29ag4js1.js → classDiagram-v2-NBCMYWYE-x67cz3ms.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-e5dvgehd.js → cose-bilkent-JH36ORCC-9wzmhkz8.js} +1 -1
- package/dist/client/static/js/cpp-3pt91jvm.js +1 -0
- package/dist/client/static/js/css-sp1cgdbr.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-9fx59e89.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-eq6fmx0b.js → cynefinDiagram-VND7K2PF-dmmgmv99.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-xfhwp8ha.js → dagre-6A5THRUB-ygkkms1t.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-1bw6x6zt.js → diagram-22UHCM2B-qxj0pqb4.js} +14 -14
- package/dist/client/static/js/{diagram-3UASUU5V-076ej5n5.js → diagram-3UASUU5V-77k8w5dt.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-cvf9fhdq.js → diagram-ATOU4E4O-m0h86vf4.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-hn1wdx54.js → diagram-CDSNMT55-5v28kaeg.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-76gk27b5.js → diagram-MLGK6HIB-zgcg9gaz.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-0cbajhpx.js → diagram-MPIPVDR6-10c9s6e6.js} +2 -2
- package/dist/client/static/js/{dockerfile-7atfjhnf.js → dockerfile-dr9sdsqp.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-n0g3b9m2.js → ebnfDiagram-ZINNZB2B-mz4022dz.js} +1 -1
- package/dist/client/static/js/{elixir-7q2k61zb.js → elixir-3dy25ex8.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-f6wrjcv9.js → elk-276RUBZZ-ccerbsag.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-jz622yrg.js → erDiagram-OPXOYQCR-a8vjyrrw.js} +5 -5
- package/dist/client/static/js/{erlang-tjsd7n4d.js → erlang-v7344938.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-61d2ee91.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-104ywb7w.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-2ex4nxyg.js → ganttDiagram-FUAMR5RP-sz1g29fp.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-zkb30q0t.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-38eyay6g.js → gitGraphDiagram-X574FWY7-efqk42q0.js} +15 -15
- package/dist/client/static/js/graphql-2ntm7jyh.js +1 -0
- package/dist/client/static/js/html-mt2yb43b.js +1 -0
- package/dist/client/static/js/{index-db7vsjkd.js → index-2a0b9ya2.js} +1 -1
- package/dist/client/static/js/index-2f6psebk.js +2 -0
- package/dist/client/static/js/{index-j9y4tjk0.js → index-3m1dksmy.js} +2 -2
- package/dist/client/static/js/{index-668fc1df.js → index-3p732mvs.js} +2 -2
- package/dist/client/static/js/{index-3x88t8g9.js → index-3ymw778n.js} +2 -2
- package/dist/client/static/js/{index-rbkvw2xs.js → index-5tp3emtg.js} +2 -2
- package/dist/client/static/js/{index-8444mec5.js → index-6ac860yz.js} +2 -2
- package/dist/client/static/js/{index-zzggk17b.js → index-6ey6y9em.js} +2 -2
- package/dist/client/static/js/index-6h46r2de.js +1 -0
- package/dist/client/static/js/index-6qqsy78z.js +1 -0
- package/dist/client/static/js/{index-25zpywv7.js → index-6x0kn8pb.js} +2 -2
- package/dist/client/static/js/{index-zv8wrvha.js → index-7ma44af3.js} +3 -3
- package/dist/client/static/js/index-7s4dge1z.js +1 -0
- package/dist/client/static/js/{index-my856e49.js → index-7ynf3s2w.js} +2 -2
- package/dist/client/static/js/index-8aqjj2x2.js +1 -0
- package/dist/client/static/js/index-bkwax812.js +1 -0
- package/dist/client/static/js/{index-60g0e74a.js → index-dqf0srrp.js} +2 -2
- package/dist/client/static/js/{index-jaxhfk9x.js → index-dz18nn65.js} +2 -2
- package/dist/client/static/js/{index-9gfn1a3h.js → index-e42ys2q3.js} +7 -7
- package/dist/client/static/js/{index-wxs0x3g1.js → index-ewryzs4g.js} +2 -2
- package/dist/client/static/js/{index-55v3qv04.js → index-f31c6jg8.js} +22 -22
- package/dist/client/static/js/index-f44k9k8d.css +1 -0
- package/dist/client/static/js/{index-nnqyew8n.js → index-fhtnvqgf.js} +2 -2
- package/dist/client/static/js/{index-396g4zz4.js → index-gaa39w5q.js} +2 -2
- package/dist/client/static/js/{index-63mk2qk6.js → index-gqsnyh8k.js} +2 -2
- package/dist/client/static/js/index-gw4c5n3a.js +2 -0
- package/dist/client/static/js/index-j863hg0d.js +9 -0
- package/dist/client/static/js/{index-e4yj4kbe.js → index-jnxmvxb8.js} +12 -12
- package/dist/client/static/js/{index-0prwdwyb.js → index-jxsha63v.js} +2 -2
- package/dist/client/static/js/index-k1576e2m.js +2 -0
- package/dist/client/static/js/index-k4qshngy.js +4 -0
- package/dist/client/static/js/{index-ep99arz1.js → index-k56patms.js} +2 -2
- package/dist/client/static/js/{index-8pqx5n2p.js → index-kc5yt2cd.js} +2 -2
- package/dist/client/static/js/index-mkp3gwag.js +1 -0
- package/dist/client/static/js/{index-g2e0m757.js → index-nzq51nbb.js} +7 -7
- package/dist/client/static/js/{index-1q934wfk.js → index-q5q8a3qn.js} +2 -2
- package/dist/client/static/js/{index-tksrpqkh.js → index-qbqm3c91.js} +5 -5
- package/dist/client/static/js/{index-zynbvm7x.js → index-qkcmspxq.js} +2 -2
- package/dist/client/static/js/index-r1wrke3j.js +1 -0
- package/dist/client/static/js/index-rr79n77k.js +470 -0
- package/dist/client/static/js/{index-y1j18rha.js → index-rxt8sf9a.js} +2 -2
- package/dist/client/static/js/{index-tdryzzy9.js → index-ssepzdaz.js} +6 -6
- package/dist/client/static/js/{index-rsyqf691.js → index-sxag9ptg.js} +2 -2
- package/dist/client/static/js/{index-ewst55j2.js → index-t71k3b28.js} +2 -2
- package/dist/client/static/js/index-tc07gd33.js +2 -0
- package/dist/client/static/js/{index-m6eh5g1q.js → index-tdg7hz80.js} +2 -2
- package/dist/client/static/js/{index-nt17ejrm.js → index-th61y26d.js} +2 -2
- package/dist/client/static/js/{index-n1xmkf2g.js → index-tnxp90ac.js} +1 -1
- package/dist/client/static/js/{index-ms80nne4.js → index-tq3t3qm4.js} +2 -2
- package/dist/client/static/js/index-ts8rhd06.js +1 -0
- package/dist/client/static/js/{index-xtrsvm0d.js → index-v8xhgfeq.js} +2 -2
- package/dist/client/static/js/{index-ays8t3t3.js → index-vb5a3g01.js} +4 -4
- package/dist/client/static/js/{index-pjf5wak8.js → index-ver116ed.js} +1 -1
- package/dist/client/static/js/{index-hge0y4vn.js → index-vf01q99d.js} +2 -2
- package/dist/client/static/js/{index-4cff0zg2.js → index-w5j1wgcz.js} +1 -1
- package/dist/client/static/js/{index-cwwg7k5f.js → index-wnk9k57k.js} +27 -27
- package/dist/client/static/js/{index-6z30g3ha.js → index-x7h04xzf.js} +2 -2
- package/dist/client/static/js/{index-xfnjwhan.js → index-xfyxmaj1.js} +85 -85
- package/dist/client/static/js/index-xygk0v3e.js +2 -0
- package/dist/client/static/js/{index-kt7c42n7.js → index-y0f3wbc3.js} +2 -2
- package/dist/client/static/js/index-zh550byg.js +2 -0
- package/dist/client/static/js/info-A6RAGUB7-xxvyt8p8.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-c55t0tvd.js → infoDiagram-VRGFBTTK-rykcacj5.js} +1 -1
- package/dist/client/static/js/ini-bdk46a3d.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-r9kg5kg5.js → ishikawaDiagram-OU5B5YK6-rj752kd8.js} +3 -3
- package/dist/client/static/js/java-3g3925cf.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-zmmst4v8.js → journeyDiagram-ZHPQQLJL-mtetwn6f.js} +5 -5
- package/dist/client/static/js/json-hdyzmffz.js +1 -0
- package/dist/client/static/js/jsx-y8r9mrdq.js +1 -0
- package/dist/client/static/js/{julia-d18zhpyp.js → julia-mxe3pnz3.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-3tt6sc9a.js → kanban-definition-PNTS6WVX-4h5pw5mm.js} +3 -3
- package/dist/client/static/js/lua-wf5k6p3r.js +1 -0
- package/dist/client/static/js/markdown-9bf16dx7.js +1 -0
- package/dist/client/static/js/{mermaid.core-pkrs8zp5.js → mermaid.core-bs542jma.js} +8 -8
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-b4c6gxg4.js → mindmap-definition-NLK3R4M7-67s4xy7h.js} +5 -5
- package/dist/client/static/js/one-dark-pro-541ed4b7.js +1 -0
- package/dist/client/static/js/one-light-nr79mykt.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-cm8jeesg.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-9jkat1mz.js → pegDiagram-GJSIUBJH-qykb6ssk.js} +1 -1
- package/dist/client/static/js/{perl-sns2qvmf.js → perl-a8eeaqkn.js} +1 -1
- package/dist/client/static/js/{php-3q6v9eey.js → php-6gq92zt8.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-8b9xgcxv.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-6pbchjh7.js → pieDiagram-5QR66LMP-mymrrvck.js} +2 -2
- package/dist/client/static/js/properties-xk4dn00p.js +1 -0
- package/dist/client/static/js/python-7sgz05n4.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-p9brea19.js → quadrantDiagram-O4NWA36T-6f8ahd40.js} +6 -6
- package/dist/client/static/js/r-w4qxm0pv.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-fxr2x2mf.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-5qd45xk1.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-6fa00vpk.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pcbtg7tj.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-r0fdhdtp.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-3cep8css.js → railroadDiagram-XR7U4H2S-c3habpvw.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-x1yjgsrr.js → requirementDiagram-PLB6GJNP-nysqy6te.js} +12 -12
- package/dist/client/static/js/{ruby-f9k99tfq.js → ruby-mc826p2e.js} +1 -1
- package/dist/client/static/js/{rust-yy8gekx8.js → rust-m4f4vpvn.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-23wzf4aj.js → sankeyDiagram-IPEJSGJF-s5dtfp3z.js} +4 -4
- package/dist/client/static/js/{sass-2syegq28.js → sass-8bq5r2tz.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-w4wr3zzr.js → sequenceDiagram-PO4LG4MO-bb3yp049.js} +21 -21
- package/dist/client/static/js/{sizeCapture-INFHLROL-aabfesnr.js → sizeCapture-INFHLROL-0m2msee7.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-t0n288xw.js → stateDiagram-v2-GCMORJYK-cd0qgj6t.js} +3 -3
- package/dist/client/static/js/{svelte-mm3jfpje.js → svelte-5vrwkc13.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-1nnm0p7h.js → swimlanes-2SLR337P-rpb01f7p.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-zx36y2c8.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-8pyssn0q.js → timeline-definition-EJHVYXUP-tqw2e6y1.js} +5 -5
- package/dist/client/static/js/treeView-Q6P3EWNA-9sn2h4ea.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-9fzms0pq.js +1 -0
- package/dist/client/static/js/tsx-h5yzg80q.js +1 -0
- package/dist/client/static/js/typescript-qy1sbhea.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-vveepvt6.js → usecaseDiagram-POWQR4AR-dhf4d5xg.js} +41 -41
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-tqyvmqxc.js → vennDiagram-UO4OBE2U-ztkk79dv.js} +7 -7
- package/dist/client/static/js/{vue-e8e3q3hj.js → vue-gmjnxjm3.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-vy6rp5gp.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-p8rs34em.js → wardleyDiagram-VNRHLVJA-ahre5tmv.js} +5 -5
- package/dist/client/static/js/xml-mrk4xakv.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-pgnvxtps.js → xychartDiagram-PMCCYNJV-vak2c50n.js} +6 -6
- package/dist/client/static/js/yaml-xaza6dra.js +1 -0
- package/package.json +6 -6
- package/src/client/bootstrap.d.ts +11 -0
- package/src/client/borders.css +3 -4
- package/src/client/components/auth/login-screen/index.tsx +1 -1
- package/src/client/components/common/ComposerPicker.tsx +1 -1
- package/src/client/components/common/CopyButton.tsx +1 -1
- package/src/client/components/common/FolderPicker.tsx +1 -1
- package/src/client/components/common/SubagentStatusIcon.tsx +2 -2
- package/src/client/components/common/ViewportSelector.tsx +2 -2
- package/src/client/components/common/batch-selection/BatchActionBar.tsx +1 -1
- package/src/client/components/common/batch-selection/BatchDeleteModal.tsx +4 -4
- package/src/client/components/common/checkbox/style.ts +1 -1
- package/src/client/components/common/context-usage-button/McpSection.tsx +3 -2
- package/src/client/components/common/file-icon/index.tsx +3 -3
- package/src/client/components/common/harness-glyph/index.tsx +4 -3
- package/src/client/components/common/image-viewer/fullscreen.tsx +1 -1
- package/src/client/components/common/image-viewer/index.tsx +2 -2
- package/src/client/components/common/markdown-review/ReviewPopover.tsx +2 -2
- package/src/client/components/common/markdown-review/ReviewSummary.tsx +3 -3
- package/src/client/components/common/plugin-render-boundary/index.tsx +1 -1
- package/src/client/components/common/server-control/Panel.tsx +1 -1
- package/src/client/components/common/server-control/Row.tsx +3 -3
- package/src/client/components/common/session-actions-menu/MenuItem.tsx +2 -2
- package/src/client/components/common/session-branch/SubagentRow.tsx +1 -1
- package/src/client/components/common/session-delete-modal/index.tsx +4 -4
- package/src/client/components/common/session-row/StatusSlot.tsx +1 -1
- package/src/client/components/common/session-row/index.tsx +40 -2
- package/src/client/components/common/session-row/session-row.test.tsx +46 -3
- package/src/client/components/common/shell-update-button/Modal.tsx +1 -1
- package/src/client/components/common/todo-row/index.tsx +1 -1
- package/src/client/components/common/window-controls/index.tsx +1 -1
- package/src/client/components/common/workspace-options-menu/index.tsx +4 -4
- package/src/client/components/layout/session-sidebar/Toolbar.tsx +2 -2
- package/src/client/components/layout/session-sidebar/WorktreeBadge.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/UpdateLogDialog.tsx +1 -1
- package/src/client/components/layout/session-sidebar/about-modal/UpdateSection.tsx +3 -3
- package/src/client/components/layout/session-sidebar/about-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/modern/FilterChips.tsx +1 -1
- package/src/client/components/layout/session-sidebar/new-workspace-modal/DirectoryList.tsx +2 -2
- package/src/client/components/layout/session-sidebar/new-workspace-modal/index.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/ModelFields.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskForm.tsx +1 -1
- package/src/client/components/layout/session-sidebar/scheduler-modal/TaskList.tsx +4 -4
- package/src/client/components/layout/session-sidebar/scheduler-modal/index.tsx +1 -1
- package/src/client/components/layout/update-popup/Actions.tsx +1 -1
- package/src/client/components/mobile/mobile-right-sidebar/Action.tsx +1 -1
- package/src/client/components/mobile/mobile-right-sidebar/Header.tsx +3 -3
- package/src/client/components/mobile/mobile-right-sidebar/MissingFileBanner.tsx +2 -2
- package/src/client/components/mobile/mobile-right-sidebar/PreviewScroller.tsx +2 -2
- package/src/client/components/mobile/mobile-right-sidebar/StatusBar.tsx +2 -2
- package/src/client/components/mobile/mobile-session-sidebar/Toolbar.tsx +3 -3
- package/src/client/components/settings/Modal.tsx +8 -3
- package/src/client/components/settings/SettingsSidebarList.tsx +2 -2
- package/src/client/components/settings/Sidebar.tsx +3 -3
- package/src/client/components/settings/apply-side-effects.test.ts +46 -0
- package/src/client/components/settings/apply-side-effects.ts +8 -0
- package/src/client/components/settings/categories/BehaviorSettings.tsx +1 -1
- package/src/client/components/settings/categories/OmpSettings.tsx +3 -3
- package/src/client/components/settings/categories/UsageSettings.tsx +3 -3
- package/src/client/components/settings/categories/agent-settings/DetailPane.tsx +5 -5
- package/src/client/components/settings/categories/appearance-settings/CustomThemeEditor.tsx +177 -0
- package/src/client/components/settings/categories/appearance-settings/CustomThemeSection.test.tsx +136 -0
- package/src/client/components/settings/categories/appearance-settings/CustomThemeSection.tsx +180 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +1 -1
- package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +6 -5
- package/src/client/components/settings/categories/appearance-settings/ThemePreview.tsx +106 -0
- package/src/client/components/settings/categories/appearance-settings/ThemeSection.tsx +7 -3
- package/src/client/components/settings/categories/behavior-settings/Editor.tsx +1 -1
- package/src/client/components/settings/categories/chat-settings/ToolRenderSection.tsx +1 -1
- package/src/client/components/settings/categories/command-settings/DetailPane.tsx +4 -4
- package/src/client/components/settings/categories/dictation-settings/ExternalSection.tsx +1 -1
- package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +1 -1
- package/src/client/components/settings/categories/git-settings/IdentitySection.tsx +2 -2
- package/src/client/components/settings/categories/harness-settings/AccountLoginPanel.tsx +3 -3
- package/src/client/components/settings/categories/harness-settings/AccountsPanel.tsx +13 -83
- package/src/client/components/settings/categories/harness-settings/HarnessImportControls.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/ConnectionTest.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/DetailPane.tsx +5 -5
- package/src/client/components/settings/categories/mcp-settings/ImportModal.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/KeyValueSection.tsx +1 -1
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +2 -2
- package/src/client/components/settings/categories/omp-settings/ConfigTabs.tsx +4 -4
- package/src/client/components/settings/categories/omp-settings/OrderedChips.tsx +1 -1
- package/src/client/components/settings/categories/omp-settings/PresetBar.tsx +3 -3
- package/src/client/components/settings/categories/omp-settings/RoleEditor.tsx +2 -2
- package/src/client/components/settings/categories/omp-settings/RowEditor.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/GitFreshness.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/InstallForm.tsx +3 -3
- package/src/client/components/settings/categories/panel-plugins/InstalledList.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/Meta.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/PluginCard.tsx +5 -5
- package/src/client/components/settings/categories/panel-plugins/ReadmeModal.tsx +1 -1
- package/src/client/components/settings/categories/panel-plugins/Registries.tsx +4 -4
- package/src/client/components/settings/categories/panel-plugins/Section.tsx +3 -3
- package/src/client/components/settings/categories/panel-plugins/SettingsModal.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/SyncBlockedNotice.tsx +2 -2
- package/src/client/components/settings/categories/panel-plugins/Toolbar.tsx +1 -1
- package/src/client/components/settings/categories/plugin-settings/DetailPane.tsx +2 -2
- package/src/client/components/settings/categories/plugin-settings/MarketplacePane.tsx +4 -4
- package/src/client/components/settings/categories/plugin-settings/SettingsSection.tsx +1 -1
- package/src/client/components/settings/categories/plugin-settings/SidebarList.tsx +4 -4
- package/src/client/components/settings/categories/project-settings/AddProjectModal.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/DeleteProjectModal.tsx +3 -3
- package/src/client/components/settings/categories/project-settings/DetailsHeader.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/IconGrid.tsx +3 -3
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +1 -1
- package/src/client/components/settings/categories/project-settings/WorktreeSettings.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/AddModelModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/AddProviderModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/AuthSection.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/DeleteProviderModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/EntryAdvanced.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/EntryModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/LoginModal.tsx +2 -2
- package/src/client/components/settings/categories/provider-settings/LogoutProviderModal.tsx +3 -3
- package/src/client/components/settings/categories/provider-settings/ModelCapabilitiesModal.tsx +1 -1
- package/src/client/components/settings/categories/provider-settings/PriceFields.tsx +1 -1
- package/src/client/components/settings/categories/skill-catalog/GitImportPanel.tsx +1 -1
- package/src/client/components/settings/categories/skill-catalog/SkillCard.tsx +1 -1
- package/src/client/components/settings/categories/skill-catalog/SourceRail.tsx +1 -1
- package/src/client/components/settings/categories/skill-settings/DetailHeader.tsx +7 -7
- package/src/client/components/settings/categories/skill-settings/DetailPane.tsx +1 -1
- package/src/client/components/settings/categories/skill-settings/SidebarList.tsx +2 -2
- package/src/client/components/settings/categories/usage-settings/ProviderCard.tsx +1 -1
- package/src/client/components/settings/categories/usage-settings/SavedResetsSection.tsx +2 -2
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +1 -1
- package/src/client/components/settings/categories/usage-settings/TokenHarborCard.tsx +1 -1
- package/src/client/components/settings/categories/voice-settings/speech/EndpointSection.tsx +2 -2
- package/src/client/components/settings/categories/voice-settings/speech/EngineSection.tsx +5 -5
- package/src/client/components/settings/categories/voice-settings/speech/ModelsSection.tsx +4 -4
- package/src/client/components/workspace/browser-panel/ActivityToasts.tsx +2 -2
- package/src/client/components/workspace/browser-panel/EngineNotice.tsx +1 -1
- package/src/client/components/workspace/browser-panel/index.tsx +2 -2
- package/src/client/components/workspace/browser-toolbar/clusters.tsx +2 -2
- package/src/client/components/workspace/btw-panel/Messages.tsx +2 -2
- package/src/client/components/workspace/btw-panel/TopicMenu.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/AiMessageFooterSheet.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/ComposerDock.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/IrcNotice.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/QueueList.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SubagentControls.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/TaskResultContent.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/UndoConfirmModal.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerNotice.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +11 -11
- package/src/client/components/workspace/chat-timeline/chat-input/GoalModal.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/VoiceNotice.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/chat-input/props.ts +3 -3
- package/src/client/components/workspace/chat-timeline/plan-review/index.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormAsk.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/FormDialog.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/QuestionCard.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/SwipeDeck.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/ApprovalBody.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/hashline-patch/index.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/AstEdit.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Debug.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Edit.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Eval.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/FileMatches.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Github.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Goal.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/GoalRecord.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Lsp.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ManageSkill.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +8 -8
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Resolve.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/SecurityScan.tsx +6 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Todo.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +7 -7
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/DiffView.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/EnvelopeHeader.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolCardShell.tsx +4 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips.tsx +5 -5
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/status-glyph.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +35 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +17 -12
- package/src/client/components/workspace/context-panel/RawJsonViewer.tsx +2 -2
- package/src/client/components/workspace/diff-panel/ConflictBanner.tsx +3 -3
- package/src/client/components/workspace/diff-panel/Toolbar.tsx +3 -3
- package/src/client/components/workspace/diff-panel/index.tsx +3 -3
- package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +1 -1
- package/src/client/components/workspace/editor/ConflictStrip.tsx +2 -2
- package/src/client/components/workspace/editor/ExternalChangeStrip.tsx +2 -2
- package/src/client/components/workspace/editor/FilePane.tsx +6 -6
- package/src/client/components/workspace/editor/FindWidget.tsx +2 -2
- package/src/client/components/workspace/editor/GoToLineModal.tsx +1 -1
- package/src/client/components/workspace/editor/SaveAsModal.tsx +3 -3
- package/src/client/components/workspace/editor/SaveDeletedFileModal.tsx +2 -2
- package/src/client/components/workspace/editor/StatusBar.tsx +1 -1
- package/src/client/components/workspace/editor/Tabs.test.ts +3 -3
- package/src/client/components/workspace/editor/Tabs.tsx +6 -6
- package/src/client/components/workspace/editor/Toolbar.tsx +4 -4
- package/src/client/components/workspace/editor/toolbar-clusters.tsx +1 -1
- package/src/client/components/workspace/editor/viewers/DataGrid.tsx +1 -1
- package/src/client/components/workspace/editor/viewers/GridToolbar.tsx +2 -2
- package/src/client/components/workspace/editor/viewers/SheetView.tsx +2 -2
- package/src/client/components/workspace/editor/viewers/ViewerError.tsx +2 -2
- package/src/client/components/workspace/file-explorer/ArchiveModals.tsx +1 -1
- package/src/client/components/workspace/file-explorer/ContextMenu.tsx +3 -3
- package/src/client/components/workspace/file-explorer/Modals.tsx +3 -3
- package/src/client/components/workspace/file-explorer/RowLabel.test.tsx +2 -2
- package/src/client/components/workspace/git-panel/BranchToolbar.tsx +2 -2
- package/src/client/components/workspace/git-panel/ChangesList.tsx +3 -3
- package/src/client/components/workspace/git-panel/ConflictItem.tsx +3 -3
- package/src/client/components/workspace/git-panel/FileItem.tsx +1 -1
- package/src/client/components/workspace/git-panel/Modals.tsx +1 -1
- package/src/client/components/workspace/git-panel/OperationBar.tsx +4 -4
- package/src/client/components/workspace/git-panel/StashSection.tsx +1 -1
- package/src/client/components/workspace/git-panel/TreeItem.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/BranchRow.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/DeleteDialog.tsx +2 -2
- package/src/client/components/workspace/git-panel/branch-modal/index.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +31 -76
- package/src/client/components/workspace/model-dropdown/Item.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/Panel.tsx +15 -9
- package/src/client/components/workspace/model-dropdown/Section.tsx +1 -1
- package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +12 -83
- package/src/client/components/workspace/model-dropdown/index.tsx +2 -2
- package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +16 -2
- package/src/client/components/workspace/plan-panel/PageView.tsx +2 -2
- package/src/client/components/workspace/plan-panel/index.tsx +2 -2
- package/src/client/components/workspace/plugin-panel/Error.tsx +1 -1
- package/src/client/components/workspace/repo-picker/Modal.tsx +3 -3
- package/src/client/components/workspace/repo-picker/Row.tsx +5 -5
- package/src/client/components/workspace/search-panel/Body.tsx +2 -2
- package/src/client/components/workspace/terminal-panel/Header.tsx +3 -3
- package/src/client/components/workspace/terminal-panel/KeyBar.tsx +2 -2
- package/src/client/components/workspace/terminal-panel/QuickActions.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/RealtimeTerminalView.tsx +1 -1
- package/src/client/components/workspace/terminal-panel/index.tsx +1 -1
- package/src/client/components/workspace/usage-panel/index.tsx +3 -3
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +1 -1
- package/src/client/components/workspace/wiki-panel/PageView.tsx +2 -2
- package/src/client/components/workspace/wiki-panel/index.tsx +2 -2
- package/src/client/components/workspace/worktree-modal/index.tsx +1 -1
- package/src/client/data/settings/omp-schema.json +27 -7
- package/src/client/hooks/chat/timeline/session-harness.ts +2 -1
- package/src/client/hooks/editor/use-unload-guard.tsx +2 -2
- package/src/client/hooks/models/use-harness-accounts-panel.ts +142 -0
- package/src/client/hooks/ui/border-style.test.ts +1 -2
- package/src/client/hooks/ui/theme.ts +23 -2
- package/src/client/main.tsx +7 -1
- package/src/client/tailwind-contrast.test.ts +22 -7
- package/src/client/tailwind.css +115 -18
- package/src/server/lib/assets/theme-css.server.test.ts +31 -1
- package/src/server/lib/assets/theme-css.server.ts +15 -1
- package/src/server/lib/harness/accounts.test.ts +5 -3
- package/src/server/lib/harness/acp/acp-todos.test.ts +23 -0
- package/src/server/lib/omp/session/delete.server.ts +4 -0
- package/src/server/lib/realtime/topics/session-data.server.ts +63 -1
- package/src/server/lib/realtime/topics/session-data.test.ts +154 -0
- package/src/server/lib/tray/runtime.server.ts +5 -0
- package/src/server/plugins/ssr.ts +16 -4
- package/src/server/routes/settings/root.ts +11 -0
- package/src/server/routes/settings/settings-store-routes.test.ts +37 -0
- package/src/shared/lib/chat/timeline/block-chrome.ts +2 -2
- package/src/shared/lib/chat/todo/flat-list.test.ts +81 -0
- package/src/shared/lib/chat/todo/flat-list.ts +29 -0
- package/src/shared/lib/chat/todo/parser.ts +7 -53
- package/src/shared/lib/chat/todo/progress.test.ts +3 -3
- package/src/shared/lib/chat/todo/progress.ts +3 -3
- package/src/shared/lib/fs/git-status.test.ts +22 -22
- package/src/shared/lib/fs/git-status.ts +31 -31
- package/src/shared/lib/icons/icon-paint-authority.ts +5 -4
- package/src/shared/lib/omp/config/schema-releases-19-4.test.ts +20 -3
- package/src/shared/lib/settings/defaults.ts +1 -0
- package/src/shared/lib/theme/catalog.test.ts +42 -0
- package/src/shared/lib/theme/catalog.ts +66 -11
- package/src/shared/lib/theme/css.ts +25 -1
- package/src/shared/lib/theme/custom.test.ts +156 -0
- package/src/shared/lib/theme/custom.ts +260 -0
- package/src/shared/lib/theme/ink-scale.test.ts +83 -2
- package/src/shared/lib/theme/ink-scale.ts +74 -9
- package/src/shared/lib/theme/shell-palette.ts +3 -3
- package/src/shared/lib/theme/theme.test.ts +28 -13
- package/src/shared/types/settings/state.ts +11 -3
- package/tsconfig.json +6 -0
- package/dist/client/static/js/Body-p6zwk0nx.js +0 -3
- package/dist/client/static/js/ImageView-fkfq3fwv.js +0 -1
- package/dist/client/static/js/LayoutWrapper-mdb1qm26.js +0 -2
- package/dist/client/static/js/MergeDiffView-7kpjxcg9.js +0 -1
- package/dist/client/static/js/Modal-0p9cr2tn.js +0 -60
- package/dist/client/static/js/SessionsView-gptt0rq8.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-3hkq8grc.js +0 -1
- package/dist/client/static/js/bash-n7wcmq3s.js +0 -1
- package/dist/client/static/js/c-20y64hcp.js +0 -1
- package/dist/client/static/js/cpp-ty6n0dg9.js +0 -1
- package/dist/client/static/js/css-ncvxaxt0.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-9m18e6m5.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-d4egnv9v.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-5bvd5k2t.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-grqv890n.js +0 -1
- package/dist/client/static/js/graphql-6rwdfcnf.js +0 -1
- package/dist/client/static/js/html-p76eszt9.js +0 -1
- package/dist/client/static/js/index-28wv94gz.js +0 -2
- package/dist/client/static/js/index-3wgjtp2k.js +0 -9
- package/dist/client/static/js/index-7trfm17d.js +0 -2
- package/dist/client/static/js/index-cxe75e06.js +0 -2
- package/dist/client/static/js/index-dmb1pykr.js +0 -1
- package/dist/client/static/js/index-fqc1snjw.js +0 -1
- package/dist/client/static/js/index-jsn2kedv.js +0 -1
- package/dist/client/static/js/index-pe4d9wht.js +0 -1
- package/dist/client/static/js/index-sm8gpk3g.js +0 -4
- package/dist/client/static/js/index-st6a8q5z.js +0 -470
- package/dist/client/static/js/index-stmwbavz.js +0 -1
- package/dist/client/static/js/index-swaveqxg.css +0 -1
- package/dist/client/static/js/index-t82q5t6m.js +0 -1
- package/dist/client/static/js/index-t9zjfxvc.js +0 -1
- package/dist/client/static/js/index-tdbcp70z.js +0 -2
- package/dist/client/static/js/index-v38j2zxn.js +0 -2
- package/dist/client/static/js/index-x17y7xdr.js +0 -2
- package/dist/client/static/js/index-xrb4kjr3.js +0 -1
- package/dist/client/static/js/info-A6RAGUB7-rzpg7qk1.js +0 -1
- package/dist/client/static/js/ini-kjcpgebh.js +0 -1
- package/dist/client/static/js/java-0bcyv1jt.js +0 -1
- package/dist/client/static/js/json-xha2drny.js +0 -1
- package/dist/client/static/js/jsx-8p6dqgpq.js +0 -1
- package/dist/client/static/js/lua-njwwdj4s.js +0 -1
- package/dist/client/static/js/markdown-8gbyxxjd.js +0 -1
- package/dist/client/static/js/one-dark-pro-sstqnzcf.js +0 -1
- package/dist/client/static/js/one-light-6fpxxq2j.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-eac14hsq.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-a9xqvysf.js +0 -1
- package/dist/client/static/js/properties-d5bwhgwz.js +0 -1
- package/dist/client/static/js/python-fdwwjjhh.js +0 -1
- package/dist/client/static/js/r-4d2ygtfj.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-jv2pm0fe.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-j74sc0b6.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-eaf19baz.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d4j5nq31.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-ba862a9p.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-cx3f29mq.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-e8yb44pd.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-zvdv84vp.js +0 -1
- package/dist/client/static/js/tsx-dk8rpgtw.js +0 -1
- package/dist/client/static/js/typescript-5txwpd9t.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hbv0cg4s.js +0 -1
- package/dist/client/static/js/xml-8516fzfp.js +0 -1
- package/dist/client/static/js/yaml-6k1tmwtm.js +0 -1
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
SIGNAL_SLOTS,
|
|
34
34
|
inkScale,
|
|
35
35
|
onInkTextColor,
|
|
36
|
+
onSignalTextColor,
|
|
36
37
|
signalTextColor,
|
|
37
38
|
} from '@/shared/lib/theme/ink-scale';
|
|
38
39
|
|
|
@@ -67,8 +68,14 @@ function paletteBlock(theme: ThemePalette): string {
|
|
|
67
68
|
` --theme-paper: ${theme.paper};`,
|
|
68
69
|
` --theme-canvas: ${theme.canvas};`,
|
|
69
70
|
` --theme-ink: ${theme.ink};`,
|
|
70
|
-
// Fifteen distinct values: the ink at N% over this palette's paper.
|
|
71
|
+
// Fifteen distinct values: the ink at N% over this palette's paper. These
|
|
72
|
+
// stay the DECORATIVE ramp (icons, separators), so its lightness shape is
|
|
73
|
+
// preserved exactly.
|
|
71
74
|
...scale.ladder.map((value, index) => ` --theme-ink-${MUTED_STEPS[index]}: ${value};`),
|
|
75
|
+
// The same rungs solved for TEXT: a rung under this palette's AA floor is
|
|
76
|
+
// the palette's `muted` level. `text-ink/NN` reads these; a word cannot
|
|
77
|
+
// land under 4.5:1 while the decorative ramp keeps its shape.
|
|
78
|
+
...scale.textLadder.map((value, index) => ` --theme-text-${MUTED_STEPS[index]}: ${value};`),
|
|
72
79
|
// The inline-code chip's OWN fill, opaque (see `CODE_FILL_PERCENT`).
|
|
73
80
|
` --theme-code-fill: ${scale.codeFill};`,
|
|
74
81
|
// Muted text on an inverted surface: an alpha reads 2.91:1 on `solarized-light`.
|
|
@@ -88,6 +95,9 @@ function paletteBlock(theme: ThemePalette): string {
|
|
|
88
95
|
for (const slot of SIGNAL_SLOTS) {
|
|
89
96
|
lines.push(` --theme-${slot}-text: ${signalTextColor(theme, slot)};`);
|
|
90
97
|
}
|
|
98
|
+
// The word painted ON a solid signal fill (`bg-error text-error-on`). Only
|
|
99
|
+
// the destructive fill carries text today, so only that pair is emitted.
|
|
100
|
+
lines.push(` --theme-error-on: ${onSignalTextColor(theme, 'error')};`);
|
|
91
101
|
for (const [name, source] of HOVER_MIXES) {
|
|
92
102
|
lines.push(` ${name}: color-mix(in srgb, var(${source}) 85%, var(--theme-ink));`);
|
|
93
103
|
}
|
|
@@ -95,6 +105,20 @@ function paletteBlock(theme: ThemePalette): string {
|
|
|
95
105
|
return `html[data-theme="${theme.id}"] {\n${lines.join('\n')}\n}`;
|
|
96
106
|
}
|
|
97
107
|
|
|
108
|
+
/**
|
|
109
|
+
* The `<style>` element carrying a user-defined palette.
|
|
110
|
+
*
|
|
111
|
+
* Built-in palettes are in the content-hashed sheet, which is fixed for the life
|
|
112
|
+
* of a build. A custom palette is settings data, so its block is emitted on its
|
|
113
|
+
* own and rewritten by the theme writer on every switch or edit.
|
|
114
|
+
*/
|
|
115
|
+
export const CUSTOM_THEME_STYLE_ELEMENT_ID = 'omp-custom-theme';
|
|
116
|
+
|
|
117
|
+
/** The full `html[data-theme=…]` block for one palette (custom-only callers). */
|
|
118
|
+
export function customThemeStyle(palette: ThemePalette): string {
|
|
119
|
+
return paletteBlock(palette);
|
|
120
|
+
}
|
|
121
|
+
|
|
98
122
|
/** Cached: the palette set is fixed for the life of the process. */
|
|
99
123
|
let cached: string | null = null;
|
|
100
124
|
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
|
+
import type { ThemePalette } from '@kabmo-labs/kabmo-app-contracts/theme';
|
|
8
|
+
import {
|
|
9
|
+
MAX_CUSTOM_THEMES,
|
|
10
|
+
normalizeStoredThemeId,
|
|
11
|
+
customThemesFromSettings,
|
|
12
|
+
draftFromCustomTheme,
|
|
13
|
+
emptyCustomThemeDraft,
|
|
14
|
+
normalizeHexColor,
|
|
15
|
+
sanitizeCustomThemes,
|
|
16
|
+
validateCustomThemeDraft,
|
|
17
|
+
validateCustomThemesForWrite,
|
|
18
|
+
} from '@/shared/lib/theme/custom';
|
|
19
|
+
|
|
20
|
+
const PALETTE: ThemePalette = {
|
|
21
|
+
id: 'custom-test-theme',
|
|
22
|
+
name: 'Test theme',
|
|
23
|
+
family: 'custom',
|
|
24
|
+
variant: 'dark',
|
|
25
|
+
canvas: '#101418',
|
|
26
|
+
paper: '#14181e',
|
|
27
|
+
ink: '#e6e8eb',
|
|
28
|
+
error: '#ff6b6b',
|
|
29
|
+
success: '#4ade80',
|
|
30
|
+
info: '#60a5fa',
|
|
31
|
+
warning: '#fbbf24',
|
|
32
|
+
meta: '#a78bfa',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function draft() {
|
|
36
|
+
return { ...draftFromCustomTheme(PALETTE) };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
describe('custom theme colours', () => {
|
|
40
|
+
test('normalises every accepted hex notation to opaque #rrggbb', () => {
|
|
41
|
+
expect(normalizeHexColor('#ABC')).toBe('#aabbcc');
|
|
42
|
+
expect(normalizeHexColor(' #aabbcc ')).toBe('#aabbcc');
|
|
43
|
+
expect(normalizeHexColor('#aabbccdd')).toBe('#aabbcc');
|
|
44
|
+
expect(normalizeHexColor('rebeccapurple')).toBeNull();
|
|
45
|
+
expect(normalizeHexColor(42)).toBeNull();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('validateCustomThemeDraft', () => {
|
|
50
|
+
test('returns a palette with a custom id and the trimmed name', () => {
|
|
51
|
+
const result = validateCustomThemeDraft({ ...draft(), name: ' My theme ' });
|
|
52
|
+
expect(result.ok).toBe(true);
|
|
53
|
+
if (!result.ok) return;
|
|
54
|
+
expect(result.palette.name).toBe('My theme');
|
|
55
|
+
expect(result.palette.family).toBe('custom');
|
|
56
|
+
expect(result.palette.id.startsWith('custom-')).toBe(true);
|
|
57
|
+
expect(result.palette.canvas).toBe('#101418');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('keeps an existing id while editing', () => {
|
|
61
|
+
const result = validateCustomThemeDraft(draft(), PALETTE.id);
|
|
62
|
+
expect(result.ok).toBe(true);
|
|
63
|
+
if (result.ok) expect(result.palette.id).toBe(PALETTE.id);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('names the field that is not a hex colour', () => {
|
|
67
|
+
const result = validateCustomThemeDraft({ ...draft(), paper: 'dark' });
|
|
68
|
+
expect(result.ok).toBe(false);
|
|
69
|
+
if (result.ok) return;
|
|
70
|
+
expect(result.issues.map((issue) => issue.field)).toContain('paper');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('refuses a palette whose own body text cannot read', () => {
|
|
74
|
+
const result = validateCustomThemeDraft({ ...draft(), ink: '#121212', paper: '#101010' });
|
|
75
|
+
expect(result.ok).toBe(false);
|
|
76
|
+
if (result.ok) return;
|
|
77
|
+
expect(result.issues.some((issue) => issue.field === 'ink')).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test('refuses an id that is not a custom id or collides with a built-in', () => {
|
|
81
|
+
expect(validateCustomThemeDraft(draft(), 'paper').ok).toBe(false);
|
|
82
|
+
expect(validateCustomThemeDraft(draft(), 'custom-ok").x').ok).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('a fresh draft starts from a palette of the chosen variant and validates', () => {
|
|
86
|
+
const light = emptyCustomThemeDraft('light');
|
|
87
|
+
expect(light.variant).toBe('light');
|
|
88
|
+
expect(validateCustomThemeDraft(light).ok).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
describe('stored custom themes', () => {
|
|
93
|
+
test('drops entries a later build could not paint, keeps the rest', () => {
|
|
94
|
+
const themes = sanitizeCustomThemes([
|
|
95
|
+
PALETTE,
|
|
96
|
+
{ ...PALETTE, id: 'paper' },
|
|
97
|
+
{ ...PALETTE, id: 'custom-duplicate' },
|
|
98
|
+
{ ...PALETTE, id: 'custom-duplicate' },
|
|
99
|
+
{ ...PALETTE, canvas: 'not-a-colour' },
|
|
100
|
+
null,
|
|
101
|
+
]);
|
|
102
|
+
expect(themes.map((theme) => theme.id)).toEqual([PALETTE.id, 'custom-duplicate']);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test('normalises stored colours and caps the list', () => {
|
|
106
|
+
const many = Array.from({ length: MAX_CUSTOM_THEMES + 5 }, (_, index) => ({
|
|
107
|
+
...PALETTE,
|
|
108
|
+
id: `custom-${index}`,
|
|
109
|
+
canvas: '#FFF',
|
|
110
|
+
}));
|
|
111
|
+
const themes = sanitizeCustomThemes(many);
|
|
112
|
+
expect(themes.length).toBe(MAX_CUSTOM_THEMES);
|
|
113
|
+
expect(themes[0].canvas).toBe('#ffffff');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test('returns an empty list for a value that is not an array', () => {
|
|
117
|
+
expect(sanitizeCustomThemes(null)).toEqual([]);
|
|
118
|
+
expect(sanitizeCustomThemes({})).toEqual([]);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test('reads the array out of the settings blob', () => {
|
|
122
|
+
const themes = customThemesFromSettings({
|
|
123
|
+
kabmo_settings: { customThemes: [PALETTE] },
|
|
124
|
+
});
|
|
125
|
+
expect(themes.map((theme) => theme.id)).toEqual([PALETTE.id]);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
describe('validateCustomThemesForWrite', () => {
|
|
130
|
+
test('accepts a normalised array', () => {
|
|
131
|
+
const result = validateCustomThemesForWrite([{ ...PALETTE, meta: '#ABC' }]);
|
|
132
|
+
expect(result.ok).toBe(true);
|
|
133
|
+
if (result.ok) expect(result.themes[0].meta).toBe('#aabbcc');
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('refuses a non-array, a duplicate id and a repeated entry', () => {
|
|
137
|
+
expect(validateCustomThemesForWrite({})).toMatchObject({ ok: false });
|
|
138
|
+
expect(validateCustomThemesForWrite([PALETTE, PALETTE])).toMatchObject({ ok: false });
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test('refuses a palette below the contrast floor', () => {
|
|
142
|
+
expect(validateCustomThemesForWrite([{ ...PALETTE, ink: '#121212', paper: '#101010' }])).toMatchObject({
|
|
143
|
+
ok: false,
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
describe('normalizeStoredThemeId', () => {
|
|
150
|
+
test('keeps a built-in or a saved custom id, replaces a vanished one', () => {
|
|
151
|
+
expect(normalizeStoredThemeId('paper', [PALETTE])).toBe('paper');
|
|
152
|
+
expect(normalizeStoredThemeId(PALETTE.id, [PALETTE])).toBe(PALETTE.id as `custom-${string}`);
|
|
153
|
+
expect(normalizeStoredThemeId('custom-deleted', [PALETTE])).toBe('paper');
|
|
154
|
+
expect(normalizeStoredThemeId(null, [])).toBe('paper');
|
|
155
|
+
});
|
|
156
|
+
});
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* User-defined palettes: the validation boundary between a form (or a raw
|
|
8
|
+
* `POST /api/settings`) and the CSS the shell paints.
|
|
9
|
+
*
|
|
10
|
+
* A palette id becomes a CSS selector and its eight colours become declarations,
|
|
11
|
+
* so neither may be taken from the caller as-is. `validateCustomThemeDraft` is
|
|
12
|
+
* the write path (a reason is returned, nothing is saved); `sanitizeCustomThemes`
|
|
13
|
+
* is the read path (a stored row from another build is normalised, and an entry
|
|
14
|
+
* that cannot be painted is dropped rather than allowed to break the sheet).
|
|
15
|
+
*
|
|
16
|
+
* Contrast is checked for NEW palettes only. A stored palette is not re-judged
|
|
17
|
+
* here: a custom theme is the user's own choice, and silently deleting it
|
|
18
|
+
* because a later rule raised the floor would be a data loss disguised as
|
|
19
|
+
* validation.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { ThemePalette, ThemeVariant } from '@kabmo-labs/kabmo-app-contracts/theme';
|
|
23
|
+
import { readSettingsBlob } from '@/shared/lib/settings/keys';
|
|
24
|
+
import { CUSTOM_THEME_PREFIX, DEFAULT_THEME_ID, THEMES, type ThemeId } from '@/shared/lib/theme/catalog';
|
|
25
|
+
import { parseHexColor, rgbaToHex } from '@/shared/lib/theme/color';
|
|
26
|
+
import { contrastBetween, MUTED_CONTRAST_FLOOR } from '@/shared/lib/theme/ink-scale';
|
|
27
|
+
|
|
28
|
+
/** The eight slots a custom palette owns, in the card's paint order. */
|
|
29
|
+
export const CUSTOM_THEME_SLOTS = [
|
|
30
|
+
'canvas',
|
|
31
|
+
'paper',
|
|
32
|
+
'ink',
|
|
33
|
+
'error',
|
|
34
|
+
'success',
|
|
35
|
+
'info',
|
|
36
|
+
'warning',
|
|
37
|
+
'meta',
|
|
38
|
+
] as const;
|
|
39
|
+
|
|
40
|
+
export type CustomThemeSlot = (typeof CUSTOM_THEME_SLOTS)[number];
|
|
41
|
+
|
|
42
|
+
export const CUSTOM_THEME_SLOT_LABELS: Record<CustomThemeSlot, string> = {
|
|
43
|
+
canvas: 'Canvas',
|
|
44
|
+
paper: 'Panel',
|
|
45
|
+
ink: 'Ink',
|
|
46
|
+
error: 'Error',
|
|
47
|
+
success: 'Success',
|
|
48
|
+
info: 'Info',
|
|
49
|
+
warning: 'Warning',
|
|
50
|
+
meta: 'Accent',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** A project can reasonably own this many; an unbounded array is a payload. */
|
|
54
|
+
export const MAX_CUSTOM_THEMES = 100;
|
|
55
|
+
export const CUSTOM_THEME_NAME_MAX = 48;
|
|
56
|
+
|
|
57
|
+
/** `custom-` plus a slug-safe tail. The id is interpolated into CSS. */
|
|
58
|
+
const CUSTOM_ID = /^custom-[a-z0-9-]{1,64}$/;
|
|
59
|
+
|
|
60
|
+
export interface CustomThemeDraft extends Record<CustomThemeSlot, string> {
|
|
61
|
+
name: string;
|
|
62
|
+
variant: ThemeVariant;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface CustomThemeIssue {
|
|
66
|
+
field: 'name' | 'variant' | CustomThemeSlot;
|
|
67
|
+
message: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type CustomThemeResult =
|
|
71
|
+
| { ok: true; palette: ThemePalette }
|
|
72
|
+
| { ok: false; issues: CustomThemeIssue[] };
|
|
73
|
+
|
|
74
|
+
/** A fresh draft in the shipped dark palette's shape, so every field is visible. */
|
|
75
|
+
export function emptyCustomThemeDraft(variant: ThemeVariant = 'dark'): CustomThemeDraft {
|
|
76
|
+
const base = THEMES.find((theme) => theme.variant === variant) ?? THEMES[0];
|
|
77
|
+
return {
|
|
78
|
+
name: 'My theme',
|
|
79
|
+
variant,
|
|
80
|
+
canvas: base.canvas,
|
|
81
|
+
paper: base.paper,
|
|
82
|
+
ink: base.ink,
|
|
83
|
+
error: base.error,
|
|
84
|
+
success: base.success,
|
|
85
|
+
info: base.info,
|
|
86
|
+
warning: base.warning,
|
|
87
|
+
meta: base.meta,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The editable form for an existing palette. */
|
|
92
|
+
export function draftFromCustomTheme(palette: ThemePalette): CustomThemeDraft {
|
|
93
|
+
return {
|
|
94
|
+
name: palette.name,
|
|
95
|
+
variant: palette.variant,
|
|
96
|
+
canvas: palette.canvas,
|
|
97
|
+
paper: palette.paper,
|
|
98
|
+
ink: palette.ink,
|
|
99
|
+
error: palette.error,
|
|
100
|
+
success: palette.success,
|
|
101
|
+
info: palette.info,
|
|
102
|
+
warning: palette.warning,
|
|
103
|
+
meta: palette.meta,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** `#abc`, `#aabbcc` and `#aabbccdd` normalised to an opaque `#aabbcc`, or null. */
|
|
108
|
+
export function normalizeHexColor(value: unknown): string | null {
|
|
109
|
+
if (typeof value !== 'string') return null;
|
|
110
|
+
const parsed = parseHexColor(value);
|
|
111
|
+
return parsed ? rgbaToHex(parsed) : null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** A new id that cannot collide with a built-in and is safe in a selector. */
|
|
115
|
+
export function createCustomThemeId(): string {
|
|
116
|
+
// `getRandomValues`, not `randomUUID`: the latter is secure-context only, and
|
|
117
|
+
// a Kabmo on a plain-HTTP LAN address is a supported install.
|
|
118
|
+
const bytes = new Uint8Array(6);
|
|
119
|
+
if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {
|
|
120
|
+
crypto.getRandomValues(bytes);
|
|
121
|
+
} else {
|
|
122
|
+
for (let index = 0; index < bytes.length; index += 1) bytes[index] = Math.floor(Math.random() * 256);
|
|
123
|
+
}
|
|
124
|
+
return `${CUSTOM_THEME_PREFIX}${[...bytes].map((byte) => byte.toString(16).padStart(2, '0')).join('')}`;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Validate a draft into a palette. `id` is passed only while EDITING, so the
|
|
129
|
+
* same theme keeps its saved id; otherwise a fresh one is minted.
|
|
130
|
+
*/
|
|
131
|
+
export function validateCustomThemeDraft(draft: CustomThemeDraft, id?: string): CustomThemeResult {
|
|
132
|
+
const issues: CustomThemeIssue[] = [];
|
|
133
|
+
const name = draft.name.trim();
|
|
134
|
+
if (name.length === 0) issues.push({ field: 'name', message: 'Give the theme a name.' });
|
|
135
|
+
else if (name.length > CUSTOM_THEME_NAME_MAX) {
|
|
136
|
+
issues.push({ field: 'name', message: `Keep the name under ${CUSTOM_THEME_NAME_MAX} characters.` });
|
|
137
|
+
}
|
|
138
|
+
if (draft.variant !== 'light' && draft.variant !== 'dark') {
|
|
139
|
+
issues.push({ field: 'variant', message: 'Choose light or dark.' });
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const colors = {} as Record<CustomThemeSlot, string>;
|
|
143
|
+
for (const slot of CUSTOM_THEME_SLOTS) {
|
|
144
|
+
const color = normalizeHexColor(draft[slot]);
|
|
145
|
+
if (!color) {
|
|
146
|
+
issues.push({ field: slot, message: `“${draft[slot] || 'empty'}” is not a hex colour.` });
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
colors[slot] = color;
|
|
150
|
+
}
|
|
151
|
+
if (issues.length > 0) return { ok: false, issues };
|
|
152
|
+
|
|
153
|
+
// The whole UI derives from ink over these two surfaces; a pair below AA
|
|
154
|
+
// would ship a palette whose own body text cannot be read.
|
|
155
|
+
for (const surface of ['paper', 'canvas'] as const) {
|
|
156
|
+
if (contrastBetween(colors.ink, colors[surface]) < MUTED_CONTRAST_FLOOR) {
|
|
157
|
+
issues.push({
|
|
158
|
+
field: 'ink',
|
|
159
|
+
message: `Ink must reach ${MUTED_CONTRAST_FLOOR}:1 against ${CUSTOM_THEME_SLOT_LABELS[surface].toLowerCase()}.`,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (issues.length > 0) return { ok: false, issues };
|
|
164
|
+
|
|
165
|
+
const themeId = id ?? createCustomThemeId();
|
|
166
|
+
if (!CUSTOM_ID.test(themeId) || THEMES.some((theme) => theme.id === themeId)) {
|
|
167
|
+
return { ok: false, issues: [{ field: 'name', message: 'That theme id is not available.' }] };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
ok: true,
|
|
172
|
+
palette: {
|
|
173
|
+
id: themeId,
|
|
174
|
+
name,
|
|
175
|
+
family: 'custom',
|
|
176
|
+
variant: draft.variant,
|
|
177
|
+
...colors,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/** One stored entry, normalised, with no contrast judgement (read path). */
|
|
183
|
+
function sanitizeStoredTheme(value: unknown): ThemePalette | null {
|
|
184
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) return null;
|
|
185
|
+
const record = value as Record<string, unknown>;
|
|
186
|
+
const id = record.id;
|
|
187
|
+
if (typeof id !== 'string' || !CUSTOM_ID.test(id) || THEMES.some((theme) => theme.id === id)) return null;
|
|
188
|
+
const name = typeof record.name === 'string' ? record.name.trim().slice(0, CUSTOM_THEME_NAME_MAX) : '';
|
|
189
|
+
if (name.length === 0) return null;
|
|
190
|
+
if (record.variant !== 'light' && record.variant !== 'dark') return null;
|
|
191
|
+
|
|
192
|
+
const colors = {} as Record<CustomThemeSlot, string>;
|
|
193
|
+
for (const slot of CUSTOM_THEME_SLOTS) {
|
|
194
|
+
const color = normalizeHexColor(record[slot]);
|
|
195
|
+
if (!color) return null;
|
|
196
|
+
colors[slot] = color;
|
|
197
|
+
}
|
|
198
|
+
return { id: id as ThemePalette['id'], name, family: 'custom', variant: record.variant, ...colors };
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** The stored array, normalised. Invalid entries are dropped, duplicates collapsed. */
|
|
202
|
+
export function sanitizeCustomThemes(value: unknown): ThemePalette[] {
|
|
203
|
+
if (!Array.isArray(value)) return [];
|
|
204
|
+
const seen = new Set<string>();
|
|
205
|
+
const themes: ThemePalette[] = [];
|
|
206
|
+
for (const entry of value.slice(0, MAX_CUSTOM_THEMES)) {
|
|
207
|
+
const theme = sanitizeStoredTheme(entry);
|
|
208
|
+
if (!theme || seen.has(theme.id)) continue;
|
|
209
|
+
seen.add(theme.id);
|
|
210
|
+
themes.push(theme);
|
|
211
|
+
}
|
|
212
|
+
return themes;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* The WRITE path: every entry must be valid, so a direct API call cannot save a
|
|
217
|
+
* theme that the reader would then silently drop. Contrast is enforced here as
|
|
218
|
+
* well, because this is where the user (or a script) states the palette.
|
|
219
|
+
*/
|
|
220
|
+
export function validateCustomThemesForWrite(
|
|
221
|
+
value: unknown,
|
|
222
|
+
): { ok: true; themes: ThemePalette[] } | { ok: false; error: string } {
|
|
223
|
+
if (!Array.isArray(value)) return { ok: false, error: 'customThemes must be an array.' };
|
|
224
|
+
if (value.length > MAX_CUSTOM_THEMES) {
|
|
225
|
+
return { ok: false, error: `At most ${MAX_CUSTOM_THEMES} custom themes can be saved.` };
|
|
226
|
+
}
|
|
227
|
+
const seen = new Set<string>();
|
|
228
|
+
const themes: ThemePalette[] = [];
|
|
229
|
+
for (const [index, entry] of value.entries()) {
|
|
230
|
+
const theme = sanitizeStoredTheme(entry);
|
|
231
|
+
if (!theme) return { ok: false, error: `Custom theme ${index + 1} is not a valid palette.` };
|
|
232
|
+
if (seen.has(theme.id)) return { ok: false, error: `Custom theme ${index + 1} repeats an id.` };
|
|
233
|
+
const ink = contrastBetween(theme.ink, theme.paper);
|
|
234
|
+
const inkOnCanvas = contrastBetween(theme.ink, theme.canvas);
|
|
235
|
+
if (ink < MUTED_CONTRAST_FLOOR || inkOnCanvas < MUTED_CONTRAST_FLOOR) {
|
|
236
|
+
return { ok: false, error: `Custom theme ${index + 1} has ink under ${MUTED_CONTRAST_FLOOR}:1.` };
|
|
237
|
+
}
|
|
238
|
+
seen.add(theme.id);
|
|
239
|
+
themes.push(theme);
|
|
240
|
+
}
|
|
241
|
+
return { ok: true, themes };
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** The custom palettes a stored `app_settings` map carries. */
|
|
245
|
+
export function customThemesFromSettings(settings: Record<string, unknown> | null | undefined): ThemePalette[] {
|
|
246
|
+
return sanitizeCustomThemes(readSettingsBlob(settings).customThemes);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* The selected id, kept only when it still names a palette this install can
|
|
251
|
+
* paint. Deleting a theme on one device must not leave another device holding
|
|
252
|
+
* an id that resolves to the default while the picker shows nothing selected.
|
|
253
|
+
*/
|
|
254
|
+
export function normalizeStoredThemeId(theme: unknown, customThemes: readonly ThemePalette[]): ThemeId {
|
|
255
|
+
if (typeof theme === 'string') {
|
|
256
|
+
if (THEMES.some((entry) => entry.id === theme)) return theme as ThemeId;
|
|
257
|
+
if (customThemes.some((entry) => entry.id === theme)) return theme as ThemeId;
|
|
258
|
+
}
|
|
259
|
+
return DEFAULT_THEME_ID;
|
|
260
|
+
}
|
|
@@ -8,11 +8,14 @@ import { describe, expect, test } from 'bun:test';
|
|
|
8
8
|
import {
|
|
9
9
|
MUTED_CONTRAST_FLOOR,
|
|
10
10
|
MUTED_STEPS,
|
|
11
|
+
SIGNAL_TINT_STEPS,
|
|
11
12
|
TEXT_CONTRAST_FLOOR,
|
|
12
13
|
contrastBetween,
|
|
13
14
|
inkScale,
|
|
14
15
|
onInkTextColor,
|
|
16
|
+
onSignalTextColor,
|
|
15
17
|
signalTextColor,
|
|
18
|
+
signalWorstContrast,
|
|
16
19
|
worstTextContrast,
|
|
17
20
|
} from '@/shared/lib/theme/ink-scale';
|
|
18
21
|
import { SIGNAL_SLOTS } from '@/shared/lib/theme/ink-scale';
|
|
@@ -145,7 +148,85 @@ describe('signal colours as text', () => {
|
|
|
145
148
|
expect(failing).toEqual([]);
|
|
146
149
|
});
|
|
147
150
|
|
|
148
|
-
test('
|
|
149
|
-
|
|
151
|
+
test('every slot also clears AA on its OWN tinted chip', () => {
|
|
152
|
+
// The tint moves the ground toward the word: `paper`'s error is 5.03:1 on
|
|
153
|
+
// the page and 4.33:1 on its 10% badge; on `one-dark-pro-soft` 4.38 -> 3.87.
|
|
154
|
+
const failing: string[] = [];
|
|
155
|
+
for (const theme of THEMES) {
|
|
156
|
+
for (const slot of SIGNAL_SLOTS) {
|
|
157
|
+
const color = signalTextColor(theme, slot);
|
|
158
|
+
for (const surface of [theme.paper, theme.canvas]) {
|
|
159
|
+
for (const step of SIGNAL_TINT_STEPS) {
|
|
160
|
+
const chip = mixHex(surface, theme[slot], step / 100);
|
|
161
|
+
if (contrastBetween(color, chip) < 4.5 - 0.001) {
|
|
162
|
+
failing.push(`${theme.id}/${slot}/${step}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
expect(failing).toEqual([]);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test('a signal that already clears every surface is returned unchanged', () => {
|
|
172
|
+
// No shipped signal clears a 25% tint of itself, which is the worst surface
|
|
173
|
+
// the solver considers. A synthetic black meta is the no-op branch.
|
|
174
|
+
const synthetic = { ...paper, id: 'synthetic', meta: '#000000' };
|
|
175
|
+
expect(signalWorstContrast('#000000', synthetic, 'meta')).toBeGreaterThanOrEqual(4.5);
|
|
176
|
+
expect(signalTextColor(synthetic, 'meta')).toBe('#000000');
|
|
177
|
+
// `error` reads on the page but not on its own chip, so it is nudged.
|
|
178
|
+
expect(signalTextColor(paper, 'error')).not.toBe(paper.error);
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
describe('a word on a solid signal fill', () => {
|
|
183
|
+
test('every slot clears AA against its own fill on every palette', () => {
|
|
184
|
+
// Measured before: `bg-error text-canvas` failed on 12 of 32 light palettes
|
|
185
|
+
// (2.85:1 on `mono-light`) and 8 of 31 dark ones (3.40:1 on
|
|
186
|
+
// `fields-of-the-shire-dark`).
|
|
187
|
+
const failing: string[] = [];
|
|
188
|
+
for (const theme of THEMES) {
|
|
189
|
+
for (const slot of SIGNAL_SLOTS) {
|
|
190
|
+
if (contrastBetween(onSignalTextColor(theme, slot), theme[slot]) < 4.5 - 0.001) {
|
|
191
|
+
failing.push(`${theme.id}/${slot}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
expect(failing).toEqual([]);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
test('the chosen word is a palette surface or a pure extreme, and it reads', () => {
|
|
199
|
+
const chosen = onSignalTextColor(paper, 'error');
|
|
200
|
+
expect([paper.paper, paper.canvas, '#ffffff', '#000000']).toContain(chosen);
|
|
201
|
+
expect(contrastBetween(chosen, paper.error)).toBeGreaterThanOrEqual(4.5);
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
describe('the solved text ladder', () => {
|
|
206
|
+
test('every rung clears AA on every palette', () => {
|
|
207
|
+
const failing: string[] = [];
|
|
208
|
+
for (const theme of THEMES) {
|
|
209
|
+
inkScale(theme).textLadder.forEach((color, index) => {
|
|
210
|
+
if (worstTextContrast(color, theme) < 4.5 - 0.001) {
|
|
211
|
+
failing.push(`${theme.id}/${MUTED_STEPS[index]}`);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
expect(failing).toEqual([]);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
test('the raw ramp is untouched, so the decorative ladder keeps its shape', () => {
|
|
219
|
+
for (const theme of THEMES) {
|
|
220
|
+
const scale = inkScale(theme);
|
|
221
|
+
expect(scale.textLadder.length).toBe(scale.ladder.length);
|
|
222
|
+
// Below the floor the text rung is the palette's own muted level.
|
|
223
|
+
scale.ladder.forEach((color, index) => {
|
|
224
|
+
if (worstTextContrast(color, theme) < MUTED_CONTRAST_FLOOR) {
|
|
225
|
+
expect(scale.textLadder[index], `${theme.id}/${MUTED_STEPS[index]}`).toBe(scale.muted);
|
|
226
|
+
} else {
|
|
227
|
+
expect(scale.textLadder[index], `${theme.id}/${MUTED_STEPS[index]}`).toBe(color);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
150
231
|
});
|
|
151
232
|
});
|