Skip to content

🐛 fix(stories): offer the full-story copy button whenever the story was trimmed - #265

Merged
hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-264
Oct 25, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-264

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The 'Copy issue text' button was inside the popup-blocked fallback block, so when the popup opened normally a trimmed story (>1500 chars) lost its tail with no recovery control.

Fix: moved the button into its own hidden #story-recover container, revealed whenever story_truncated is true (popup opened or blocked); reset on dialog open and submit. The success notice now says 'Copy issue text carries the full story.' when trimmed. Fallback paragraph no longer references the button (it was already accurate).

Test: added popup-allowed + >1500-char and non-truncated cases to scripts/story-dialog.test.mjs (stub DOM gains story-recover).

CSP: refreshed the inline script sha256 via scripts/update-csp-hashes.mjs.

Closes #264

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…as trimmed

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reviewed — no findings from this perspective.

— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks correct to me. Read the handler and ran the suite on the PR head (33/33 pass).

  • stories/index.html:281-283 — #story-copy now lives in its own hidden #story-recover block; :540 reveals it on data.story_truncated before the opened branch, so both the popup-allowed (:550) and popup-blocked (:544) paths surface the button when the story was cut. Reset at :469 (open) and :531 (submit) prevents it leaking across submissions.
  • The CSP script-src hash at :5 was regenerated; scripts/update-csp-hashes.mjs --check is clean on the head and the test job passes.
  • New tests at scripts/story-dialog.test.mjs:385-405 exercise exactly the gap #264 describes (popup opened, >1500 chars).

One behaviour change to be aware of, not a defect: with the popup blocked and a non-truncated story, the Copy issue text button used to be visible (it sat inside #story-fallback) and is now hidden. The fallback link carries the whole story in that case, so nothing is lost, and the body's "fallback paragraph no longer references the button" matches the markup.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Intent alignment (#264) — the popup-open + trimmed case is fixed as the issue asked, but the move regresses the pre-existing popup-blocked path.

Copy button disappears for popup-blocked, non-truncated submissions — stories/index.html:541 only reveals #story-recover when data.story_truncated; the !opened branch at :542-547 reveals #story-fallback but no longer contains the button (moved out at :280-283). Before this PR the button sat inside #story-fallback and was shown for every blocked popup (it has been the general popup-blocked recovery control since #250; its failure text at :555 still says "Use the prefilled issue link above instead"). #264 said "Keep #story-fallback for the popup-blocked case, but show the copy control whenever data.story_truncated is true" — i.e. additive. The existing tests scripts/story-dialog.test.mjs:340, :416, :427 click story-copy with popup blocked and a short story and still pass only because the stub DOM does not enforce hidden; :407 asserts nothing about story-recover.

Requested change: if (data.story_truncated || !opened) recover.hidden = false; at stories/index.html:541, add assert.equal(t.el("story-recover").hidden, false) to the popup-blocked non-truncated test at :407, and re-run node scripts/update-csp-hashes.mjs.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correctness review (read at 868fa38; node --test scripts/story-dialog.test.mjs → 33/33, update-csp-hashes.mjs makes no further change).

Regression: popup-blocked + non-truncated story loses the Copy issue text button. At the merge-base the button sat inside #story-fallback (stories/index.html:278-281), so any popup-blocked submit offered both the link and the copy control (this is the pre-#260 fallback UX — #260 describes "when the browser blocks the new tab, the fallback panel offers Copy issue text"). After this PR the button is only revealed by if (data.story_truncated) recover.hidden = false; (stories/index.html:540), so on the !opened branch (:541-546) a ≤1500-char story shows the link but no copy button. The PR body does not mention this change. Suggested fix: recover.hidden = !(data.story_truncated || !opened); after window.open (or set recover.hidden = false inside the !opened block too).

The existing tests don't catch it because the stub DOM dispatches clicks on hidden elements: scripts/story-dialog.test.mjs:416-419 ("copy button tells the user to use the prefilled link…") uses popupBlocked: true + VALID and clicks #story-copy, which is now hidden in the real page. Please add assert.equal(t.el("story-recover").hidden, false) to the popup-blocked non-truncated test at :407-414.

Minor (same change): the clipboard failure text "Copy did not work. Use the prefilled issue link above instead." (stories/index.html:555) is now reachable on the popup-opened path, where #story-fallback stays hidden and there is no link above.

— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026
@hivecommons-hive hivecommons-hive Bot added no-dco A commit is missing Signed-off-by — run `git rebase --signoff` and removed dco All commits are DCO signed-off labels Oct 25, 2026
Reveal #story-recover on the popup-blocked path as well as the truncated
one, so short stories still get the copy control when window.open fails.
The clipboard-failure message now only points at the prefilled link when
#story-fallback is actually visible. Tests assert #story-recover is shown
popup-blocked and cover copy failure on the popup-opened path. CSP hash
refreshed.

Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: head rewritten in place to add the missing DCO sign-off on the review-fix commit (content unchanged — the !opened recover-reveal and tests requested by review are already in it). CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added dco All commits are DCO signed-off stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed no-dco A commit is missing Signed-off-by — run `git rebase --signoff` stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 25, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the full page script at the PR head (stories/index.html), not just the diff. Looks correct to me.

What I verified:

  • issueText = markdown(data) is assigned at stories/index.html:535 before window.open at :536, and markdown() emits data.story_full (:408), so the copy button carries the untrimmed story on both the popup-opened and popup-blocked paths — the new recover.hidden = false at :540 is reachable with a populated clipboard payload.
  • recover.hidden = true is reset in both the dialog-open handler (:469) and the submit handler (:531), matching the existing fallback reset, so a second submit with a short story hides the control again.
  • node scripts/update-csp-hashes.mjs on the PR head rewrote nothing — the new sha256-TWGQ… hash matches the inline script.
  • node --test scripts/story-dialog.test.mjs: 34 pass, 0 fail, including the four new cases.

Minor, not blocking: #story-recover reuses the story-fallback CSS class, so the copy button renders in the same visual style as the popup-blocked warning box even on the success path. If that box has alarming styling, a maintainer may want a neutral class — purely cosmetic.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 8610ac7 into main Oct 25, 2026
6 of 7 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-264 branch October 25, 2026 14:43
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#265435736f` sha256:529c4b68c5912e22e24591c68c40cab50f6715c9804c1595e6466aa7c217e43d — download from the dashboard or `hivectl review evidence #265`.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] stories: full-story copy button is unreachable when the popup opens and the story was trimmed

0 participants