Repository navigation
report: /topicsVizReport/<report id> is the first-party topic map as a clean, reusable page - #3478
Merged
Merged
Conversation
…a clean, reusable page The page is the topic map alone: a Solid component around client-topic-map, served at /topicsVizReport/<report id>. It loads a run's stored map by report id, lets a reader choose between a report's runs when the route lists more than one, and draws held-back comments as grey points that say so. It requests nothing from another host and neither datamapplot listing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
…nt text, and a new token reloads the map From an independent review: the module-wide comment text was keyed by report alone, so a signed-in placement and an anonymous one in the same document shared one answer, and the map read the token untracked, so a changed token did not reload it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
The build writes NOTICE.txt beside the page's script and font: Solid's licence (solid-js, @solidjs/web and @solidjs/h publish none of their own, so it is the Solid repository's LICENSE at their release tags), the one @solidjs/signals publishes, client-topic-map's notices and the font's OFL, whole. The script's first comment and the page name it; the standalone file carries the same text inline. A test checks the emitted files, and that every package in the bundle is named in the package's NOTICE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
…d is kept for one reader only The comment list for the tooltips now carries the report's own moderation level as mod_gt, read from the report as client-report does (a host may give the conversation id and the level instead); with no level, no text is asked for. So a tooltip never shows a comment's text the report would not show that reader. Each component keeps the text for one reader (report, conversation id, level, token) and makes it afresh with every read of the map: nothing is shared between components, and a token added, changed or removed reloads the map and its text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
…count A run whose list entry has no levels, no model name or no count is described by what it has, never as null or an empty count; the route records today's keyword-named runs as "none", and the chooser calls both "none" and "keywords" keyword names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
…sation props gets the map and its text loaded again Review round: the two props join the map effect's dependencies, so comment text fetched for one reader's settings is never left showing after the host changes them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
…me, and the page installs the reporter as every client does The topic map page added /static/topic-map/ to the routing table, so the reporter's list of static path names, generated from it by ci/local/client-error-paths.cjs, gains topic-map in all five copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
… on every other client /topicsVizReport was served by the report client, which reported its errors; the static page that took the address over reported none. The served page now installs the report client's copy of the reporter, inline before the font and the script, as the report client did (client report, the build commit when the image is given one, the API on the same host). The standalone file asks no host and carries none. The file-server's page stage copies the reporter and the prelude builder, and the package's workflow runs when either changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
…aside, and the font is read from the page Run after other specs in one browser, as its hosted shard runs it, the test counted Simple Analytics closing beacons (queue.simpleanalyticscdn.com /append) that the admin, report and participation pages of earlier specs send while it runs, and failed the topic map page for them. Run alone it passes. They are now set aside, by that one address, only while the page has no Simple Analytics of its own (its script from another host is still blocked and counted, and window.sa_event must be undefined); how many were set aside is logged. The font was checked by waiting for its request, which a retried attempt never makes (the first attempt cached it for a year), so the retries failed on the font and hid the first attempt's failure. It is now read from the page: the resource from /static/topic-map/ and the Roboto face loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KvftUARCjBArGpuPBmjRZ1
colinmegill
marked this pull request as ready for review
November 24, 2026 14:30
Contributor
Delphi Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Observable changes to existing tests and behaviour (read first):
e2e/cypress/e2e/client-report/report-authentication.cy.js: on/topicsVizReport/<id>the assertioncy.contains('visualization')(text of the old React page) becomescy.get('.polis-topic-map').should('exist')(the new page: its map, or its quiet message while no map is stored). What it protected stays: the address loads a page, not an error ("Cannot GET" is still refused).e2e/cypress/e2e/self-contained/third-party-hosts.cy.js:/topicsVizReportleaves its list of report client pages, because the report client no longer serves it. The rule it protected (nothing from another host) is checked for this page bytopic-map-page.cy.js, with every non-local host blocked.node ci/local/client-error-paths.cjsfrom the routing table) gainstopic-map, so a load failure under/static/topic-map/is reported with its path name, not redacted.report), so an uncaught error, a failed load of its script or font, or a failed read sendsPOST /api/v3/clientErrorsto our own host. The standalone file carries no reporter./topicsVizReport/<report id>becomes the topic map alone: the first-party map fromclient-topic-map, drawn by a small, reusable Solid view. The page can load any of the report's stored maps by choice, and it shows held-back comments as grey dots marked "Moderated out", so a reader can see how much was submitted against how much is shown.What a person sees
noneorkeywordsreads "keyword names". Choosing one draws it and putsjob_idin the address, so that map can be linked to. With one run, or while the route does not list runs, there is no menu and the page draws the current map.?chooser=0hides it.?job_id=<id>draws that run's map;?selection=participant_visible|all_but_moderated_out|all_comments(withoutjob_id) the current map under that comment rule, if the route lets this reader have it;?theme=lightthe package's neutral theme (white ground);?theme=dark, the default, a dark theme derived from it (#121212ground). The default is one constant,DEFAULT_THEMEinclient-topic-map-embed/src/themes.js.This route no longer renders the report client's React
TopicsVizReportcomponent. The component itself, and the topic map narrative report (/topicMapNarrativeReport/<id>) that renders it, are unchanged.Every request the page makes
The reads are in one module,
client-topic-map-embed/src/load.js, sent with no credential (credentials: "omit", noAuthorization):GET /api/v3/delphi/topicMap?report_id=<id>with&job_id=<id>or&selection=<rule>when the address names one (never both: the route refuses the pair). Once per report, run and rule. Nosourceparameter, so the route answers with its served map, or, when nothing served is stored for the report, the shadow one.GET /api/v3/delphi/topicMap?report_id=<id>&list=jobs: the report's runs with a stored map, asked once, beside the map and never before it; not asked with?chooser=0.At the first pointer move over a drawn map, once per map read:
GET /api/v3/reports?report_id=<id>(for the conversation id, which the comment list needs and the map does not carry, and the report'smod_level), thenGET /api/v3/comments?conversation_id=<id>&report_id=<id>&moderation=true&mod_gt=<mod_level>: the comment list with the report's moderation filter, asclient-reportasks for it. The report pages also sendinclude_voting_patterns, which only adds vote counts to the same rows; the tooltips need none, so it is left out. To anyone but the conversation's moderators the list holds only what participants can see.Only when something fails:
POST /api/v3/clientErrors, from the client error reporter every client installs (inline in the page's head, as the report client did on this address; clientreport; nothing but our own host).The page never requests
/api/v3/delphi/visualizationsor/api/v3/delphi, and loads its script and font from our own build and nothing from any other host.The view, for other places
client-topic-map-embed/src/TopicMap.jsis the Solid component; the page (src/page.js) is a thin shell that maps the address to its props. Props:reportId; optionaljobIdorselection;theme; optionaldocument(draw one in hand, ask for no map; with areportIdit still asks for comment text on hover);controls: false(no buttons);counts: false(no count line);commentText: false(ask for no text);conversationIdandmodLevel(a host that knows both saves the report request; with either missing the report is read for them);header(shown above the buttons; the page puts its chooser there);onTopicSelect,onTopicHover,onLevelChange;fetch; andtoken, a Bearer token for a placement whose reader is signed in. A new token, or none, reloads the map and its text. Each view keeps comment text for one reader only (report, conversation id, level, token), made afresh with every read of the map; two views never share it, so a signed-in placement and an anonymous one in the same document never see each other's text. A host whose ownfetchcarries a credential of its own changes the token or mounts another view when its reader changes. The public page passes no token; the moderator's placement is not built here. The chooser (src/JobChooser.js,src/jobs.js) belongs to the page, so a place that embeds the view can bring its own.How it is served
client-topic-map-embed/, a package besideclient-topic-map. The map package is imported and used as it is; nothing inclient-topic-mapchanges.solid-js2.0.3,@solidjs/web2.0.3 and@solidjs/h2.0.2, written with hyperscript so no JSX compiler is needed (the Solid Babel preset has no stable 2.x release). Bundled byesbuild0.28.2 into one script of about 86 KB. Every version is exact and in a lockfile.npm run buildwritesNOTICE.txtbeside the script and font: Solid's licence (solid-js,@solidjs/weband@solidjs/hpublish no licence file of their own, so it is the Solid repository's LICENSE at their release tags), the one@solidjs/signalspublishes,client-topic-map's NOTICE and the font's OFL, whole. The script's first comment and the page name it; the standalone file carries the same text inline. The sources areclient-topic-map-embed/NOTICE,client-topic-map/NOTICEandclient-topic-map/fonts/OFL.txt.npm run buildwritesdist/static/topic-map/index.html,page.<hash>.js, the map's font andNOTICE.txt, each with its.headersJson(script and font cached for a year, the pageno-cache). A stage infile-server/Dockerfileruns the tests and the build and copiesdist/into the file-server's build.node build.mjs --standalone <document or set of runs> <out.html>writes one file that opens from disk; built from a set of runs, it answers its own map and list requests from what it holds./topicsVizReport/<id>, ahead of the report pages, rewrites to/static/topic-map/index.html(the query kept) and sends it the way every/static/file goes.topicsVizReportleaves the report pages' location.client-report: the report client is a React 18 webpack application; this view is reused on other routes and wants no React.Tests
make check-client-topic-map-embed(Node 24.22.1; also a hosted workflow):npm ci, 43 unit tests (node --test), then the build. They cover the request module (each URL;job_idandselectionnever together; no credential unless a token is given; the comment list always under the report's moderation level, checked against a stand-in that filters as Node does; every answer of the map, the list and the comment reads, including failures, mapped without throwing), the comment text kept per reader (a token's text never reaches a reader without it, either way round; a token change reloads the map), the notices in the emitted directory, the script and the standalone file (and every package in the bundle named in the NOTICE), runs without levels, model or count, the mapping from props to requests, the chooser's states (no list, one run, two runs, a named run, a run not in the list, no run matching the map drawn), each run in plain words, the tooltip text and count line for held-back points, the fixture tool, the themes, and the client error reporter: installed inline in the built page's head, whole, before the font and the script, reporting as the report client, the build commit passed only when it is a commit hash, and none in the standalone file.e2e/cypress/e2e/self-contained/topic-map-page.cy.js, with every non-local host blocked: the map draws and its level buttons change the drawing;?theme=lightand?job_id; the route off and its other answers, each asked once; a map with held-back points (the public biodiversity fixture in the route's public form, written byclient-topic-map-embed/tools/held-back-fixture.mjs): it draws, the count line shows, pointing at a grey point shows "Moderated out", the comment text is asked for only at the first pointer move (the two reads, with their exact parameters,mod_gtfrom the report included, once) and an ordinary point then shows its text; two runs in the list: the menu names both, choosing the second asks for itsjob_idand puts it in the address; the list missing: no menu, the map draws;?chooser=0: no list asked for. No request leaves for another host and neither datamapplot listing is asked for.make check-client-errors: the reporter's path names match the routing table (now withtopic-map), and the page's template and build install the reporter before its font and script.topic-map-page.cy.js, Simple Analytics closing beacons (https://queue.simpleanalyticscdn.com/append) that pages of earlier specs send while it runs are set aside, by that one address, only while the page has no Simple Analytics of its own (its script from another host is still blocked and counted;window.sa_eventmust be undefined). The map's font is checked from the page (resource from/static/topic-map/, the Roboto face loaded) rather than by waiting for its request, which a retried attempt never makes.file-server/nginx/test-edge-routing.py:/topicsVizReport/<id>?job_id=…reaches Node as/static/topic-map/index.html?job_id=…, never as the report shell.third-party-hosts.cy.jsno longer visits/topicsVizReportas a report client page;report-authentication.cy.jschecks the topic map page there.Not in this change
list=jobs, the page shows no menu.🤖 Generated with Claude Code