Conversation
- Zero tick mark always appears when min < 0 and max > 0 - Zero tick has bold styling even when not part of regular tick spacing - Zero label only shows when zero falls on regular tick spacing - Added Cypress tests for zero tick behavior
…bility with ARIA labels.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2722 +/- ##
==========================================
- Coverage 86.78% 86.23% -0.56%
==========================================
Files 811 811
Lines 43429 43529 +100
Branches 11115 11144 +29
==========================================
- Hits 37689 37536 -153
- Misses 5408 5655 +247
- Partials 332 338 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
collaborative-learning
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Project |
collaborative-learning
|
| Branch Review |
numberlineClaud
|
| Run status |
|
| Run duration | 48m 38s |
| Commit |
|
| Committer | lbondaryk |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
1
|
|
|
4
|
|
|
4
|
|
|
0
|
|
|
149
|
| View all changes introduced in this branch ↗︎ | |
Tests for review
cypress/e2e/functional/tile_tests/numberline_tool_spec.js • 1 failed test • Regression tests
| Test | Artifacts | |
|---|---|---|
| Numberline Tile > Numberline Tile |
Test Replay
Screenshots
|
|
xy_plot_tool_spec.js • 2 flaky tests • Regression tests
| Test | Artifacts | |
|---|---|---|
| XYPlot Tool Tile > XYPlot Tool > XYPlot tool tile |
Test Replay
Screenshots
|
|
| XYPlot Tool Tile > XYPlot Tool > Test duplicating graph with an xy-plot (a.k.a. graph) |
Test Replay
Screenshots
|
|
arrow_annotation_spec.js • 1 flaky test • Regression tests
| Test | Artifacts | |
|---|---|---|
| Arrow Annotations (Sparrows) > can add arrows to xy plot tiles |
Test Replay
Screenshots
|
|
geometry_tool_spec.js • 1 flaky test • Regression tests
| Test | Artifacts | |
|---|---|---|
| Geometry Tool > works in all four modes |
Test Replay
Screenshots
|
|
There was a problem hiding this comment.
The biggest issue here is that the cypress test is failing. The first new test is failing, so it's very possible multiple tests are failing afterwards.
But there are a lot of places where this should be adjusted. Part of the issue is that the nummberline tile is not very well structured to begin with, so building on top of it is going to exacerbate the mess. But also the AI seems to not understand how to keep things efficient, or separate new functionality between the model and component.
Looking over this, I feel like there are some easy, generic additions we could use for all CLUE prompts to improve the resulting code, such as "use variables defined in vars.scss rather than hard-coded color values whenever possible" and "make sure lines are limited to 121 characters at most".
| cy.get(".numberline-wrapper").click().type('{tab}'); | ||
| numberlineToolTile.getValueLabel().should("exist"); |
There was a problem hiding this comment.
| cy.get(".numberline-wrapper").click().type('{tab}'); | |
| numberlineToolTile.getValueLabel().should("exist"); | |
| cy.get(".numberline-wrapper").click().type('{tab}'); | |
| numberlineToolTile.getValueLabel().should("exist"); | |
| numberlineToolTile.getValueLabelText().should("contain", "-2.00"); |
| // Zero tick should exist even if not in regular spacing | ||
| cy.get(".numberline-tool-container .zero-tick").should("exist"); | ||
| // Zero should not have a label since it's not part of regular tick spacing | ||
| numberlineToolTile.getAllNumberlineTicks().should('not.contain', '0'); |
There was a problem hiding this comment.
The cypress test is failing here, so nothing below is actually being run at this point.
| cy.log("will edit min value with keyboard"); | ||
| // Click to show input | ||
| numberlineToolTile.getMinBox().click(); | ||
| numberlineToolTile.getMinBoxInput().should('exist'); | ||
| numberlineToolTile.getMinBoxInput().clear().type('-8{enter}'); | ||
| numberlineToolTile.getMinBox().should('contain', '-8'); | ||
|
|
||
| cy.log("will edit max value with keyboard"); | ||
| // Click to show input | ||
| numberlineToolTile.getMaxBox().click(); | ||
| numberlineToolTile.getMaxBoxInput().should('exist'); | ||
| numberlineToolTile.getMaxBoxInput().clear().type('8{enter}'); | ||
| numberlineToolTile.getMaxBox().should('contain', '8'); |
There was a problem hiding this comment.
Are these tests redundant, since the range is already being changed above (like on lines 49 and 50)?
| onFocus={handleFocus} | ||
| tabIndex={readOnly ? -1 : 0} | ||
| role="button" | ||
| aria-label={`${minOrMax === "min" ? "Minimum" : "Maximum"} value: ${value}. ${readOnly ? "" : "Press Enter to edit."}`} |
There was a problem hiding this comment.
Define const minOrMaxWord = minOrMax === "min" ? "Minimum" : "Maximum"; above, then use it here to make this line below the max length. You can also use minOrMaxWord on line 110 below.
|
|
||
| .point-value-label-bg { | ||
| fill: $workspace-teal-light-8; | ||
| stroke: #949494; |
There was a problem hiding this comment.
| stroke: #949494; | |
| stroke: $charcoal-light-1; |
| .attr("rx", 10) | ||
| .attr("ry", 10); |
There was a problem hiding this comment.
A constant should be used instead of hard coded 10 here.
| .attr("stroke", "#949494") | ||
| .attr("stroke-width", 1.5) | ||
| .style("pointer-events", "none"); |
There was a problem hiding this comment.
Could these be defined in css instead?
| it("only allows one selected point at a time", () => { | ||
| const content = NumberlineContentModel.create(); | ||
| const point1 = content.createAndSelectPoint(1.0, false); | ||
| const point2 = content.createAndSelectPoint(3.0, false); | ||
|
|
||
| expect(content.points.size).toBe(2); | ||
| expect(content.selectedPoints[point1.id]).toBeUndefined(); | ||
| expect(content.selectedPoints[point2.id]).toBe(point2); | ||
| expect(Object.keys(content.selectedPoints).length).toBe(1); | ||
| }); |
There was a problem hiding this comment.
If we only want a single point to be selectable at a time, we should just take out the infrastructure that supports multiple points being selected.
|
|
||
| it("clears all selected points", () => { | ||
| const content = NumberlineContentModel.create(); | ||
| const point = content.createAndSelectPoint(2.0, false); |
There was a problem hiding this comment.
| const point = content.createAndSelectPoint(2.0, false); | |
| const _point = content.createAndSelectPoint(2.0, false); |
To avoid a lint warning.
| it("can select points in order by position", () => { | ||
| const content = NumberlineContentModel.create(); | ||
| const pointA = content.createNewPoint(3.0, false); | ||
| const pointB = content.createNewPoint(-2.0, false); | ||
| const pointC = content.createNewPoint(1.0, false); | ||
|
|
||
| // Points sorted by xValue: B(-2), C(1), A(3) | ||
| const sortedPoints = content.pointsArr.slice().sort((a, b) => a.xValue - b.xValue); | ||
| expect(sortedPoints[0].id).toBe(pointB.id); | ||
| expect(sortedPoints[1].id).toBe(pointC.id); | ||
| expect(sortedPoints[2].id).toBe(pointA.id); | ||
| }); |
There was a problem hiding this comment.
This test isn't particularly useful. Once sortedPointsArr (or something similar) is added to NumberlineContentModel, it will make sense to test that.
- Fix Cypress tests: use exact equality checks, add missing assertions, remove redundant tests - Replace hard-coded colors with vars.scss variables for consistency - Fix lines exceeding 121 character limit by extracting repeated strings into variables - Move logic to model layer: add sortedPointsArr, selectedPointsArr, and firstSelectedPoint views - Improve efficiency: combine tick generation into single O(n) pass, eliminate redundant sorting - Remove duplicate keyboard event handlers (HotKeys vs D3 handlers) - Support moving all selected points with arrow keys (future-proofing for multi-select) - Add kValueLabelBorderRadius constant, move inline styles to CSS Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Values very close to zero (between -0.005 and 0.005) now display as "0.00" instead of potentially showing "-0.00". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Scoped .numberline-wrapper selector to .primary-workspace to ensure only one element is matched when clicking/typing on the tile. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This adds point value labels to the numberline when points are selected. Labels update when points are dragged and disappear when points are deselected. Some accessibility has been applied in terms of implementing tabbing through fields in the numberline tile.