Skip to content

fix(weather): Remove obsolete mock launch flag usage

b4d7cf0
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

feat(ui-automation): Add rs/1 runtime automation parity #416

fix(weather): Remove obsolete mock launch flag usage
b4d7cf0
Select commit
Loading
Failed to load commit list.
GitHub Actions / warden: code-simplifier completed May 19, 2026 in 54m 51s

8 issues

code-simplifier: Found 8 issues (8 low)

Low

delayMs helper duplicated in tap.ts and button.ts - `src/mcp/tools/ui-automation/button.ts:43-49`

The new delayMs helper in tap.ts (lines 59–63) is an exact duplicate of the existing helper in button.ts (lines 45–49). Since tap.ts is being modified in this PR, extract the helper into shared/ (e.g. shared/delay.ts) and import it from both files to remove the duplication.

Return array uses overly compact conditional spread pattern instead of explicit imperative build - `src/mcp/tools/ui-automation/shared/runtime-next-steps.ts:382-426`

Replace the six ...(condition ? [item] : []) spreads (including the paired shouldPrioritizeScroll / !shouldPrioritizeScroll ordering trick) with an explicit imperative steps.push(...) build — this makes insertion order and conditions readable at a glance rather than requiring the reader to mentally flatten nested spread/ternary expressions.

framesIntersect body is a dense one-liner inconsistent with pointInsideFrame style - `src/mcp/tools/ui-automation/shared/runtime-snapshot.ts:136`

The four intersection conditions are crammed onto one long line; the immediately adjacent pointInsideFrame uses multi-line formatting for equivalent boolean geometry — apply the same style here.

readState always returns a non-empty state object, making the Object.keys guard and undefined return type dead code - `src/mcp/tools/ui-automation/shared/runtime-snapshot.ts:238`

The state object is unconditionally initialized with enabled and visible, so Object.keys(state).length > 0 is always true and the function never returns undefined; replace the ternary with a plain return state and drop the | undefined from the return type.

getRuntimeElementCenter duplicates getFrameCenter logic - `src/mcp/tools/ui-automation/shared/runtime-snapshot.ts:622-628`

getRuntimeElementCenter (lines 622–628) contains the same center-point formula as getFrameCenter (lines 684–689); move getFrameCenter before getRuntimeElementCenter and delegate to eliminate the duplication.

Redundant 'sheet grabber' entry in LOW_PRIORITY_RUNTIME_TARGET_LABELS - `src/utils/renderers/domain-result-text.ts:1172`

In src/utils/structured-output-envelope.ts, 'sheet grabber' appears in both HIDDEN_RUNTIME_TARGET_LABELS (line 52) and LOW_PRIORITY_RUNTIME_TARGET_LABELS (line 54). The only caller of sortRuntimeTargetsForDisplay (in toRuntimeSnapshotCompactCapture, line 217) pre-filters with !isHiddenRuntimeTarget(element), so any element labeled 'sheet grabber' is removed before isLowPriorityRuntimeTarget / getRuntimeTargetDisplayPriority ever runs. The entry in LOW_PRIORITY_RUNTIME_TARGET_LABELS is therefore dead and can be removed for clarity (Code Simplifier: eliminate redundant code).

Redundant 'sheet grabber' entry in LOW_PRIORITY_RUNTIME_TARGET_LABELS - `src/utils/structured-output-envelope.ts:55`

Remove 'sheet grabber' from LOW_PRIORITY_RUNTIME_TARGET_LABELS — elements matching HIDDEN_RUNTIME_TARGET_LABELS are already filtered out before isLowPriorityRuntimeTarget is ever evaluated, so this entry is dead code.

Inline ternary in targets `.map()` duplicates logic already captured in `compactRuntimeElementCandidate` - `src/utils/structured-output-envelope.ts:225-228`

The .map() block reimplements primaryRuntimeElementAction's typeText-over-tap priority inline, but compactRuntimeElementCandidate already combines that logic with compactRuntimeElementRow — use .map(compactRuntimeElementCandidate) instead.


⏱ 52m 39s · 1.8M in / 156.6k out · $5.99