Repository navigation
Dataset page: AI Mode pill in the ActionBar (E6.2) - #521
Merged
Merged
Conversation
Deploying nemar-website with
|
| Latest commit: |
9e50dce
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4ca7f30f.nemar-website.pages.dev |
| Branch Preview URL: | https://feature-issue-517-ai-mode-pi.nemar-website.pages.dev |
…pe dismisses the hint; anchor source tests on elements (tested)
Contributor
Author
Review round 1: outcomesFix commits are on this branch (456bc6c, c0f91fd and the two before).
|
…he key is unconsumed; dismissal keeps focus on the pill (tested)
Contributor
Author
|
Review round 2 outcomes (fix commits bc11d6a and 7898222 on this branch; `bun run test` 4692 passed, `bun run lint` and `bun run typecheck` clean):
|
# Conflicts: # CHANGELOG.md
This was referenced Nov 11, 2026
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.
Summary
Adds the "AI Mode" pill to the dataset page ActionBar, directly after Download (board C1, E6.2).
It opens the Open Science Assistant widget as its centre-stage dialog with
OSAChatWidget.open({ mode: "center" })..action; brand teal (--brand-teal, #5bbad5) fill and border, #04121f text (new--on-tealtoken), weight 600, one 16 px sparkle (aria-hidden), hover a slightly darker teal, focus ring kept.hidden; revealed only whenwindow.OSAChatWidget.openis a function once the widget script has run. A build with noPUBLIC_OSA_*variables, a blocked widget script, and production's older pinned widget (noopen()) keep it hidden. The wrapper ships hidden and is revealed with the pill, so the row gets no extra gap.role="note", absolute, no layout shift): copy from the board, "How it works" link todocs.nemar.org/web/analyze-in-browser/(newDOCS_ANALYZE_IN_BROWSER_PATH, built withresolveDocsBase), and "Got it". Dismissed by Got it, by using the pill, by following the link, and by Escape while focus is on the pill or in the hint; remembered inlocalStoragekeynemar:ai-mode-hint:v1, with every read and write guarded (a blocked store means once per page load).position: relativewrapper around the pill, and the script keeps it inside the viewport with a 16 px gutter (pureplaceAiModeHint), so it still works when the row wraps on a phone. Its colours are tokens (--ai-hint-*) with a dark counterpart in both dark blocks oftokens.css.src/lib/osa-ai-mode.ts;osa-widget.tsis untouched and the widget pin is not bumped.vitest.config.tsletstokens.cssthroughcss.include(as it already did foreeg-viewer.css) so the token test can read it.Part of OpenScience-Collective/osa#652, refs #517
Commands run
Dev server against the real develop widget and staging data,
localhost:4321/dataset/xx099904withPUBLIC_API_BASE_URL=https://api-test.nemar.org,PUBLIC_DATA_BASE_URL=https://data-test.nemar.org,PUBLIC_ZARR_BASE_URL=https://zarr-test.nemar.org,PUBLIC_OSA_WIDGET_SRC=...@develop/frontend/osa-chat-widget.js,PUBLIC_OSA_API_ENDPOINT=https://develop-widget.osc.earth/osa,PUBLIC_OSA_NOTEBOOK_URL=https://develop-notebook.osc.earth/osa/(checked in Chrome):rgb(91, 186, 213)fill and border,rgb(4, 18, 31)text, weight 600, 14 px.role="note", linkhttps://docs.nemar.org/web/analyze-in-browser/).role="dialog", classosa-center, named "AI Mode for xx099904"; the hint is dismissed andnemar:ai-mode-hint:v1is stored.display: none, row unchanged.test.nemar.org(needs a merge by someone else; confirm viacurl -s https://test.nemar.org/version.json).Screenshots (taken after review round 1, from the dev server above; hosted on the
pr-521-screenshotsbranch, outside this PR's diff; keep that branch until the images are no longer needed, because deleting it breaks the three images below):Light, 1280 px:
Dark, 1280 px:
390 px wide (row wrapped, hint shifted inside the 16 px gutters, no horizontal scroll):
Notes for review
readyStateis notloading". In a real browser the ActionBar module script runs atinteractive, before the widget's deferred classic script, so that rule hid the pill on every load (found on the dev server).whenDocumentReadynow runs at once only whenreadyStateiscomplete; otherwise it waits forDOMContentLoaded, withloadas the fallback for a script that runs afterDOMContentLoadedalready fired. Both orderings are tested..action's label is--fs-sm(14 px), not 15 px as the task text said; the pill keeps the shared 14 px.