Files
metabuilder/qml/MetaBuilder/CCreateSchemaDialog.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

103 lines
3.3 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
CDialog {
id: dlg
objectName: "dialog_create_schema"
Accessible.role: Accessible.Dialog
Accessible.name: title
activeFocusOnTab: true
title: "Create New Schema"
property string schemaName: ""
property string schemaDescription: ""
signal createRequested(
string name, string description)
signal cancelled()
ColumnLayout {
spacing: 16; width: 360
CTextField {
label: "Schema Name"
placeholderText: "e.g. Invoice"
text: dlg.schemaName
Layout.fillWidth: true
activeFocusOnTab: true
Accessible.role: Accessible.EditableText
Accessible.name: "Schema Name"
onTextChanged:
dlg.schemaName = text
}
CTextField {
label: "Description"
placeholderText: "Brief description"
+ " of this schema"
text: dlg.schemaDescription
Layout.fillWidth: true
activeFocusOnTab: true
Accessible.role: Accessible.EditableText
Accessible.name: "Schema Description"
onTextChanged:
dlg.schemaDescription = text
}
FlexRow {
Layout.fillWidth: true; spacing: 12
Item { Layout.fillWidth: true }
CButton {
text: "Cancel"
variant: "ghost"
activeFocusOnTab: true
Accessible.role: Accessible.Button
Accessible.name: "Cancel"
Keys.onReturnPressed: {
dlg.schemaName = ""
dlg.schemaDescription = ""
cancelled()
}
Keys.onSpacePressed: {
dlg.schemaName = ""
dlg.schemaDescription = ""
cancelled()
}
onClicked: {
dlg.schemaName = ""
dlg.schemaDescription = ""
cancelled()
}
}
CButton {
text: "Create"
variant: "primary"
enabled:
dlg.schemaName.trim() !== ""
activeFocusOnTab: true
Accessible.role: Accessible.Button
Accessible.name: "Create schema"
Keys.onReturnPressed: {
if (!enabled) return
createRequested(
dlg.schemaName,
dlg.schemaDescription)
dlg.schemaName = ""
dlg.schemaDescription = ""
}
Keys.onSpacePressed: {
if (!enabled) return
createRequested(
dlg.schemaName,
dlg.schemaDescription)
dlg.schemaName = ""
dlg.schemaDescription = ""
}
onClicked: {
createRequested(
dlg.schemaName,
dlg.schemaDescription)
dlg.schemaName = ""
dlg.schemaDescription = ""
}
}
}
}
}