Skip to content

Add per-event JSON copy and collapse controls to event log rows #313

Description

@mikewheeleer

Add copy-payload and collapse controls to event log rows

Description

src/app/events/page.tsx renders every event's payload in a fully expanded <pre>{JSON.stringify(e.payload, null, 2)}</pre> block with no way to copy a payload or collapse large ones, so a log of verbose payloads becomes a long scroll. This issue adds a per-row copy button and a collapse/expand affordance.

Requirements and context

  • Repository scope: StableRoute-Org/Stableroute-frontend only.
  • Add a "Copy JSON" control per row (reuse src/components/Button.tsx) that writes the pretty-printed payload to the clipboard via navigator.clipboard.writeText, feature-detected with a graceful no-op fallback.
  • Add a per-row collapse/expand toggle (using aria-expanded and aria-controls) that hides the <pre> block; default to collapsed when the serialized payload exceeds a threshold (e.g. 400 chars).
  • Keep the type label, the role="alert" error region, row keying by e.id, and chronological order intact.
  • Do not log payloads to the console.

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b enhancement/events-03-copy-collapse
  • Implement changes
  • Test and commit

Test and commit

  • Run npm run lint, npm test, and npm run build.
  • Cover edge cases: small payload, large payload default-collapsed, clipboard available, and clipboard absent.
  • Include the full npm test output in the PR description.

Example commit message

feat: add copy-JSON and collapse controls to event log rows

Guidelines

  • Minimum 95 percent test coverage for impacted modules.
  • Clear, reviewer-focused documentation.
  • Timeframe: 96 hours.

Community & contribution rewards

  • 💬 Join the StableRoute community on Discord for questions, reviews, and faster merges: https://discord.gg/37aCpusvx
  • ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions