Skip to content

refactor(planning): simplify app.js part 2 of 5 - #14996

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14685-42765379123-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14685-42765379123-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14685

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Simplified the functions that start in range 2 of 5 of plugins/planning/shared/web/app.js (lines 1627-3252 of 8131 when this part started), with no behavior change. New local helpers replace repeated code in that range: swRow builds the switch rows (settings, prototype tiers, notification mutes, pop-ups, guests' pop-ups, Ask Claude's own-Claude switch). toggledKeys handles the toggle-then-keep-row-order saves. showMode stands for the setMode-plus-phone-tab pair, ringRow for the next-frame scroll-and-ring, and tourInert for the tour's inert loop. submit() computes its takes-a-pick test once, and THEME_LABEL comes from the existing MODES list. Same-pattern code in other ranges is left for those parts and the restructuring pass, as the issue scopes it.

Not verified

  • The planning UI and Python test suites (shared/tests/ui_*.js, test_page_chrome.py and the rest) were not run: this lane runs no interpreter or test runner. Left to the PR's CI.
  • ci-status green is a PR CI check; left to the PR's CI.
  • tidy skipped passes 4 and 5 (docs-hygiene and ai-slop on markdown): the issue mandates the changelog fragment text word for word. Pass 2 proposal not applied: drop the one-line doc comment above tourInert, which restates its name. The COMMENT-ONLY proof needs a scratch copy of the 575 KB file,…
  • No separate build or lint step exists for this plain browser JS beyond check-affected; the JS was not executed here.
  • Untracked dotfiles in the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) came from the runner environment, not this change, and are not part of it.

Fix

  • plugins/planning/shared/web/app.js: in range 2 only, added the swRow, toggledKeys, showMode, ringRow and tourInert helpers and used them in place of repeated switch-row building, set toggles, mode/tab switching, scroll-and-ring and inert loops; submit() computes takesPick once; THEME_LABEL =…
  • .changes/planning/work-resolve-issue-issue-14685-42765379123-1-d5f3998e.md: patch fragment from new-changelog-fragment, body '### Changed' and 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 62aa7d7:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 14 fragments valid (run before and after tidy)
  • check-changed-skills: no changed skills, nothing to gate (run before and after tidy)
  • check-affected: 12 passed, 7 skipped, the rest CI-only (run before and after tidy)
  • fresh-context review subagent over the whole app.js diff: no behavior change in any hunk (same DOM class strings and attribute order, the same calls in the same order and number, no TDZ or shadowing). It noted two theoretical edge cases: mmCopy reports a synchronous throw as an error instead of a…
  • Grep over plugins/planning tests and sources: no test asserts on the changed source text; ui_proto.js reads .vf-sw-label text and role on tier rows, both unchanged
  • tidy (code-tidying:tidy-diff) passes 1-3 on the change's lines: swRow no longer builds a throwaway span; its single-caller cls parameter was dropped (apSelf adds vf-apself with classList.add, giving the same class string)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42765379123

Left out: the items under Not verified.

Related

#14685

Merge-Risk: max=MEDIUM demote=false head=62aa7d72ec6087f4c38542a346fe886f52122073 rubric=8.3.3 rater=claude-opus-5-5 checker=claude-opus-5-5

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 62aa7d72ec6087f4c38542a346fe886f52122073: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14996, refactor(planning): simplify app.js part 2 of 5

No security issues found.

I read every hunk of both changed files:

  • plugins/planning/shared/web/app.js: a client-side refactor with no behavior change. It adds five local helpers: swRow, toggledKeys, showMode, ringRow and tourInert. It also computes takesPick once in submit(), builds THEME_LABEL from MODES and drops an unneeded async on mmCopy.onclick.
    • Rendering: swRow builds its nodes with the same E(...) element helper the old code used. Labels still come from the hard-coded row arrays, so nothing new reaches HTML parsing and no new place for injected markup appears.
    • Saved settings: toggledKeys filters against the fixed row-key lists (TIERS, popKinds(), GUEST_POPUPS), the same as the inline code it replaces. The values sent through Core.saveSettings and setPrefs are unchanged.
    • Who can moderate: the Core.canModerate() check before showMode("host") is still in place.
    • Tour overlay: tourInert sets and clears inert on the same five elements as before.
  • .changes/planning/work-resolve-issue-issue-14685-42765379123-1-d5f3998e.md: a patch changelog fragment, prose only.

No changed file matches a trusted-path glob. The diff touches no trust control, workflow, plugin manifest or standing instruction, so it has no manifest lines and nothing to check under the instruction-surface lens. The PR context file contains no embedded instructions aimed at this lane. There are no earlier findings from this lane, and this was a full review, not a blocking-only one.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 62aa7d72ec6087f4c38542a346fe886f52122073: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #14996, refactor(planning): simplify app.js part 2 of 5

I read every hunk of both changed files (plugins/planning/shared/web/app.js and the changelog fragment). I found no problems.

Behavior-equivalence check. I compared each hunk with the base code by reading it. I did not run the code or tests.

  • swRow: produces the same DOM as the code it replaces.
    • With a description, the switch is a vf-sw-txt span holding a label span and a description span.
    • Without one, it is a single span with class vf-sw-txt vf-sw-label. That matches the old classList.add result for the mute rows and the old pop-up and own-Claude rows.
    • Every entry in the settings list and in TIERS has a description.
    • apSelf still ends up with vf-sw-row vf-apself.
  • toggledKeys: keeps the row-order filtering and uses the same source sets: st().prototypeTiers, urgent()/popKinds() and guestDefault()/GUEST_POPUPS.
  • showMode: maps focus to the answer tab and host to the host tab, the same as each setMode + setTab pair it replaces.
  • ringRow / openGeneral: openGeneral now picks the list and key before the next frame instead of inside it. The result is the same. All seven callers pass a string key, so the unguarded key.startsWith cannot throw (app.js L3224, L3225, L3482, L5523, L6925, L7001, L8035).
  • takesPick: now computed up front, but isFormat/commentFirst already handle a missing q (L480, L494), and the q?. guards keep a missing question from throwing.
  • THEME_LABEL = Object.fromEntries(MODES): gives the same three labels. MODES is declared at L1784, earlier in the same top-level scope of the wrapper function, so it is set before L3090 runs.
  • mmCopy no longer async: copyOut is itself async (L2899), so errors still come back as a rejected promise.
  • Scope: all the new helpers are declared at the top level of the file's wrapper function, so every call site can see them.

Closing issue #14685 criteria

  • Behavior unchanged: met, based on my reading above. The planning UI test suites were not run by the lane; the PR says they are left to CI. That is the author's claim and I have not verified it.
  • Only the listed file and a fragment changed: met.
  • Size within 400 changed lines: met.
  • ci-status green: CI's job; I could not check it.
  • Fragment: met (bump: patch, ### Changed, "Internal simplification, no behavior change.").
  • Only functions starting in range 2 (lines 1627–3252) changed: met. Every hunk starts between base lines 1739 and 3217.

Other checks

  • No .claude/rules path rule matches the changed files.
  • No plugin manifest changed.
  • No standards index row with Surface paved-path was found.
  • No embedded instructions were found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 62aa7d72ec6087f4c38542a346fe886f52122073, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 62aa7d7

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14996-62aa7d72ec6087f4c38542a346fe886f52122073, expires on 2026-12-10.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 7d9fa8f Nov 10, 2026
77 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14685-42765379123-1 branch November 10, 2026 06:38
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 7d9fa8f6cce2363052a7bb27b8f2d194d9a37467; later checks count it verified from this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify the app.js planning plugin code (part 2 of 5)

0 participants