Skip to content

refactor(planning): simplify range 3 of 5 of the shared page's app.js - #15007

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14686

Summary

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

Simplified the functions that start in range 3 of 5 of plugins/planning/shared/web/app.js, measured at 8132 lines: lines 3253-4879, from the Inbox tab lists through the composer events. Behavior is unchanged. The edits add shared helpers where the same expression repeated: ixOffOf/histKey for the Inbox chips that are turned off and History's page key, dataBytes for base64 data: URL decoding, isMyUpload, stem for a file name without its extension, myCardAnchor, answerDraft, and a viewBtn helper local to attNode. They also collapse fillRev's repeated question line, fillUpRow's repeated status checks, pickOpt's double options lookup, a li._k ? li : li no-op and a negated comparison in pumpUploads. I chose function declarations for the new IIFE-level helpers, so hoisting rules out any temporal-dead-zone change no matter when a caller first runs.

Not verified

  • The planning plugin's browser UI suites (ui-a/b/c, align-a/b/c) and the Python unit tests were not run: this lane allows no interpreter or test runner. Left to the PR's CI.
  • No build, test or lint step could run for the JavaScript file here (no node, no linter wrapper); check-affected had no lint lane for .js. Left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI.
  • tidy recorded as skipped: pass 5 (ai-slop:audit fix) ran only its rubric read, because this lane's Bash does not allow the deterministic detector (detect.sh) or git branch. No findings file was written.

Fix

  • plugins/planning/shared/web/app.js: in range 3 only (ixFilter, renderBell, openReview, fillRev, gifStill, picWaits, attNode, openDevice, openPair, redrawn, bareGif, pumpUploads, fillUpRow, paintUploads, earlyOf, sentEarly, pickOpt), shared helpers replace repeated expressions and no-op or…
  • .changes/planning/work-resolve-issue-issue-14686-42770548143-1-316159e8.md: new patch fragment from new-changelog-fragment, body ### Changed / - Internal simplification, no behavior change.

Verification

The runner ran each check from the base copy against 7582cf3:

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

The run reports:

  • check-changelog-fragments: all 19 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 over 2 changed files (run before and after tidy)
  • range measurement: app.js has 8132 lines at the start, so range 3 of 5 is lines 3253-4879; every changed function and every new helper starts inside it (fillIx at 3246 left untouched)
  • source-text tests: test_page_chrome.py and test_session.py read app.js source; none of their asserted strings fall in the edited lines
  • name collisions: grep confirmed each new helper name is declared once; answerDraft was chosen because draftOf already exists at line 6460
  • review: a fresh-context subagent compared every hunk against the surrounding code and found no behavior difference (truthiness, NaN, TDZ/hoisting, shadowing and evaluation order all checked)
  • tidy (code-tidying:tidy-diff): 35 rows taken, none dropped; passes 1-4 made no edits and raised no proposals; pass 5's rubric read found no AI-writing tells in the fragment
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42770548143

Left out: the items under Not verified.

Related

#14686

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

Security review: PR #15007 (head 7582cf3)

No security issues found. I read every hunk of both changed files.

  • plugins/planning/shared/web/app.js: a refactor of the browser client with no behavior change. Repeated expressions now go through shared helpers: ixOffOf, histKey, dataBytes, isMyUpload, stem, myCardAnchor, answerDraft and viewBtn. I checked the parts that touch security:
    • Authorization checks in the UI are unchanged. The remove button still requires Core.me.isOwner || isMyUpload(a.upload), which is the same myUploads id match as before. picWaits keeps the same owner-or-uploader check. In fillUpRow, the accept, decline and approve buttons still require host && Core.me.isOwner, now named decides. Withdraw still requires mine. The status sets are the same: offered || moving equals ["offered","accepted","uploading"].
    • No new injection surface. Question text, captions and status strings still go through textContent, aria-label and the existing fillClamp / E() builders. The diff adds no innerHTML or URL sinks. img.src = assetUrl(asset) is unchanged.
    • Data handling is unchanged. dataBytes does the same base64 decode as before. redrawn still redraws pictures, which strips EXIF and GPS metadata. The bareGif size cap (SHOWN_MAX) is unchanged.
  • .changes/planning/...md: a changelog fragment containing only prose.

No changed file matches a trusted-path glob. The diff does not touch any trust control, merge hold, plugin manifest or standing instruction, so the instruction-surface and manifest lenses do not apply. There are no prior findings, and this was a full review, not a blocking-only one. Nothing in the PR context tries to instruct the review lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15007, simplify range 3 of 5 of plugins/planning/shared/web/app.js

No findings. I read every hunk of both changed files (the app.js refactor and the new planning changelog fragment). I checked each rewrite against the code around it at head and found no behavior change:

  • New helpers. ixOffOf, histKey, dataBytes, isMyUpload, stem, myCardAnchor and answerDraft are function declarations at the outer IIFE level (4-space indent). Each is declared once, and none shadows or is shadowed by a local name where it is called. Each body is exactly the expression it replaces. In answerDraft, cond ? ta.value : ui.drafts[qid] || "" parses the same way as the original.
  • openReview. histKey() is still evaluated after ui.ixOff[tab] is updated, so the History page key matches the old one, which was computed after the update too.
  • fillRev. When q is set, qLine is never empty (it always contains ": "), so qLine || GEN… and qLine || GEN_LABEL behave the same as the old ternaries.
  • attNode / viewBtn. It builds and appends the button synchronously, in the same order as before. The async gifToggle append still lands after the button, and open, li and a are the same closure bindings.
  • fillUpRow. offered, moving, lost and decides are all side-effect-free and evaluated after mine, host and up exist. offered || moving is the same as ["offered","accepted","uploading"].includes(u.status). The old later const moving declaration was removed, so nothing is declared twice.
  • pumpUploads. !(Date.now() < x) and Date.now() >= x are equivalent here because x is up.retryAt[id] || 0, which can never be NaN.
  • paintUploads. li._k ? li : li became li, which changes nothing.
  • pickOpt. It now looks the option up once instead of twice; the result is the same.

Closing issue #14686, acceptance criteria:

  • Behavior unchanged: met, by my reading of each hunk. The UI suites were not run by the author or by me (author-claimed, unverified).
  • Edits limited to the listed file and a changelog fragment: met.
  • Within 400 changed lines and 15 files: met (about 50 lines changed across 2 files).
  • ci-status green: CI is still pending, so this is not checked here.
  • Fragment for planning with bump: patch, a ### Changed heading and the line "Internal simplification, no behavior change.": met.
  • Only functions that start in range 3 (base lines 3253–4879) changed: met. Every hunk falls between base lines 3304 and 4653.

No plugin manifest changed. No path-scoped rule or paved-path check applies to these files. The PR context contains no embedded instructions aimed at this lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 7582cf3

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-15007-7582cf3dc023b4997caab8b67a1526de596999c6, 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 565b2d3 Nov 10, 2026
77 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14686-42770548143-1 branch November 10, 2026 07:31
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 565b2d308e34d38308c401ec5950361458cb5277; 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 3 of 5)

0 participants