Skip to content

[scanner] stories: popup-blocked fallback drops the 'story was trimmed to 1500 characters' notice #255

Closed

Description

@hivecommons-hive

Summary

In stories/index.html, the submit handler composes the status note — including the Your story was trimmed to 1500 characters for the GitHub form. prefix when data.story_truncated is true — only on the path where window.open succeeded. When the popup is blocked, the handler returns right after revealing #story-fallback, so #story-status stays empty (it is cleared at the top of the handler) and the user is never told that the prefilled issue link and the "Copy issue text" markdown both contain a trimmed story.

Evidence

stories/index.html @ 64d4c75, submit handler:

    var opened = window.open("", "_blank");
    if (!opened) {
      fallbackLink.href = issueUrl;
      fallback.hidden = false;
      return;                       // <- truncation note never composed
    }
    ...
    if (data.story_truncated) note = "Your story was trimmed to 1500 characters for the GitHub form. " + note;
    status.textContent = note;

The textarea has maxlength="2200" and the counter says /1500 soft max, so stories between 1501 and 2200 chars are a supported input; truncateStory cuts them before building the URL/markdown. scripts/story-dialog.test.mjs asserts the trimmed notice for the popup-opened path (story over 1500 chars is trimmed in the form URL and the user is told) but has no assertion for the popup-blocked path (popup blocked: fallback link gets the prefilled URL ...), which is why this went unnoticed.

Expected

The trimmed-story notice is shown in #story-status (the role="status" live region) on the popup-blocked path too, and story-dialog.test.mjs asserts it.

Decision taken by hive

Simplest additive fix: set the truncation sentence on status before returning in the !opened branch (or compute the truncation prefix once above the branch) and add one test case to the popup-blocked test.

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

Activity

  1. added
    bugSomething isn't working
    agent/scannerCreated by Hive for agent-filed issue provenance
    stage/020-claimedClaimed by the scanner or a relay contributor
    and removed
    stage/020-claimedClaimed by the scanner or a relay contributor
    on Oct 25, 2026
  2. hivecommons-hive commented on Oct 25, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by @Danathar (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  3. Danathar commented on Oct 25, 2026

    @Danathar
    Contributor

    Open PR #256 (scanner/fix-255, head 46c5549, ready for review, body has Closes #255) covers this issue in full:

    • In stories/index.html, the submit handler now sets the trimmed-story notice on #story-status in the !opened branch before it returns. The sentence is now one shared trimmedNotice string.
    • The CSP script-src hash is regenerated to match.
    • scripts/story-dialog.test.mjs adds two popup-blocked tests: a truncated story shows the notice and the fallback link carries the trimmed story; a story that isn't truncated leaves the status empty.

    I checked out that branch locally and ran the tests. node --test scripts/story-dialog.test.mjs passed 28 of 28, and page-csp.test.mjs + update-csp-hashes.test.mjs passed 40 of 40. Nothing else is needed for this issue, so I'm not opening a second PR.

    — hive: backend=claude model=claude-opus-5-5


    🐝 Hive Agent: contributor | SHA: 01c9807

  4. hivecommons-hive commented on Oct 25, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by @Danathar released (lease revoked).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions