Repository navigation
CODAP-1418: onboarding title and reliable "make a table" detection on touch - #159
Merged
Merged
Conversation
…(CODAP-1418)
Touch-device onboarding pre-loads its dataset via dataContextFromURL. Now that
v3 no longer auto-opens a case table for that request:
- Pass an explicit `title` so the dataset reads "Mammals" (and "NHANES" for
onboarding2) when the student opens the table; add the title strings (en/es).
- Fix a comma-operator bug in the "make a table" detection: the condition
`(type === 'caseTable', !isAccomplished('Drag'))` discarded the type check, so
any non-graph component create (e.g. a slider) falsely completed the task, and
'caseTable' was the wrong type anyway. Mirror the graph line instead:
`else if (type === 'table') handleAccomplishment('MakeTable', !isAccomplished('Drag'))`
— create notifications carry type 'table' in both v2 and v3.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the onboarding plugin to better support CODAP v3 touch onboarding by ensuring loaded datasets get a user-facing title and by correcting the logic that detects when the user creates a table component.
Changes:
- Adds localized dataset/table titles (en/es) for Mammals and NHANES.
- Passes an explicit
titlein thedataContextFromURLcreate request so the data context/table displays the desired name. - Fixes “make a table” task completion logic by removing the comma-operator bug and matching the correct create-notification
type.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| onboarding/target/strings.json | Adds new localized keys for table/data context titles (en/es). |
| onboarding/target/onboarding.js | Fixes table-create detection and sends title with dataContextFromURL. |
| onboarding/source/strings.json | Mirrors the new localized title keys in the source strings file. |
| onboarding/source/js/onboarding.js | Mirrors the notification fix and dataContextFromURL title addition in source JS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Companion to the v3 PR in concord-consortium/codap. Touch-device onboarding pre-loads
its dataset via
dataContextFromURL. Now that v3 no longer auto-opens a case table forthat request:
titlein thedataContextFromURLrequest so the dataset reads"Mammals" (and "NHANES" for onboarding2) when the student opens the table. Adds the
title strings (en/es).
(type === 'caseTable', !isAccomplished('Drag'))used the comma operator, discardingthe type check, so any non-graph component create (e.g. adding a slider) falsely
completed the task; and
'caseTable'was the wrong type anyway (create notificationscarry
'table'in both v2 and v3). Now mirrors the graph line:else if (type === 'table') handleAccomplishment('MakeTable', !isAccomplished('Drag')).Dependency
Requires the companion v3 changes (the
titlehandling ondataContextFromURL, and thecomponent
createnotification when opening a table). Without them, the title won't applyand "make a table" won't complete.
Deferred follow-up
The plugin's touch detection
hasMouse = !('ontouchstart' in window)is brittle — itover-reports touch on mouse-capable devices (touchscreen laptops, hybrids, some Chrome
configs), which routes them to the touch onboarding flow. Left unchanged here. A future
fix could use
window.matchMedia('(any-pointer: fine)').matches, which maps more closelyto "has a precise pointer that can drag": finger-only iPad → false, iPad with
trackpad/Pencil → true, touchscreen laptop → true.
Deployment
After merge, the rebuilt plugin must be synced to
s3://codap-resources/plugins/onboarding/(build-and-manual-copy:npm run clean && npm run buildinonboarding/, thenaws s3 sync+ CloudFront invalidation). Mergingdoes not deploy it.
Relates to CODAP-1418.
🤖 Generated with Claude Code