Skip to content

[APP-1843][1845] fix issue with draft page url, prevent error for gradient #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 6, 2025

Conversation

DinetsV
Copy link
Contributor

@DinetsV DinetsV commented Aug 6, 2025

✨ PR Description

Purpose: Fix URL handling for draft pages and add support for gradient elements in color contrast accessibility tool.
Main changes:

  • Modified draft URL handling to correctly check post status instead of queried object
  • Added conditional UI for gradient elements with appropriate guidance text when color inputs are unavailable
  • Extended analytics tracking to distinguish between regular and gradient color contrast scenarios

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀

This comment has been minimized.

gitstream-cm[bot]

This comment was marked as resolved.

@DinetsV DinetsV changed the title [APP-1843] fix issue with draft page url [APP-1843][1845] fix issue with draft page url, prevent error for gradient Aug 6, 2025
Copy link
Contributor

@gitstream-cm gitstream-cm bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

The PR adds gradient support with conditional UI rendering, but introduces potential runtime errors due to missing array bounds validation and null checks.

3 issues detected:

🐞 Bug - Accessing array indices without bounds validation can lead to undefined values and runtime errors.

Details: The code accesses messageArgs array indices without validating that the array contains enough elements. This could cause undefined behavior when messageArgs has fewer than 5 elements.
File: modules/scanner/assets/js/components/color-contrast-form/index.js (41-41)

🐞 Bug - Calling functions with potentially null/undefined parameters can cause runtime errors.

Details: The isLargeText function is called with item.node without null checking, which could cause errors if the node is null or undefined.
File: modules/scanner/assets/js/components/color-contrast-form/index.js (43-43)

🐞 Bug - Array access without bounds checking can result in undefined values being used in conditional logic.

Details: The scenario determination logic accesses messageArgs array indices without bounds checking, which could lead to inconsistent behavior when the array is shorter than expected.
File: modules/scanner/assets/js/layouts/color-contrast-layout.js (34-37)

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using. We'd love your feedback! 🚀

@DinetsV DinetsV merged commit 51e588e into develop Aug 6, 2025
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants