Files
metabuilder/qml/MetaBuilder/UserTableRow.qml
johndoe6345789 491c4cffed refactor(qt6): push for sub-100 LOC — JS modules, JSON configs, compact formatting
WorkflowEditor (325→80): CWorkflowState.qml + WorkflowConnectionState.js
DashboardView (121→95): DashboardDBAL.js + config/dashboard-config.json
Storybook (114→78): StorybookSidebar + config/storybook-components.json
+ 7 components compacted to under 100 via formatting (no logic changes)
+ Multiple view/component splits across all remaining 100+ LOC files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 14:58:28 +00:00

78 lines
2.4 KiB
QML

import QtQuick
import QtQuick.Layouts
import QmlComponents 1.0
Rectangle {
id: root
required property var modelData
required property int index
signal editClicked(int uid)
signal deleteClicked(int uid)
function roleColor(role) {
if (role === "supergod") return "#e040fb"
if (role === "god") return "#ff9800"
if (role === "admin") return "#2196f3"
return "#4caf50"
}
function statusString(s) { return s === "active" ? "success" : "warning" }
height: 56
color: index % 2 === 0 ? "transparent" : Qt.rgba(Theme.surface.r, Theme.surface.g, Theme.surface.b, 0.3)
RowLayout {
anchors.fill: parent
anchors.leftMargin: 12; anchors.rightMargin: 12
spacing: 8
Item {
Layout.preferredWidth: 56; Layout.preferredHeight: 40
CAvatar {
anchors.centerIn: parent
initials: modelData.username.substring(0, 2).toUpperCase()
}
}
CText {
variant: "body1"; text: modelData.username
Layout.preferredWidth: 120; elide: Text.ElideRight
}
CText {
variant: "body2"; text: modelData.email
Layout.fillWidth: true; elide: Text.ElideRight
}
Item {
Layout.preferredWidth: 100; Layout.preferredHeight: 40
CBadge {
anchors.verticalCenter: parent.verticalCenter
text: modelData.role; badgeColor: root.roleColor(modelData.role)
}
}
CText {
variant: "body2"; text: "L" + modelData.level
Layout.preferredWidth: 50
}
Item {
Layout.preferredWidth: 90; Layout.preferredHeight: 40
CStatusBadge {
anchors.verticalCenter: parent.verticalCenter
status: root.statusString(modelData.status); text: modelData.status
}
}
CText {
variant: "caption"; text: modelData.created
Layout.preferredWidth: 100
}
FlexRow {
Layout.preferredWidth: 140; spacing: 6
CButton {
text: "Edit"; variant: "ghost"; size: "sm"
onClicked: root.editClicked(modelData.uid)
}
CButton {
text: "Delete"; variant: "danger"; size: "sm"
onClicked: root.deleteClicked(modelData.uid)
}
}
}
}