Skip to content

NIHTB-CB - List Sorting Working Memory Task Implementation#34

Open
cherriechang wants to merge 43 commits into
mainfrom
nihtb-cb_lswm
Open

NIHTB-CB - List Sorting Working Memory Task Implementation#34
cherriechang wants to merge 43 commits into
mainfrom
nihtb-cb_lswm

Conversation

@cherriechang
Copy link
Copy Markdown
Collaborator

This PR is to implement and add the List Sorting Working Memory task in the NIH Toolbox Cognition Battery as an individual jsPsych experiment package under packages. The implementation must follow the latest standardization framework detailed in the timelines template in jspsych-dev.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 31, 2025

🦋 Changeset detected

Latest commit: af5a11b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@jspsych-timelines/list-sorting-working-memory Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cherriechang cherriechang linked an issue Apr 21, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator Author

@cherriechang cherriechang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed changes: add list-sorting-working-memory as package; delete templates folder

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the List Sorting Working Memory task package by introducing inline SVG assets for animal images.

  • Adds new SVG exports for turtle, tiger, sheep, and rabbit under images-animals
  • Each file defines an export const ...Svg template literal containing the full SVG markup

Reviewed Changes

Copilot reviewed 22 out of 134 changed files in this pull request and generated no comments.

File Description
packages/list-sorting-working-memory/assets/images/images-animals/turtle.js Adds turtleSvg inline SVG export
packages/list-sorting-working-memory/assets/images/images-animals/tiger.js Adds tigerSvg inline SVG export
packages/list-sorting-working-memory/assets/images/images-animals/sheep.js Adds sheepSvg inline SVG export
packages/list-sorting-working-memory/assets/images/images-animals/rabbit.js Adds rabbitSvg inline SVG export
Comments suppressed due to low confidence (4)

packages/list-sorting-working-memory/assets/images/images-animals/turtle.js:1

  • [nitpick] Embedding very large SVG strings directly in JS files can increase bundle size and reduce readability. Consider storing these SVGs as separate .svg files and importing them at runtime or using a loader.
export const turtleSvg = `<?xml version="1.0" encoding="UTF-8"?>

packages/list-sorting-working-memory/assets/images/images-animals/tiger.js:1

  • [nitpick] Consider moving this inline SVG into an external asset and importing it to keep the JS module concise and improve load performance.
export const tigerSvg = `<?xml version="1.0" encoding="UTF-8"?>

packages/list-sorting-working-memory/assets/images/images-animals/sheep.js:1

  • [nitpick] Large template literals make the code hard to scan. Extract this SVG into its own file and reference it to improve maintainability.
export const sheepSvg = `<?xml version="1.0" encoding="UTF-8"?>

packages/list-sorting-working-memory/assets/images/images-animals/rabbit.js:1

  • [nitpick] Inlining the SVG in JS bloats the module. You could load the SVG via a fetch or import an .svg asset to keep the JS file focused on logic.
export const rabbitSvg = `<?xml version="1.0" encoding="UTF-8"?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build List Sorting Working Memory Test

2 participants