feat: extend map targeting and overlay controls

Support batch feature targeting and clear map highlights and overlays from the More panel. Remove misleading action chevrons and unused configuration export entries.

Validated the isolated patch with lint, typecheck, 36 focused tests and 5 browser cases using mocked data.
This commit is contained in:
2026-10-28 14:47:33 +08:00
parent e57e0f099f
commit 5b710d1247
17 changed files with 666 additions and 202 deletions
@@ -10,6 +10,28 @@ import { MapDevPanel } from "./map-dev-panel";
afterEach(cleanup);
describe("MapDevPanel", () => {
it("deduplicates pasted IDs for every location action and prevents oversized batches", async () => {
const user = userEvent.setup();
const commands = createCommands();
render(<MapDevPanel commands={commands} controllerState={createControllerState()}
detailFeature={null} onClose={vi.fn()} />);
const input = screen.getByLabelText("要素 ID(可多个)");
await user.clear(input);
await user.paste("P-1,P-2\nP-1 P-3;P-4");
const target = { sourceId: "pipes", featureIds: ["P-1", "P-2", "P-3", "P-4"] };
await user.click(screen.getByRole("button", { name: "仅高亮" }));
expect(commands.highlight).toHaveBeenCalledWith(target);
await user.click(screen.getByRole("button", { name: "缩放到要素" }));
expect(commands.zoomToFeature).toHaveBeenCalledWith(target);
await user.click(screen.getByRole("button", { name: "定位并高亮" }));
expect(commands.locateAndHighlight).toHaveBeenCalledWith(target);
await user.clear(input);
expect(screen.getByRole("button", { name: "定位并高亮" })).toBeDisabled();
await user.paste(Array.from({ length: 101 }, (_, i) => `P-${i}`).join(","));
expect(screen.getByRole("alert")).toHaveTextContent("单次最多 100 个");
expect(screen.getByRole("button", { name: "定位并高亮" })).toBeDisabled();
});
it("defaults to following investigations and allows disabling it", async () => {
const user = userEvent.setup();
const onFollowChange = vi.fn();
@@ -109,6 +131,8 @@ function createControllerState(
): WorkbenchMapControllerState {
return {
target: null,
targets: [],
targetResult: null,
valueLabels: {},
pending: false,
errorCode: null,