Skip to content

Conversation

@arman-boyakhchyan
Copy link
Contributor

No description provided.

Copy link

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 pull request updates the ComponentList application to support dynamic framework-specific styling based on the user's framework preference stored in localStorage. The changes enable the component list page to display framework-appropriate link colors and theme-aware background colors.

  • Adds JavaScript to dynamically apply framework class to body element
  • Introduces CSS rules for theme-aware background colors using light-dark() function
  • Defines framework-specific link colors for jQuery, Angular, Vue, and React

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

File Description
applications/ComponentList/index.js Adds framework class from localStorage to body element for dynamic styling
applications/ComponentList/index.css Adds base body styles with light-dark theme support and framework-specific link color rules

@@ -0,0 +1 @@
document.body.classList.add(localStorage.getItem('dx-devextreme-site-framework'));
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The code directly adds the value from localStorage to classList without any validation or null checking. If the localStorage key does not exist, getItem returns null, which could cause classList.add to add the string "null" as a class name. Consider adding a guard to check if the value exists before adding it to the classList.

Suggested change
document.body.classList.add(localStorage.getItem('dx-devextreme-site-framework'));
const frameworkClass = localStorage.getItem('dx-devextreme-site-framework');
if (frameworkClass) {
document.body.classList.add(frameworkClass);
}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@
document.body.classList.add(localStorage.getItem('dx-devextreme-site-framework'));
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The code adds an untrusted value from localStorage directly to the classList without sanitization. While the CSS only defines specific framework classes (jQuery, Angular, Vue, React), a malicious value could inject arbitrary class names. Consider validating the value against an allowlist of expected framework names before adding it to classList.

Suggested change
document.body.classList.add(localStorage.getItem('dx-devextreme-site-framework'));
var framework = localStorage.getItem('dx-devextreme-site-framework');
var allowedFrameworks = ['jquery', 'angular', 'vue', 'react'];
if (framework && allowedFrameworks.indexOf(framework) !== -1) {
document.body.classList.add(framework);
}

Copilot uses AI. Check for mistakes.
@arman-boyakhchyan arman-boyakhchyan merged commit b58e70d into DevExpress:26_1 Jan 7, 2026
12 checks passed
@arman-boyakhchyan arman-boyakhchyan deleted the components-list-update-26-1 branch January 7, 2026 12:26
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