fix: Mermaid diagram errors, dark theme compatibility, and mdhelp scroll reset#1540
fix: Mermaid diagram errors, dark theme compatibility, and mdhelp scroll reset#1540jaypatrick merged 7 commits intomainfrom
Conversation
… reset - frontend/app.config.ts: add withRouterConfig with scrollPositionRestoration, anchorScrolling and scrollOffset to prevent viewport scroll resets - frontend/compiler.component.ts: guard router.navigate() with URL-change check and replaceUrl:true to prevent history push on unchanged URLs - docs/architecture/SYSTEM_ARCHITECTURE.md: remove emoji from node labels, replace near-white classDef fills with medium-luminance dark-theme-safe palette - docs/development/ARCHITECTURE.md: graph TD -> flowchart TD, remove emoji from node labels, replace all light classDef/style fills with medium-luminance palette, replace box rgb(...) sequenceDiagram boxes with plain box - docs/auth/auth-chain-reference.md: fix gantt axisFormat %b %Y -> %Y-%m-%d, replace light-fill style overrides with medium-luminance palette, remove emoji - docs/workflows/WORKFLOW_DIAGRAMS.md: fix BatchCompilationWorkflow NEXT_CHUNK back-edge into subgraph, replace all light style fills with dark-safe palette - docs/cloudflare/CLOUDFLARE_WORKFLOWS.md: add color:#fff to green Complete style overrides, replace all light style fills Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/83fac841-606e-42cf-9715-7b045d0217e5 Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
|
@copilot CI is broken |
… options withRouterConfig() accepts RouterConfigOptions which does not include scrollPositionRestoration/anchorScrolling/scrollOffset — those belong in withInMemoryScrolling() (InMemoryScrollingOptions). Replace withRouterConfig with withInMemoryScrolling to fix TS2353 compile error. Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/19ba5eac-2925-47e4-84bc-193021bf2250 Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Fixed in 76b1975. The build was failing with |
|
@copilot apply changes based on the comments in this thread |
…guard
- app.config.ts: add scrollOffset: [0, 72] to withInMemoryScrolling so
the 72px header offset comment matches actual behaviour
- compiler.component.ts: use queryParamMap.get('url') instead of
queryParams['url'] at both navigate guards — queryParams['url'] can be
string|string[], making the equality check unreliable when query params
are repeated; queryParamMap.get() always returns string|null
Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/7666d75e-7e5f-45e1-be1e-eeac3388e999
Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Applied all three review items in b8d9fa5:
|
|
@copilot fix CI |
…ollingOptions
scrollOffset is a RouterConfigOptions property, not InMemoryScrollingOptions.
Moving it to withRouterConfig({ scrollOffset: [0, 72] }) fixes the
TS2353 build error introduced when applying the reviewer's suggestion.
Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/73661368-bb68-40d8-a383-37a220cddc87
Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Fixed in d20d0e4. The build was failing with |
|
@copilot fix CI |
…uter type option scrollOffset is not a property of InMemoryScrollingOptions or RouterConfigOptions in Angular 21. The correct API is ViewportScroller.setOffset([0, 72]), called inside provideAppInitializer before any await so the injection context is still active. - Remove withRouterConfig (not needed) - Add ViewportScroller to @angular/common import - Call inject(ViewportScroller).setOffset([0, 72]) in provideAppInitializer - Update comment to describe actual behavior Agent-Logs-Url: https://github.com/jaypatrick/adblock-compiler/sessions/aa6ceb84-87e2-404d-9669-bfb9f34f9225 Co-authored-by: jaypatrick <1800595+jaypatrick@users.noreply.github.com>
Fixed in 7c18973. |
Two distinct bugs: (1) Several Mermaid diagrams across
/docsfail to parse or are near-invisible on dark backgrounds due to emoji in node labels, legacygraph TDsyntax, back-edges into subgraphs, and near-white hardcoded fills. (2) Angular'sRouterresets scroll position to the top on everyrouter.navigate()call inonSubmit(), including unchanged-URL navigations.Changes
Frontend — scroll position reset (
frontend/)app.config.ts: AddedwithInMemoryScrolling({ scrollPositionRestoration: 'enabled', anchorScrolling: 'enabled' })toprovideRouter()— enables Angular's built-in in-memory scroll restoration and anchor scrolling. The 72px scroll offset for the fixed header is applied viainject(ViewportScroller).setOffset([0, 72])insideprovideAppInitializer(the correct Angular 21 API —scrollOffsetis not a valid option onInMemoryScrollingOptionsorRouterConfigOptions).compiler.component.ts: Bothrouter.navigate()calls inonSubmit()now guard on URL change and usereplaceUrl: trueto avoid pushing redundant history entries that trigger scroll resets. The URL comparison usesqueryParamMap.get('url')instead ofqueryParams['url']to correctly handle thestring | string[]type and avoid false inequality when query params are repeated.Docs — Mermaid diagram fixes
docs/architecture/SYSTEM_ARCHITECTURE.md: Stripped all emoji from quoted node labels; replaced near-whiteclassDeffills (#F0C040,#E8A838, etc.) with medium-luminance palette (#1d6fbd,#b8860b,#2e7d32, …) with explicitcolor:#fff.docs/development/ARCHITECTURE.md:graph TD→flowchart TD(legacy parser); stripped emoji from node/subgraph labels; replaced all ~40 lightclassDef/stylefills; replacedbox rgb(...)insequenceDiagramblocks with plainboxfor theme-aware rendering.docs/auth/auth-chain-reference.md: Fixed ganttaxisFormat %b %Y→%Y-%m-%d(month-level ticks made 3–14 day bars invisible); replaced light inlinestylefills; removed emoji from node labels.docs/workflows/WORKFLOW_DIAGRAMS.md: FixedBatchCompilationWorkflowillegal back-edge into subgraph (CHUNK2 -->|Yes| NEXT_CHUNK → C1_STARTcollapsed toCHUNK2 -->|Yes| C1_START); replaced all ~60 lightstylefills.docs/cloudflare/CLOUDFLARE_WORKFLOWS.md: Addedcolor:#fffto all threestyle Complete fill:#4caf50overrides; replaced remaining light fills.Testing
Zero Trust Architecture Checklist
Worker / Backend
*) on write/authenticated endpoints — N/A[vars]) — N/A.prepare().bind()(no string interpolation) — N/AFrontend / Angular
CanActivateFnauth guards — unchanged, no new routeslocalStorage) — N/AAPI Shield / Vulnerability Scanner
operationIdinopenapi.yaml— N/A/{id}path parameters) include asecurity:annotation — N/AWHERE user_id = ?) — N/A404(not403) to avoid leaking resource existence — N/Acloudflare-schema.yamlregenerated ifopenapi.yamlchanged (deno task schema:cloudflare) — N/AOriginal prompt
Overview
Two distinct problems need to be fixed:
/docs— several charts fail to render or look broken on dark backgrounds.1 — Mermaid diagram fixes
Files to fix
docs/architecture/SYSTEM_ARCHITECTURE.mdflowchart TDdiagrams (Current Architecture and Target Architecture) use emoji inside quoted Mermaid node labels (e.g.["🌐 Browser"],["☁️ Cloudflare Access\n..."]). Emoji in node labels are not supported by all Mermaid renderers and cause parse/render failures. Replace all emoji in node labels with plain-text equivalents or remove them. Keep emoji only in subgraph titles if the renderer handles those separately, but plain text is safest everywhere.classDeffills that are near-white (fill:#F0C040,fill:#E8A838withcolor:#fff, etc.) — legible on light backgrounds but extremely low contrast on dark themes. Replace with medium-luminance fills that work on both themes:color:#ffffor dark fills andcolor:#1a1a1afor light fills.#1d6fbd(blue),#b05a10(amber),#2e7d32(green),#6a1fa0(purple),#c62828(red),#37474f(slate). These all pair withcolor:#fff.corelib/jsrpkgyellow nodes use#b8860b(dark goldenrod) withcolor:#fff.docs/development/ARCHITECTURE.mdgraph TD— change toflowchart TDfor consistency and to avoid thegraphlegacy parser.mindmapblock for the module map: ensure all child nodes underroot((src/))use consistent 4-space indentation. Mixed 2-space and 4-space indentation breaksmindmapparsing.classDefblocks use very light fills (e.g.fill:#eff6ff,fill:#fef9c3,fill:#f0fdf4,fill:#fdf4ff,fill:#fff7ed,fill:#fef2f2) with darkcolor:#1e293btext. These fills disappear on dark backgrounds. Replace them with the same medium-luminance palette described above:external→fill:#37474f,color:#fffclient→fill:#1b5e20,color:#fffsystem→fill:#b8860b,color:#fffinfra→fill:#1a237e,color:#fffobservability→fill:#b84000,color:#fffauth→fill:#880e4f,color:#fffcore→fill:#b8860b,color:#fffmodule→fill:#1b5e20,color:#fffinterface→fill:#1a237e,color:#fffadapter→fill:#1b5e20,color:#fffconsumer→fill:#b8860b,color:#fffstep→fill:#1a237e,color:#fffinput→fill:#1b5e20,color:#fffoutput→fill:#1a237e,color:#fffentry→fill:#b8860b,color:#fffrouter→fill:#1a237e,color:#fffhandler→fill:#1b5e20,color:#fffmiddleware→fill:#6a1fa0,color:#fffevent→fill:#b8860b,color:#fffhook→fill:#1b5e20,color:#fffprovider→fill:#1b5e20,color:#fffmessage→fill:#b8860b,color:#fffbase→fill:#1a237e,color:#ffferror→fill:#c62828,color:#fffclient (deploy)→fill:#1b5e20,color:#fffedge→fill:#b8860b,color:#fffworker→fill:#1a237e,color:#fffstorage→fill:#6a1fa0,color:#fffexternal→fill:#37474f,color:#fffsequenceDiagramboxes (SSE Streaming and Async Queue) usebox rgb(...)notation. These are valid in Mermaid v10+ but may render as solid-colour boxes that obscure text in dark mode. Replace eachbox rgb(...)with justbox(no colour arg) which lets Mermaid use theme defaults, or remove the box wrapper and leave bare participants.docs/auth/auth-chain-reference.mdganttdiagram usesaxisFormat %b %Y(month-level axis) with step durations as short as3d. Short bars at a monthly axis granularity often render as invisible zero-width bars. ChangeaxisFormatto%Y-%m-%dso the axis ticks are at day level and all bars are visible.flowchart TDauth chain uses inlinestyleoverrides with very light fills (fill:#e8f4f8,fill:#e8f5e9,fill:#fff3e0,fill:#f5f5f5,fill:#ffebee). These are near-invisible on dark backgrounds. Replace with the medium-luminance palette above:REQnode:fill:#37474f,color:#fffAUTH_OK,BA_OKnodes:fill:#1b5e20,color:#fffCLERK_OKnode:fill:#b84000,color:#fffANONnode:fill:#37474f,color:#fffREJECT,REJECT2,REJECT3,REJECT4nodes:fill:#c62828,color:#fffdocs/workflows/WORKFLOW_DIAGRAMS.mdCHUNK2 -->|Yes| NEXT_CHUNK[Process Next Chunk]followed byNEXT_CHUNK --> C1_STARTcreates a backward edge into a subgraph (Chunk Processing). This is illegal in strict Mermaidflowchart TDand causes a render error. Fix: moveNEXT_CHUNKoutside the subgraph OR restructure the loop so thatCHUNK2 -->|Yes| C1_STARTdir...This pull request was created from Copilot chat.