You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We reviewed changes in 376faac...8ef8530 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected function declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable
It is considered a best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script. Global variables created from a script can produce name collisions with global variables created from another script, which will usually lead to runtime errors or unexpected behavior. It is mostly useful for browser scripts.
The reason will be displayed to describe this comment to others. Learn more.
`PasswordInput` has a cyclomatic complexity of 7 with "medium" risk
A function with high cyclomatic complexity can be hard to understand and
maintain. Cyclomatic complexity is a software metric that measures the number of
independent paths through a function. A higher cyclomatic complexity indicates
that the function has more decision points and is more complex.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected function declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable
It is considered a best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script. Global variables created from a script can produce name collisions with global variables created from another script, which will usually lead to runtime errors or unexpected behavior. It is mostly useful for browser scripts.
CopilotAI
changed the title
[WIP] Add caps lock indicator for password input field
Add floating Caps Lock warning for password inputs on login flows
Mar 31, 2026
The reason will be displayed to describe this comment to others. Learn more.
Clear stale Caps Lock state on blur
isCapsLockOn is only updated from keyboard events while the input is focused, so if a user turns Caps Lock off after leaving the field and then refocuses it, the banner can still appear even though Caps Lock is actually off. This creates a false warning on login flows and is reproducible whenever Caps Lock is toggled while the password field is unfocused; resetting or re-evaluating the state on blur/focus would prevent the stale indicator.
@copilot isCapsLockOn is only updated from keyboard events while the input is focused, so if a user turns Caps Lock off after leaving the field and then refocuses it, the banner can still appear even though Caps Lock is actually off. This creates a false warning on login flows and is reproducible whenever Caps Lock is toggled while the password field is unfocused; resetting or re-evaluating the state on blur/focus would prevent the stale indicator.
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a global, floating Caps Lock warning for password inputs (styled similarly to the existing StaleBanner) to reduce login-password entry mistakes, using a createPortal(..., document.body) fixed-position banner that doesn’t affect layout or block form interaction.
Changes:
Add Caps Lock detection + focus tracking to PasswordInput and render a fixed, non-interactive warning banner via portal.
Update staticAssets.ts asset version/URLs (cache-busting) as part of the committed generated assets module.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File
Description
frontend/src/components/ui/PasswordInput.tsx
Adds Caps Lock state tracking and a fixed, top-of-screen portal warning banner with ARIA live-region attributes.
frontend/src/lib/staticAssets.ts
Updates the committed generated lib-asset version and versioned URLs.
The reason will be displayed to describe this comment to others. Learn more.
This PR modifies staticAssets.ts (RDKit/font cache-busting version + URLs), but the PR description says the change scope is only PasswordInput.tsx. If this version bump isn’t intentional, consider reverting it to avoid unnecessary cache invalidation and unrelated diffs; if it is intentional, please reflect it in the PR description.
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="frontend/src/components/ui/PasswordInput.tsx">
<violation number="1" location="frontend/src/components/ui/PasswordInput.tsx:48">
P2: Reset Caps Lock state on blur to prevent a stale warning from appearing when the input is refocused after Caps Lock is toggled while unfocused.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
The reason will be displayed to describe this comment to others. Learn more.
Unexpected function declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable
It is considered a best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script. Global variables created from a script can produce name collisions with global variables created from another script, which will usually lead to runtime errors or unexpected behavior. It is mostly useful for browser scripts.
@copilot isCapsLockOn is only updated from keyboard events while the input is focused, so if a user turns Caps Lock off after leaving the field and then refocuses it, the banner can still appear even ...
The reason will be displayed to describe this comment to others. Learn more.
Unexpected function declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable
It is considered a best practice to avoid 'polluting' the global scope with variables that are intended to be local to the script. Global variables created from a script can produce name collisions with global variables created from another script, which will usually lead to runtime errors or unexpected behavior. It is mostly useful for browser scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
登录页密码输入缺少大写锁定提示,容易导致误输。该变更为密码输入增加了与现有 stale banner 风格一致的提示,并以绝对悬浮方式展示,不参与容器布局且不遮挡表单。
改动范围
frontend/src/components/ui/PasswordInput.tsx交互与展示
CapsLock开启时显示提示:大写锁定已开启createPortal(..., document.body)渲染到页面根部fixed顶部居中悬浮层 +pointer-events-none,避免影响表单交互与布局流样式对齐(参考 StaleBanner)
可访问性
role="status"、aria-live="polite"、aria-atomic="true",在状态出现时可被读屏感知核心实现片段
Original prompt