refactor(views): share source-ordered field selection (#15624)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-01 21:06:40 +00:00
1 parent cab1047870
commit 228b987170
5 files changed
+28 -42

No files matched your search

+6 -4
View File
@@ -18,7 +18,11 @@ import {
completeWithinViewCoverage,
selectedViewPage,
} from "./analysisViewCoverage.js";
import { filterSet, selectViewRows } from "./selectViewRows.js";
import {
filterSet,
pickSourceOrderedFields,
selectViewRows,
} from "./selectViewRows.js";
const code = pythonPycSchema.shape.code_objects.element;
@@ -93,9 +97,7 @@ export const projectPythonPycView = (
const indices = filterSet(view.indices);
const fields = new Set<string>(view.fields ?? code.keyof().options);
const projectRow = (row: PythonPycCodeObject, source_index: number) => ({
...Object.fromEntries(
Object.entries(row).filter(([key]) => fields.has(key)),
),
...pickSourceOrderedFields(row, fields),
source_index,
});
const matches =