feat(web): Outliner search and state filters run through the native engine

The web Outliner filtered rows in the bundle while desktop filters inside
outliner_build_tree, so the filter controls diverged as soon as the tree
was rebuilt. OUTLINER_SET_FILTER writes SpaceOutliner's own search_string,
search_flags, flag and filter/filter_state fields and lets the native tree
rebuild; OUTLINER_SET_SYNC_SELECT toggles SO_SYNC_SELECT. Both are UI
state, so they report changed=false and leave history alone.

The protocol, worker and snapshot carry filter{...} and syncSelection; the
App drops the client-side filter on the native path (it stays for the
fallback surface), keeps an optimistic draft so the snapshot-controlled
checkboxes do not snap back during the async round trip, and rebases
Outliner intents after any Outliner command bumps the revision.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-30 06:36:34 +08:00
parent 77c040f484
commit 1c8cc73e3d
12 changed files with 308 additions and 23 deletions

View File

@@ -19,7 +19,7 @@ import path from "node:path";
import { fileURLToPath } from "node:url";
const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
const EXPECTED_CASES = ["outliner-tree-baseline-web", "outliner-tools-baseline-web", "outliner-mirror-baseline-web", "outliner-metrics-web", "outliner-display-mode-web"];
const EXPECTED_CASES = ["outliner-tree-baseline-web", "outliner-tools-baseline-web", "outliner-mirror-baseline-web", "outliner-metrics-web", "outliner-display-mode-web", "outliner-filter-web"];
/* Desktop Layout geometry the metrics case must reproduce (batch 2: UI sizes). */
const GEOMETRY_GOLDEN = path.join(REPO_ROOT, "tests/golden/OUTLINER-DESKTOP-METRICS/outliner-metrics.json");
const errors = [];

View File

@@ -36,6 +36,7 @@ const KNOWN_CASES = [
{ id: "outliner-mirror-baseline-web", title: /\[outliner-mirror-baseline-web\]/ },
{ id: "outliner-metrics-web", title: /\[outliner-metrics-web\]/ },
{ id: "outliner-display-mode-web", title: /\[outliner-display-mode-web\]/ },
{ id: "outliner-filter-web", title: /\[outliner-filter-web\]/ },
];
function usage() {
@@ -263,7 +264,7 @@ function writeBlocked(detail) {
const engineOutlinerFilter = fs.existsSync(wasm) ? await fileContains(wasm, "OUTLINER_SET_FILTER") : false;
const engineRestriction = fs.existsSync(wasm) ? await fileContains(wasm, "OUTLINER_SET_RESTRICTION") : false;
record("candidate engine has display modes", engineDisplayMode, engineDisplayMode ? true : "rebuild web_engine with the display-mode batch (OUTLINER_SET_DISPLAY_MODE)");
record("candidate engine has native outliner filter", engineOutlinerFilter, engineOutlinerFilter ? true : "probe only in this batch; becomes a gate with the filter engine batch", false);
record("candidate engine has native outliner filter", engineOutlinerFilter, engineOutlinerFilter ? true : "rebuild web_engine with the filter batch (OUTLINER_SET_FILTER)");
record("candidate engine has restriction columns", engineRestriction, engineRestriction ? true : "probe only in this batch; becomes a gate with the restriction-column batch", false);
const uiOutlinerSearch = assetBundleHas("搜索场景");
record("candidate bundle has outliner search", uiOutlinerSearch, uiOutlinerSearch ? true : "candidate predates the outliner toolbar; run `cd web && npm run build`", !options.allowStale);