Skip to content

Quorum paste link#2319

Merged
simo6529 merged 2 commits intomainfrom
quorum-paste-link
Apr 28, 2026
Merged

Quorum paste link#2319
simo6529 merged 2 commits intomainfrom
quorum-paste-link

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Apr 28, 2026

Summary by CodeRabbit

  • New Features

    • Added support for quorum participation drops with proper rendering and link copying behavior.
    • Implemented proper handling of nested and embedded drops within quorum contexts.
  • Tests

    • Added comprehensive test coverage for quorum drop rendering, link copying, and mobile menu interactions.
    • Verified quorum-specific behavior for different drop types and recursion scenarios.

Signed-off-by: Simo <simo@6529.io>
Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

This PR adds quorum participation drop rendering support by introducing a new QuorumParticipationDropLinkPreview component and wiring an isQuorumWave predicate through seize link handlers and copy-link flows. Embedding path and depth parameters are propagated through the wave drop component hierarchy to support nested quote rendering.

Changes

Cohort / File(s) Summary
New Quorum Components
components/waves/quorum/QuorumParticipationDropLinkPreview.tsx, components/waves/quorum/QuorumProposalCompactContent.tsx, components/waves/drops/participation/participationRenderer.types.ts
Introduces new QuorumParticipationDropLinkPreview component that fetches and renders participatory drops with query support for both dropId and serialNo. Expands ParticipationDropProps type with embedding/quote configuration fields. Updates CompactMarkdownProps to include embed path and depth props.
Seize Link Handler Updates
components/drops/view/part/dropPartMarkdown/handlers/seize.tsx, components/drops/view/part/dropPartMarkdown/linkHandlers.tsx, components/drops/view/part/DropPartMarkdown.tsx
Extends seize handler configuration with isQuorumWaveById predicate. Quote and drop handling now detect quorum waves and short-circuit to QuorumParticipationDropLinkPreview instead of default quote rendering. LinkRendererConfig type updated to accept the quorum wave predicate.
Wave Drop Component Hierarchy
components/waves/drops/WaveDropContent.tsx, components/waves/drops/WaveDropPart.tsx, components/waves/drops/WaveDropPartContent.tsx, components/waves/drops/WaveDropPartContentMarkdown.tsx, components/waves/drops/WaveDropPartDrop.tsx, components/waves/drops/participation/EndedParticipationDrop.tsx, components/waves/drops/participation/OngoingParticipationDrop.tsx, components/waves/drops/participation/ParticipationDropContent.tsx
Propagates embedding/quote configuration through component hierarchy with new optional props (embedPath, quotePath, embedDepth, maxEmbedDepth). Introduces memoized path computation in WaveDropPartContentMarkdown to track current quote path and drop embed path while respecting depth constraints.
Copy Link Features
components/waves/drops/WaveDropActionsCopyLink.tsx, components/waves/drops/WaveDropMobileMenu.tsx, helpers/waves/drop-copy-link.helpers.ts
Reads isQuorumWave from SeizeSettings and forwards it to getCopiedDropLink. Helper function now recognizes participatory drops in quorum waves and generates canonical drop URLs (using ?drop=id) instead of serial-based URLs for quorum participation drops.
Test Coverage
__tests__/components/drops/.../seize.test.tsx, __tests__/components/waves/drops/WaveDropActionsCopyLink.test.tsx, __tests__/components/waves/drops/WaveDropMobileMenu.test.tsx, __tests__/components/waves/quorum/QuorumParticipationDropLinkPreview.test.tsx
Introduces comprehensive test suite for quorum features including tests for seize handler quorum detection, copy-link behavior for quorum drops, mobile menu quorum integration, and full QuorumParticipationDropLinkPreview component behavior with API mocking.

Sequence Diagram

sequenceDiagram
    participant User
    participant DropPartMarkdown
    participant SeizeHandler
    participant QuorumCheck
    participant QuorumDropComponent
    participant API

    User->>DropPartMarkdown: Render markdown with seize link
    DropPartMarkdown->>SeizeHandler: Create handlers with isQuorumWaveById
    SeizeHandler->>QuorumCheck: Check if waveId is quorum
    
    alt Is Quorum Wave
        QuorumCheck-->>SeizeHandler: true
        SeizeHandler->>QuorumDropComponent: Render QuorumParticipationDropLinkPreview
        QuorumDropComponent->>API: Fetch drop by dropId or serialNo
        API-->>QuorumDropComponent: Drop data
        QuorumDropComponent->>QuorumDropComponent: Render with hideLink & showInteractions=false
    else Is Non-Quorum Wave
        QuorumCheck-->>SeizeHandler: false
        SeizeHandler->>DropPartMarkdown: Use default quote rendering
    end
    
    QuorumDropComponent-->>User: Rendered quorum drop preview
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #1556: Modifies seize link handling code (handlers/seize.tsx) for URL parsing and getDropId refactoring—related to the handler extension in this PR.
  • #1919: Adds embed/quote path and depth plumbing through the same component hierarchy (handlers/seize.tsx, linkHandlers, DropPartMarkdown)—this PR builds directly on that foundation.
  • #2270: Directly related—adds isQuorumWave predicate to SeizeSettingsContext and wires it into link/handler logic, enabling the quorum detection feature added in this PR.

Suggested reviewers

  • ragnep
  • prxt6529

Poem

🐰 A rabbit's ode to quorum drops!
Quorum participation blooms with grace,
As seize links guide us to the right place—
Embed paths mark the journey deep,
While quorum drops their secrets keep.
No more guessing where to go,
The copy-link will help you know! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Quorum paste link' accurately describes the primary change: enabling quorum-specific behavior for the paste/copy-link functionality across multiple wave drop components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch quorum-paste-link

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@components/waves/quorum/QuorumParticipationDropLinkPreview.tsx`:
- Around line 35-48: The toSerialNumber function currently uses Number.parseInt
which accepts partial strings like "7abc"; update to strictly validate input:
for numbers ensure Number.isFinite(serialNo) && Number.isInteger(serialNo) and
return it (or null), and for strings only accept /^[0-9]+$/ (optionally trim)
before calling Number.parseInt(serialNo, 10); otherwise return null. Refer to
the toSerialNumber function to add the regex check for string inputs and tighten
the numeric check.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0370efe9-257f-4cb2-9a55-58ec58716424

📥 Commits

Reviewing files that changed from the base of the PR and between 1ed3c5d and 57716e7.

📒 Files selected for processing (21)
  • __tests__/components/drops/view/part/dropPartMarkdown/handlers/seize.test.tsx
  • __tests__/components/waves/drops/WaveDropActionsCopyLink.test.tsx
  • __tests__/components/waves/drops/WaveDropMobileMenu.test.tsx
  • __tests__/components/waves/quorum/QuorumParticipationDropLinkPreview.test.tsx
  • components/drops/view/part/DropPartMarkdown.tsx
  • components/drops/view/part/dropPartMarkdown/handlers/seize.tsx
  • components/drops/view/part/dropPartMarkdown/linkHandlers.tsx
  • components/waves/drops/WaveDropActionsCopyLink.tsx
  • components/waves/drops/WaveDropContent.tsx
  • components/waves/drops/WaveDropMobileMenu.tsx
  • components/waves/drops/WaveDropPart.tsx
  • components/waves/drops/WaveDropPartContent.tsx
  • components/waves/drops/WaveDropPartContentMarkdown.tsx
  • components/waves/drops/WaveDropPartDrop.tsx
  • components/waves/drops/participation/EndedParticipationDrop.tsx
  • components/waves/drops/participation/OngoingParticipationDrop.tsx
  • components/waves/drops/participation/ParticipationDropContent.tsx
  • components/waves/drops/participation/participationRenderer.types.ts
  • components/waves/quorum/QuorumParticipationDropLinkPreview.tsx
  • components/waves/quorum/QuorumProposalCompactContent.tsx
  • helpers/waves/drop-copy-link.helpers.ts

Comment thread components/waves/quorum/QuorumParticipationDropLinkPreview.tsx
@simo6529 simo6529 merged commit 6d26fe3 into main Apr 28, 2026
8 checks passed
@simo6529 simo6529 deleted the quorum-paste-link branch April 28, 2026 05:01
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.

2 participants