Discussion Integration

Controlled state, DiscussionAdapter trait, and host wiring patterns.

  • Connecting a discussion thread to server actions or a custom backend adapter.
  • Verifying use_discussion hooks against controlled reply and focus signals.
  • Hold replies in a controlled Signal<Vec<DiscussionReply>>.
  • Implement DiscussionAdapter::submit_reply in your app (HTTP, server fn, etc.).
  • Bridge composer submit via DiscussionEvents::on_submit — call the adapter asynchronously and push the returned reply into your signal.
  • Optionally pass DiscussionAttachmentValidation and wire events.on_attachment_reject on DiscussionThread for client-side attach rules; re-validate attachments in DiscussionAdapter::submit_reply before persisting.

Only submit_reply is required. Override DiscussionAdapter::fetch_branch when your backend supports lazy branch loading (hidden_child_count, show-more drill-in). Override DiscussionAdapter::upload_attachment when the composer should persist attachment drafts to host storage before submit.

Hooks + mock adapter submit

Controlled replies signal, use_discussion hook count, and in-memory adapter bridge.

6
 
  • AC
    Alex Chen
    ·
    OP

    Main message with markdown and a design link.

    • SR
      Sam Rivera
      ··(edited)

      Agree — let's track open questions here.

      • JL
        Jordan Lee
        ·

        I'll draft the migration checklist.

        • PO
          Pat Okonkwo
          ·

          Depth-3 reply for tree testing.

    • MK
      Morgan Kim
      ·

      Separate branch at L1.

      • OA
        Orbital Agent
        ·
        Agent

        Based on the thread, the default depth is 4.

()()