Task ID: artifact-tabs-jsquote-2026-05-10 Layer: Atlas (artifact_detail + dataset_detail_page) Date: 2026-05-10
On https://scidex.ai/artifact/<id> the Discussion / Provenance / Versions
/ Links tab buttons did nothing on click. Same affected
/dataset/<id> pages.
The Discussion / Comment JS block shares a single <script> tag with the
showArtifactTab tab handler. Inside that block, several html += '...'
lines build buttons whose onclick= attributes need an inner single
quote:
html += '<button onclick="submitArtifactComment(\'' + artifactId + '\')"...That JS source is embedded in a Python f"""...""" template. Python
processes \' as a single-quote escape before shipping the string to
the browser, so the wire content collapsed to:
html += '<button onclick="submitArtifactComment('' + artifactId + '')"...The empty '' strings closed and immediately re-opened the JS string,
producing a SyntaxError: Unexpected string. Because parsing fails for
the whole <script> tag, showArtifactTab was never defined — so every
tab button became a no-op.
Confirmed by piping the rendered page through node -c:
SyntaxError: Unexpected stringapi.py: replace \' → \\' in every submitArtifactComment /
reactToComment JS-generation line. Python now emits the literal
two-byte sequence \' (backslash + apostrophe), which JS reads as a
properly escaped quote inside the single-quoted JS string.
Eight lines changed across two identical script blocks:
python3 -c "import ast; ast.parse(open('api.py').read())" → OK<script> block from a live artifact page andnode -c — no SyntaxError.
/artifact/<any-id>, click Discussion / Provenance /