Copilot commented on code in PR #8250:
URL: https://github.com/apache/cloudstack/pull/8250#discussion_r3767972031
##########
ui/src/views/AutogenView.vue:
##########
@@ -37,6 +37,8 @@
style="margin-bottom: 5px"
shape="round"
size="small"
+ v-shortkey="['r']"
+ @shortkey="fetchData({ irefresh: true })"
Review Comment:
This introduces new keyboard-driven behavior for AutogenView, but the
existing unit tests for this view don’t cover triggering refresh via the
shortcut (or verifying it does not trigger while typing in editable controls).
Adding a unit test would help prevent regressions and validate the shortcut
configuration.
##########
ui/src/views/AutogenView.vue:
##########
@@ -37,6 +37,8 @@
style="margin-bottom: 5px"
shape="round"
size="small"
+ v-shortkey="['r']"
+ @shortkey="fetchData({ irefresh: true })"
@click="fetchData({ irefresh: true })"
Review Comment:
Using a single-character keyboard shortcut ("r") for a global action can
violate WCAG 2.1.4 (Character Key Shortcuts), because it can be triggered
unintentionally (e.g., speech input) unless it’s remappable/disableable or
requires a modifier key, or is only active when the control has focus. Consider
changing this to a modifier-based shortcut (and optionally exposing it via
aria-keyshortcuts / UI hint) to avoid accessibility regressions.
##########
ui/src/main.js:
##########
@@ -67,6 +67,7 @@ vueApp.use(extensionsUtilPlugin)
vueApp.use(backupUtilPlugin)
vueApp.use(extensions)
vueApp.use(directives)
+vueApp.use(require('vue3-shortkey'), { prevent: ['input', 'textarea'] })
Review Comment:
main.js is written as an ES module (imports throughout), but this adds a
CommonJS require() call. This is inconsistent with the surrounding module style
and can be brittle depending on how vue3-shortkey exports its plugin (CommonJS
vs. default export). Prefer importing the plugin at the top and passing the
imported value to vueApp.use(...).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]