Skip to content

Changes related to form field label#11

Draft
subodh2711 wants to merge 6 commits into
devfrom
feature/hdfc-form-selector-dump
Draft

Changes related to form field label#11
subodh2711 wants to merge 6 commits into
devfrom
feature/hdfc-form-selector-dump

Conversation

@subodh2711
Copy link
Copy Markdown
Collaborator

@subodh2711 subodh2711 commented Jan 14, 2026

@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Jan 14, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync
Copy link
Copy Markdown

aem-code-sync Bot commented Jan 14, 2026

Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@subodh2711 subodh2711 requested a review from vdua January 14, 2026 15:36
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @subodh2711, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new web component designed to display and analyze form field click data, seamlessly integrating it into the existing performance dashboard. It also includes a comprehensive set of pre-extracted form selector metadata for various online forms, enhancing the dashboard's ability to provide granular insights into user interactions.

Highlights

  • New Web Component: A SelectorClickTable web component has been added to visualize click counts for form selectors, providing insights into user interaction with form fields.
  • Performance Dashboard Integration: The new SelectorClickTable component is integrated into the existing performance dashboard, allowing for dynamic display and filtering of form click data based on URL and other criteria.
  • Extensive Form Selector Data: A large collection of JSON files containing detailed selector metadata for numerous HDFC Bank online forms (e.g., credit card applications, loan forms, savings accounts) has been added, enabling the new component to map raw click targets to meaningful labels.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@subodh2711
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new SelectorClickTable web component, designed to display click counts per form selector, mapped to labels using pre-extracted metadata. The component is integrated into the PerformanceDashboard, which now imports and renders the table, passing filtered RUM event data and the current URL for processing. The SelectorClickTable handles data loading, normalization, filtering, sorting, and HTML escaping for display. Review comments highlight potential issues with the SelectorClickTable using static properties for caching, which could lead to unintended shared state across multiple instances. Additionally, a console.warn statement is disabled, potentially hindering debugging, and the JSON data for selectors contains HTML tags in label fields that are currently rendered as literal text due to HTML escaping, prompting a need to clarify the intended rendering behavior or data format.

Comment thread charts/selector-click-table.js Outdated
Comment thread charts/selector-click-table.js Outdated
Comment thread formsJson/by-url/110c1293.selectors.json
Comment thread formsJson/by-url/28469e94.selectors.json
Comment thread formsJson/by-url/4604bfa9.selectors.json
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new web component, selector-click-table, to display selector click counts with associated labels, and integrates it into the performance dashboard. The implementation is solid, with good use of caching and modern JavaScript features.

My review focuses on improving the maintainability and correctness of the new component. I've identified a potential issue with how selector-to-label mappings are created, which might lead to less descriptive labels being used. I've also suggested a couple of refactoring opportunities to reduce code duplication and improve code structure.

The changes in performance-dashboard.js to integrate the new component are well-implemented and follow existing patterns. The addition of new JSON data files seems correct for the feature.

Comment on lines +379 to +387
selectorRows.forEach((r) => {
const keys = SelectorClickTable.selectorKeysForRow(r.selector);
keys.forEach((k) => {
if (!knownKeySet.has(k)) {
knownKeySet.add(k);
keyToRow.set(k, r);
}
});
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The current logic for building the keyToRow map uses a "first-seen key wins" strategy. This could be problematic if a row with a generic or empty label is processed before a row with a more descriptive label for the same element. Consider refining this logic to prioritize rows with better labels, for example, by overwriting an existing entry if the new row has a label and the existing one doesn't. This would make the mapping more robust.

Here's a potential alternative implementation:

    const keyToRow = new Map();
    selectorRows.forEach((r) => {
      const keys = SelectorClickTable.selectorKeysForRow(r.selector);
      keys.forEach((k) => {
        const existingRow = keyToRow.get(k);
        // Prefer rows with labels over those without.
        if (!existingRow || (!existingRow.label && r.label)) {
          keyToRow.set(k, r);
        }
      });
    });

Comment thread charts/selector-click-table.js Outdated
Comment thread charts/selector-click-table.js Outdated
@vdua vdua marked this pull request as draft February 24, 2026 09:35
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.

2 participants