Skip to content

refactor(planning): simplify app.js range 4 of 5 - #15336

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14687-42997935348-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14687

Summary

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

Simplified the functions that start in range 4 of 5 of plugins/planning/shared/web/app.js (lines 4883-6510 of the file's 8138 lines). The person card's two near-identical name forms now share one renameForm helper, and a kindLabel helper replaces six copies of KIND_LABEL\[x.kind\] || "Research". Repeated expressions are hoisted into locals (the Later-items tail of the End session text, the request-kind name, the 'you' or name label, the open-request predicate), two adjacent if (!compact) blocks are merged, and an unused owner local is removed. Every string, data-k key, aria label and call order stays the same.

Not verified

  • JavaScript syntax check and the planning browser UI suites (ui_merge.js and the other Playwright tests) and Python tests were not run: this lane runs only its named wrappers, with no node or python. Left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI.
  • tidy pass 5 ran as a hand rubric read only: the lane cannot run the ai-slop detector script (detect.sh)

Fix

  • plugins/planning/shared/web/app.js: in range 4 only: endBtn.onclick uses a laterTail helper; fillPcard's own-name and rename-person forms share a local renameForm helper and a focusField helper; fillReq hoists kindName; buildCard merges two if (!compact) blocks; new kindLabel helper next to…
  • .changes/planning/work-resolve-issue-issue-14687-42997935348-1-f24080b8.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 27e23ca:

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

The run reports:

  • check-changelog-fragments: all 3 fragments under .changes/ valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 12 passed, 7 skipped over the 2 changed files
  • grep of plugins/planning tests for data-k keys (ui_merge.js, harness-open.js) and source-text assertions (test_page_chrome.py, test_session.py CHAT_EMOJI): every key and asserted string the edits touch is unchanged
  • fresh-context review subagent over the whole diff: no behavior change, no TDZ or shadowing problem, braces balanced in every edited region
  • tidy-diff over the change's lines: no edits needed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42997935348

Left out: the items under Not verified.

Related

#14687

Merge-Risk: max=MEDIUM demote=false head=27e23ca5459d2220fdcc7d94476abe41af702c9c rubric=8.4.2 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-review reviewed 27e23ca5459d2220fdcc7d94476abe41af702c9c: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk of both changed files and checked each edit in plugins/planning/shared/web/app.js against the code around it at head. I found no change in behavior.

What I checked:

  • laterTail (End session). The confirm body still counts Later items when the dialog opens. The click handler still takes its tail before Core.endSession, so it reads the same count the old n did.
  • renameForm / focusField (fillPcard). Both call sites pass the old values: data-k keys (rn/rc/rs, rnp/rpc/rps), aria labels, initial value (ui.renameDraft ?? value), and Cancel's focus target (rename, pa-rename). end() clears the same flag (ui.renaming or ui.renameFor). The flash text is the same through said(j.name, v). The order of updates in submit and cancel is unchanged. k, pcard and fillPcard are all in scope where the helper is defined, at app.js:5189 and after.
  • Merged if (!compact) blocks (buildCard, app.js:5586). Nothing ran between the two blocks, so the elements are created and appended to foot in the same order.
  • readOnly(qById(qid)) → readOnly(q) (app.js:5701). q is const q = qById(qid) at app.js:5666 in the same function and is not reassigned.
  • kindLabel. It is declared right after KIND_LABEL (app.js:5909), so it has the same temporal-dead-zone exposure as before. All six replaced copies used the same fallback, "Research". The ttl own-result branch keeps its "Answer" fallback inline, which is correct.
  • The name locals in the cite-chip callbacks. They are scoped to each arrow callback. x.kind is read at the same point as before relative to a missing x.
  • openHere (renderThread). It is the same predicate as both old filters. The runner !== "self" condition still applies only to mineOpen.
  • Removed owner local in fillThReq. It was not read anywhere in the function.

Closing issue #14687 acceptance criteria:

  • Behavior unchanged: met, by my reading above. This is a pure refactor with no dedicated test. The repository's UI suites (ui_merge.js, test_page_chrome.py) assert on the data-k keys and strings that stay the same. I did not run them; the author also says they did not run them and left them to CI.
  • Edits only the listed file plus a changelog fragment: met.
  • Within 400 changed lines and 15 files: met (about 80 changed lines, 2 files).
  • ci-status green: not something I can check; left to the PR's CI.
  • Changelog fragment: met. .changes/planning/…f24080b8.md has bump: patch, ### Changed, and the required line.
  • Only range 4 of 5 (lines 4883–6510) changed: met. Every hunk falls between lines 4967 and 6283.

Not verified by me: the author's claims that the syntax check, Playwright and Python suites pass, and that the changelog and changed-skills checks pass, are their own. I had no shell to run them.

No embedded instructions found in the PR context.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15336 (refactor(planning): simplify app.js range 4 of 5)

No security issues found.

I read every hunk of both changed files:

  • .changes/planning/work-resolve-issue-issue-14687-42997935348-1-f24080b8.md is a new changelog fragment with only bump: patch and a line of prose. It has no security surface.
  • plugins/planning/shared/web/app.js is a refactor of browser UI code with no behavior change:
    • The two name forms (your own name, and the owner renaming another person) now share one renameForm helper.
    • A new focusField helper and a new kindLabel helper (which replaces six copies of KIND_LABEL[x.kind] || "Research") remove repeated code.
    • Repeated expressions became locals: laterTail, kindName, from, openHere, name.
    • Two adjacent if (!compact) blocks were merged.
    • An unused owner local was removed.

What I checked:

  • Output sinks: every string that comes from users or the server (person names, request text, the j.name the server returns after a rename, kind labels) still goes through the same sinks as on the base. Those are textContent, setAttribute("aria-label", …), E(...) text arguments and flash(...). The diff adds no innerHTML, no insertAdjacentHTML, no eval and no dynamic URL.
  • Selector input: the focusField(key) and back selectors only ever get the fixed literal data-k keys (rn, rnp, rename, pa-rename). No user input reaches querySelector.
  • Authorization: the gate on the other-person rename form (owner && c.pinned && !me && role !== "Host" && S.people, then ui.renameFor === pid) is unchanged, and the form still calls Core.renamePerson(pid, v). The owner local removed from fillThReq had no reader in that function, so no permission check was dropped. Whether a rename is allowed is still decided by the server, which the diff does not touch.
  • Trust controls and other lenses: no file matches a trusted-path glob. The diff touches no workflow, action, token request, trust control, merge hold, standing instruction or plugin manifest, so the trust-control, instruction-surface and manifest lenses do not apply.

PR context: the description has no embedded instructions aimed at the review lane.

Prior findings: none. This is the first review of this PR (earlier heads reviewed: 0, blocking only: no).

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 27e23ca

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-15336-27e23ca5459d2220fdcc7d94476abe41af702c9c, expires on 2026-12-11.

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 11, 2026
Merged via the queue into main with commit 4642352 Nov 11, 2026
77 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14687-42997935348-1 branch November 11, 2026 10:35
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 46423526e4e6dd05c448ba852a484de5b37e31b8; 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 4 of 5)

0 participants