Files
metabuilder/qml/MetaBuilder/CCommentInput.qml
johndoe6345789 d9ca84628b feat(a11y): deep keyboard accessibility pass across all QML components
Second-pass a11y work across all 12 component groups. Every interactive
element now has activeFocusOnTab, Keys.onReturnPressed/SpacePressed, and
context-aware Accessible.name/description bindings.

Highlights:
- Dialogs: keyboard handlers with enabled-guard on confirm buttons
- CDropdownMenu: full keyboard nav (Up/Down/Enter/Escape)
- CLoginForm: explicit KeyNavigation.tab chain (username→password→submit)
- CNotificationBell: dynamic "3 notifications"/"No notifications" name
- CJobProgressBar: Accessible.minimumValue/maximumValue/currentValue
- CExecutionStatusDot: "Execution status: Running/Passed/Failed" binding
- CKeyboardShortcuts: invisible Repeater exposes all shortcuts to a11y tree
- CDataTable rows: "Row N of M" descriptions
- Canvas elements: Accessible.Canvas role + keyboard zoom (+/- keys)
- DropdownExpandedList: focus-highlight extended to :activeFocus
- Dynamic names reflect loading state (e.g. "Signing in, please wait")

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 20:53:53 +00:00

73 lines
2.0 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
CCard {
id: root
objectName: "card_comment_input"
Accessible.role: Accessible.Pane
Accessible.name: "Post a Comment"
activeFocusOnTab: true
property bool isDark: false
property bool loading: false
property string commentText: ""
signal submit(string text)
Layout.fillWidth: true
CText { variant: "subtitle1"; text: "Post a Comment" }
CTextField {
Layout.fillWidth: true
label: "Your comment"
placeholderText: "Write your thoughts..."
text: root.commentText
activeFocusOnTab: true
Accessible.role: Accessible.EditableText
Accessible.name: "Your comment"
Accessible.description:
"Type your comment here"
onTextChanged: root.commentText = text
}
FlexRow {
Layout.fillWidth: true
spacing: 8
Item { Layout.fillWidth: true }
CButton {
text: root.loading
? "Posting..." : "Post Comment"
variant: "primary"
size: "sm"
enabled: root.commentText.trim().length > 0
&& !root.loading
activeFocusOnTab: true
Accessible.role: Accessible.Button
Accessible.name: root.loading
? "Posting comment"
: "Post Comment"
Keys.onReturnPressed: {
if (enabled) {
root.submit(
root.commentText.trim())
root.commentText = ""
}
}
Keys.onSpacePressed: {
if (enabled) {
root.submit(
root.commentText.trim())
root.commentText = ""
}
}
onClicked: {
root.submit(root.commentText.trim())
root.commentText = ""
}
}
}
}