Skip to content

refactor(capture-kit): share the snapshot tree helpers outside Android presentation - #4594

Merged
thymikee merged 1 commit into
mainfrom
refactor/capture-kit-shared-snapshot-tree
Nov 16, 2026
Merged

thymikee merged 1 commit into
mainfrom
refactor/capture-kit-shared-snapshot-tree

Conversation

@thymikee

@thymikee thymikee commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Move the platform-neutral snapshot tree helpers (findAncestor, ChildrenByParent, buildChildrenByParent, collectDescendants, markNodeAndDescendantsForRemoval) from packages/capture-kit/src/snapshot/snapshot-presentation/android/tree.ts to packages/capture-kit/src/snapshot/snapshot-tree.ts. Update the two Android presentation importers. No Android-specific code was left behind: every export of the old module is platform-neutral.

Touched files: 3 (1 rename, 2 import updates). Pure move, no behaviour change.

This prepares #4592: the cross-platform static accessibility audit must not import an Android presentation module for these helpers.

Validation

  • Tested SHA: 64b9e4e02f8701a76e7373d9c4f6c74a9f7bf979
  • pnpm check:affected --run --head 64b9e4e02f: all runnable checks passed (format, lint, typecheck, layering, fallow, build, vitest-related, unit), receipt exactCommit: true.
  • git diff -M90% --stat origin/main...HEAD shows the rename with 0 content changes plus two import-line updates.
  • Not device-facing; no device run needed.
  • CI obligations: standard lanes on GitHub. No unresolved risks.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

…d presentation

Move the platform-neutral snapshot tree helpers out of the Android presentation module to packages/capture-kit/src/snapshot/snapshot-tree.ts and update the two Android importers. Pure move; no behaviour change.
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.32 MB 6.32 MB 0 B
Package (unpacked) 6.32 MB 6.32 MB 0 B
Package (download) 1.92 MB 1.92 MB +13 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 31.1 ms 28.4 ms -2.7 ms
CLI --help 63.7 ms 59.5 ms -4.2 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

You’re at about 96% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

View guided diff | Turn on auto-fix | Re-trigger cubic

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve

No open findings.

Reviewed with this repository's own Sentinel configuration (cfe08502f0f6).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

I found no problems in 64b9e4e, and all 20 checks pass. There are no conflicts, and nothing else needs to happen before merge. Not blocking: the helpers in ios-snapshot-engine/tree.ts overlap snapshot-tree.ts by name; that predates this PR and could be folded into the shared module later.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 16, 2026
@thymikee
thymikee added this pull request to stack #4598 November 16, 2026 15:32
@thymikee
thymikee merged commit b3c1a3c into main Nov 16, 2026
20 of 21 checks passed
@thymikee
thymikee deleted the refactor/capture-kit-shared-snapshot-tree branch November 16, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant