@qontinui/ui-bridge-native 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.js +45 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +45 -0
- package/dist/core/index.mjs.map +1 -1
- package/dist/core/registry.d.ts +19 -0
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/index.js +333 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +333 -1
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.js +328 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +328 -1
- package/dist/react/index.mjs.map +1 -1
- package/dist/react/useUIElement.d.ts +19 -0
- package/dist/react/useUIElement.d.ts.map +1 -1
- package/dist/server/handlers.d.ts.map +1 -1
- package/dist/server/http-server.d.ts.map +1 -1
- package/dist/server/index.js +268 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +268 -0
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/page-health.d.ts +72 -0
- package/dist/server/page-health.d.ts.map +1 -0
- package/dist/server/types.d.ts +1 -0
- package/dist/server/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -153,6 +153,25 @@ export interface UseUIElementReturn {
|
|
|
153
153
|
focused?: unknown;
|
|
154
154
|
disabled?: unknown;
|
|
155
155
|
}) => void;
|
|
156
|
+
/**
|
|
157
|
+
* Re-publish the element's label (and the mirrored `accessibilityLabel` /
|
|
158
|
+
* `testId` so spec-check and a11y stay in sync). Idempotent — no-op when
|
|
159
|
+
* the new label equals the current registered value.
|
|
160
|
+
*
|
|
161
|
+
* Labels passed via `useUIElement({ id, label })` are captured ONCE at
|
|
162
|
+
* registration; if the source state changes (e.g. a tab's active suffix,
|
|
163
|
+
* or a list's "N events" count), the registry would otherwise hold the
|
|
164
|
+
* mount-time label forever. Call `updateLabel(...)` from a `useEffect`
|
|
165
|
+
* (or directly from a handler) to keep the registry in sync.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```tsx
|
|
169
|
+
* const label = `${events.length} events`;
|
|
170
|
+
* const { updateLabel } = useUIElement({ id: 'events-list', label, type: 'list' });
|
|
171
|
+
* useEffect(() => { updateLabel(label); }, [label, updateLabel]);
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
updateLabel: (newLabel: string) => void;
|
|
156
175
|
}
|
|
157
176
|
export declare function useUIElement<T extends NativeElementType = NativeElementType>(options: UseUIElementOptions<T>): UseUIElementReturn;
|
|
158
177
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUIElement.d.ts","sourceRoot":"","sources":["../../src/react/useUIElement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AA4DvB,KAAK,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAErD;;;;;;;;;GASG;AACH,MAAM,MAAM,6BAA6B,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB;IACtF,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,0CAA0C;IAC1C,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACjC,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kB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S,iBAAiB,GAAG,iBAAiB,IACtF,mCAAmC,CAAC,CAAC,CAAC,CAAC;AAEzC,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,GAAG,iBAAiB,EACnF,OAAO,EAAE,4BAA4B,CAAC,CAAC,CAAC,GACvC,2BAA2B,CAsB7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/server/handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,kBAAkB,CAAC;AAQpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAQV,oBAAoB,EAKrB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/server/handlers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,sBAAsB,EAAuB,MAAM,kBAAkB,CAAC;AAQpF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAQV,oBAAoB,EAKrB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAgQhF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,CAAC,EAAE;IACP,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAClF,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,iFAAiF;IACjF,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C,GACA,oBAAoB,CAg1BtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../../src/server/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,kBAAkB,CAAC;AACrF,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"http-server.d.ts","sourceRoot":"","sources":["../../src/server/http-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,kBAAkB,CAAC;AACrF,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EAGlB,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAkVlE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,E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IAwB7E;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAetB;;;;OAIG;IACH,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAa/C;;;OAGG;YACW,oBAAoB;IAwHlC;;;;;;;;;;;OAWG;YACW,sBAAsB;IAmJpC;;;OAGG;YACW,cAAc;IA6E5B;;;;;;;;;;;OAWG;YACW,oBAAoB;IAgClC;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAuDhE;;;;;;;;;;;OAWG;YACW,YAAY;CAuE3B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,CAAC,EAAE,kBAAkB,GAC1B,oBAAoB,CAEtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG"}
|
package/dist/server/index.js
CHANGED
|
@@ -57,6 +57,11 @@ var UI_BRIDGE_NATIVE_ROUTES = {
|
|
|
57
57
|
path: "/ui-bridge/control/snapshot",
|
|
58
58
|
description: "Get full bridge snapshot"
|
|
59
59
|
},
|
|
60
|
+
PAGE_HEALTH: {
|
|
61
|
+
method: "POST",
|
|
62
|
+
path: "/ui-bridge/control/page-health",
|
|
63
|
+
description: "Holistic page health diagnostic: spatial coverage, layout regions, text signals, interactive readiness, anomalies + ASCII heatmap"
|
|
64
|
+
},
|
|
60
65
|
// Workflows
|
|
61
66
|
GET_WORKFLOWS: {
|
|
62
67
|
method: "GET",
|
|
@@ -671,6 +676,245 @@ function createDesignHandlers(registry) {
|
|
|
671
676
|
};
|
|
672
677
|
}
|
|
673
678
|
|
|
679
|
+
// src/server/page-health.ts
|
|
680
|
+
var GRID_SIZE = 20;
|
|
681
|
+
var NAV_TYPES = /* @__PURE__ */ new Set(["button", "heading", "badge", "status-message"]);
|
|
682
|
+
var SKIP_TEXT_TYPES = /* @__PURE__ */ new Set(["button", "link", "tab", "menuitem"]);
|
|
683
|
+
var INTERACTIVE_TYPES = /* @__PURE__ */ new Set([
|
|
684
|
+
"button",
|
|
685
|
+
"input",
|
|
686
|
+
"switch",
|
|
687
|
+
"checkbox",
|
|
688
|
+
"radio",
|
|
689
|
+
"touchable",
|
|
690
|
+
"listItem"
|
|
691
|
+
]);
|
|
692
|
+
var ERROR_PHRASES = [
|
|
693
|
+
"error occurred",
|
|
694
|
+
"failed to",
|
|
695
|
+
"exception",
|
|
696
|
+
"crash",
|
|
697
|
+
"unavailable",
|
|
698
|
+
"something went wrong",
|
|
699
|
+
"could not"
|
|
700
|
+
];
|
|
701
|
+
var LOADING_PHRASES = [
|
|
702
|
+
"loading",
|
|
703
|
+
"starting",
|
|
704
|
+
"connecting",
|
|
705
|
+
"please wait",
|
|
706
|
+
"initializing",
|
|
707
|
+
"fetching"
|
|
708
|
+
];
|
|
709
|
+
var EMPTY_PHRASES = [
|
|
710
|
+
"no data",
|
|
711
|
+
"no results",
|
|
712
|
+
"nothing here",
|
|
713
|
+
"empty",
|
|
714
|
+
"no items",
|
|
715
|
+
"get started"
|
|
716
|
+
];
|
|
717
|
+
function severityRank(s) {
|
|
718
|
+
if (s === "CRITICAL") return 3;
|
|
719
|
+
if (s === "WARNING") return 2;
|
|
720
|
+
return 1;
|
|
721
|
+
}
|
|
722
|
+
function worstSeverity(findings) {
|
|
723
|
+
let worst = "OK";
|
|
724
|
+
for (const f of findings) {
|
|
725
|
+
if (severityRank(f.severity) > severityRank(worst)) {
|
|
726
|
+
worst = f.severity;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return worst;
|
|
730
|
+
}
|
|
731
|
+
function truncate(s, n) {
|
|
732
|
+
if (s.length <= n) return s;
|
|
733
|
+
return [...s].slice(0, n).join("");
|
|
734
|
+
}
|
|
735
|
+
function normalizeRect(state, viewport) {
|
|
736
|
+
const layout = state.layout;
|
|
737
|
+
if (!layout) return null;
|
|
738
|
+
if (viewport.width <= 0 || viewport.height <= 0) return null;
|
|
739
|
+
const px = layout.pageX ?? layout.x;
|
|
740
|
+
const py = layout.pageY ?? layout.y;
|
|
741
|
+
return {
|
|
742
|
+
x: px / viewport.width,
|
|
743
|
+
y: py / viewport.height,
|
|
744
|
+
width: layout.width / viewport.width,
|
|
745
|
+
height: layout.height / viewport.height
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
function diagnosePageHealth(elements, viewport) {
|
|
749
|
+
const findings = [];
|
|
750
|
+
const projected = elements.map((el) => ({
|
|
751
|
+
el,
|
|
752
|
+
rect: el.state.visible ? normalizeRect(el.state, viewport) : null
|
|
753
|
+
}));
|
|
754
|
+
const visible = projected.filter((p) => p.rect !== null);
|
|
755
|
+
const grid = Array.from(
|
|
756
|
+
{ length: GRID_SIZE },
|
|
757
|
+
() => Array.from({ length: GRID_SIZE }, () => false)
|
|
758
|
+
);
|
|
759
|
+
for (const { rect } of visible) {
|
|
760
|
+
const colStart = Math.max(0, Math.floor(rect.x * GRID_SIZE));
|
|
761
|
+
const colEnd = Math.min(GRID_SIZE, Math.ceil((rect.x + rect.width) * GRID_SIZE));
|
|
762
|
+
const rowStart = Math.max(0, Math.floor(rect.y * GRID_SIZE));
|
|
763
|
+
const rowEnd = Math.min(GRID_SIZE, Math.ceil((rect.y + rect.height) * GRID_SIZE));
|
|
764
|
+
for (let r = rowStart; r < rowEnd; r++) {
|
|
765
|
+
for (let c = colStart; c < colEnd; c++) {
|
|
766
|
+
grid[r][c] = true;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
const totalCells = GRID_SIZE * GRID_SIZE;
|
|
771
|
+
const halfCells = totalCells / 2;
|
|
772
|
+
let filled = 0;
|
|
773
|
+
let leftFilled = 0;
|
|
774
|
+
let rightFilled = 0;
|
|
775
|
+
const half = GRID_SIZE / 2;
|
|
776
|
+
for (let r = 0; r < GRID_SIZE; r++) {
|
|
777
|
+
for (let c = 0; c < GRID_SIZE; c++) {
|
|
778
|
+
if (grid[r][c]) {
|
|
779
|
+
filled++;
|
|
780
|
+
if (c < half) leftFilled++;
|
|
781
|
+
else rightFilled++;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
const coveragePct = Math.round(filled / totalCells * 100);
|
|
786
|
+
const leftHalfPct = Math.round(leftFilled / halfCells * 100);
|
|
787
|
+
const rightHalfPct = Math.round(rightFilled / halfCells * 100);
|
|
788
|
+
let spatialSeverity = "OK";
|
|
789
|
+
if (coveragePct < 15) spatialSeverity = "CRITICAL";
|
|
790
|
+
else if (coveragePct < 30) spatialSeverity = "WARNING";
|
|
791
|
+
if (rightHalfPct < 5 && leftHalfPct > 20) spatialSeverity = "CRITICAL";
|
|
792
|
+
findings.push({
|
|
793
|
+
check: "spatial_coverage",
|
|
794
|
+
severity: spatialSeverity,
|
|
795
|
+
detail: `Elements cover ${coveragePct}% of viewport. Left=${leftHalfPct}%, Right=${rightHalfPct}%`,
|
|
796
|
+
data: {
|
|
797
|
+
coverage_pct: coveragePct,
|
|
798
|
+
left_half_pct: leftHalfPct,
|
|
799
|
+
right_half_pct: rightHalfPct
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
let sidebar = 0;
|
|
803
|
+
let header = 0;
|
|
804
|
+
let content = 0;
|
|
805
|
+
for (const { rect } of visible) {
|
|
806
|
+
const cx = rect.x + rect.width / 2;
|
|
807
|
+
const cy = rect.y + rect.height / 2;
|
|
808
|
+
if (cx < 0.2) sidebar++;
|
|
809
|
+
else if (cy < 0.08) header++;
|
|
810
|
+
else content++;
|
|
811
|
+
}
|
|
812
|
+
let layoutSeverity = "OK";
|
|
813
|
+
if (content === 0) layoutSeverity = "CRITICAL";
|
|
814
|
+
else if (content < 3) layoutSeverity = "WARNING";
|
|
815
|
+
findings.push({
|
|
816
|
+
check: "layout_regions",
|
|
817
|
+
severity: layoutSeverity,
|
|
818
|
+
detail: `sidebar=${sidebar}, header=${header}, content=${content}`,
|
|
819
|
+
data: { sidebar, header, content }
|
|
820
|
+
});
|
|
821
|
+
const typeCounts = {};
|
|
822
|
+
for (const el of elements) {
|
|
823
|
+
const t = el.type || "unknown";
|
|
824
|
+
typeCounts[t] = (typeCounts[t] ?? 0) + 1;
|
|
825
|
+
}
|
|
826
|
+
const allNav = elements.length > 5 && Object.keys(typeCounts).every((k) => NAV_TYPES.has(k));
|
|
827
|
+
const diversitySeverity = allNav ? "WARNING" : "OK";
|
|
828
|
+
findings.push({
|
|
829
|
+
check: "element_diversity",
|
|
830
|
+
severity: diversitySeverity,
|
|
831
|
+
detail: `${Object.keys(typeCounts).length} type(s) across ${elements.length} elements${allNav ? " (navigation-only)" : ""}`,
|
|
832
|
+
data: { types: typeCounts }
|
|
833
|
+
});
|
|
834
|
+
const detectedErrors = [];
|
|
835
|
+
const detectedLoading = [];
|
|
836
|
+
const detectedEmpty = [];
|
|
837
|
+
const detectedCss = [];
|
|
838
|
+
for (const el of elements) {
|
|
839
|
+
const elType = el.type ?? "";
|
|
840
|
+
if (SKIP_TEXT_TYPES.has(elType)) continue;
|
|
841
|
+
const text = (el.state.textContent ?? "").toString();
|
|
842
|
+
if (!text) continue;
|
|
843
|
+
const textLower = text.toLowerCase();
|
|
844
|
+
for (const p of ERROR_PHRASES) {
|
|
845
|
+
if (textLower.includes(p)) {
|
|
846
|
+
detectedErrors.push(truncate(text, 120));
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
for (const p of LOADING_PHRASES) {
|
|
851
|
+
if (textLower.includes(p)) {
|
|
852
|
+
detectedLoading.push(truncate(text, 120));
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
for (const p of EMPTY_PHRASES) {
|
|
857
|
+
if (textLower.includes(p)) {
|
|
858
|
+
detectedEmpty.push(truncate(text, 120));
|
|
859
|
+
break;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
let textSeverity = "OK";
|
|
864
|
+
if (detectedErrors.length > 0) textSeverity = "CRITICAL";
|
|
865
|
+
else if (detectedLoading.length > 0 || detectedEmpty.length > 0) textSeverity = "WARNING";
|
|
866
|
+
findings.push({
|
|
867
|
+
check: "text_signals",
|
|
868
|
+
severity: textSeverity,
|
|
869
|
+
detail: `errors=${detectedErrors.length}, loading=${detectedLoading.length}, empty=${detectedEmpty.length}, css_signals=${detectedCss.length}`,
|
|
870
|
+
data: {
|
|
871
|
+
errors: detectedErrors,
|
|
872
|
+
loading: detectedLoading,
|
|
873
|
+
empty: detectedEmpty,
|
|
874
|
+
css_signals: detectedCss
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
let interactiveTotal = 0;
|
|
878
|
+
let interactiveDisabled = 0;
|
|
879
|
+
for (const el of elements) {
|
|
880
|
+
if (!INTERACTIVE_TYPES.has(el.type)) continue;
|
|
881
|
+
interactiveTotal++;
|
|
882
|
+
if (el.state.enabled === false) interactiveDisabled++;
|
|
883
|
+
}
|
|
884
|
+
const interactiveSeverity = interactiveTotal > 0 && interactiveDisabled / interactiveTotal > 0.5 ? "WARNING" : "OK";
|
|
885
|
+
findings.push({
|
|
886
|
+
check: "interactive_readiness",
|
|
887
|
+
severity: interactiveSeverity,
|
|
888
|
+
detail: `${interactiveTotal} interactive elements, ${interactiveDisabled} disabled`,
|
|
889
|
+
data: { total: interactiveTotal, disabled: interactiveDisabled }
|
|
890
|
+
});
|
|
891
|
+
let zeroSize = 0;
|
|
892
|
+
let outsideViewport = 0;
|
|
893
|
+
for (const { rect } of visible) {
|
|
894
|
+
if (rect.width === 0 || rect.height === 0) zeroSize++;
|
|
895
|
+
if (rect.x + rect.width < 0 || rect.y + rect.height < 0 || rect.x > 1 || rect.y > 1) {
|
|
896
|
+
outsideViewport++;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
const anomalySeverity = zeroSize > 0 || outsideViewport > 0 ? "WARNING" : "OK";
|
|
900
|
+
findings.push({
|
|
901
|
+
check: "visual_anomalies",
|
|
902
|
+
severity: anomalySeverity,
|
|
903
|
+
detail: `zero_size=${zeroSize}, outside_viewport=${outsideViewport}`,
|
|
904
|
+
data: { zero_size: zeroSize, outside_viewport: outsideViewport }
|
|
905
|
+
});
|
|
906
|
+
const heatmap = grid.map(
|
|
907
|
+
(row) => row.map((cell) => cell ? "#" : ".").join("")
|
|
908
|
+
);
|
|
909
|
+
return {
|
|
910
|
+
summary: worstSeverity(findings),
|
|
911
|
+
findings,
|
|
912
|
+
heatmap,
|
|
913
|
+
element_count: elements.length,
|
|
914
|
+
visible_count: visible.length
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
|
|
674
918
|
// src/server/handlers.ts
|
|
675
919
|
async function executeWorkflowStep(step, registry, executor) {
|
|
676
920
|
const startTime = Date.now();
|
|
@@ -1055,6 +1299,25 @@ function createServerHandlers(registry, executor, config) {
|
|
|
1055
1299
|
const snapshot = registry.createSnapshot(void 0, { visibleOnly, currentRouteOnly });
|
|
1056
1300
|
return success2(snapshot);
|
|
1057
1301
|
},
|
|
1302
|
+
getPageHealth: async (ctx) => {
|
|
1303
|
+
const bodyViewport = ctx.body?.viewport;
|
|
1304
|
+
let viewport = bodyViewport;
|
|
1305
|
+
if (!viewport) {
|
|
1306
|
+
try {
|
|
1307
|
+
const { Dimensions } = __require("react-native");
|
|
1308
|
+
const win = Dimensions.get("window");
|
|
1309
|
+
viewport = { width: win.width, height: win.height };
|
|
1310
|
+
} catch {
|
|
1311
|
+
viewport = { width: 0, height: 0 };
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
const elements = registry.getAllElements().map((e) => ({
|
|
1315
|
+
type: e.type,
|
|
1316
|
+
state: e.getState()
|
|
1317
|
+
}));
|
|
1318
|
+
const report = diagnosePageHealth(elements, viewport);
|
|
1319
|
+
return success2(report);
|
|
1320
|
+
},
|
|
1058
1321
|
// Workflows
|
|
1059
1322
|
getWorkflows: async () => {
|
|
1060
1323
|
const workflows = registry.getAllWorkflows().map((w) => ({
|
|
@@ -1803,6 +2066,10 @@ var WS_ROUTES = [
|
|
|
1803
2066
|
{ pattern: "ai/find", handler: "find", httpMethods: ["POST"] },
|
|
1804
2067
|
{ pattern: "control/snapshot", handler: "getSnapshot", httpMethods: ["GET"] },
|
|
1805
2068
|
{ pattern: "control/discover", handler: "getSnapshot" },
|
|
2069
|
+
// Page health — accepts both GET and POST so the canonical skill invocation
|
|
2070
|
+
// (`POST .../control/page-health` with an empty body) and ad-hoc curls both
|
|
2071
|
+
// work without a body-shape gotcha.
|
|
2072
|
+
{ pattern: "control/page-health", handler: "getPageHealth", httpMethods: ["GET", "POST"] },
|
|
1806
2073
|
// Workflows
|
|
1807
2074
|
{ pattern: "control/workflows", handler: "getWorkflows", httpMethods: ["GET"] },
|
|
1808
2075
|
{ pattern: "control/workflow/:id/run", handler: "runWorkflow", httpMethods: ["POST"] },
|
|
@@ -1907,6 +2174,7 @@ var HANDLER_DESCRIPTIONS = {
|
|
|
1907
2174
|
executeComponentAction: "Invoke a component action directly (preferred over button clicks)",
|
|
1908
2175
|
find: "AI-powered element search by natural-language query",
|
|
1909
2176
|
getSnapshot: "Full snapshot: elements + route + state. Supports ?visibleOnly=true and ?currentRouteOnly=true",
|
|
2177
|
+
getPageHealth: 'Holistic page health diagnostic over current snapshot elements (spatial coverage, layout regions, text/anomaly signals, heatmap). Optional body: { viewport?: { width, height } } to override Dimensions.get("window").',
|
|
1910
2178
|
getWorkflows: "List registered workflows",
|
|
1911
2179
|
runWorkflow: "Trigger a workflow by id",
|
|
1912
2180
|
pageRefresh: "Reload the current route",
|