Skip to content

feat(composer): edit shared posts and share-to-squad in the new composer - #6422

Open
tsahimatsliah wants to merge 21 commits into
claude/mobile-comment-input-fix-2e164bfrom
claude/edit-post-new-composer
Open

feat(composer): edit shared posts and share-to-squad in the new composer#6422
tsahimatsliah wants to merge 21 commits into
claude/mobile-comment-input-fix-2e164bfrom
claude/edit-post-new-composer

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Aug 4, 2026

Copy link
Copy Markdown
Member

Changes

Two remaining old-composer surfaces move to SmartComposerModal: editing a shared post and sharing a post to a squad.

Editing a share in the composer

Editing a shared link still opened the old /posts/[id]/edit page, with the old top-toolbar editor, while every other composer surface had moved to SmartComposerModal.

Two reasons, not one:

  1. PostOptionButton only routed Freeform and Welcome posts to the modal; everything else fell through to router.push('<permalink>/edit').
  2. Even if it had routed there, the modal forced kind = 'text' whenever editPost was set — it had no way to represent a share.

What changed:

  • Kind is derived from editPost.type instead of hard-coded to text.
  • Commentary is prefilled the way the old page derived it: a share posted without commentary carries the shared post's own title, which is not the author's writing, so it is offered back as an empty field rather than as their text.
  • The preview is seeded from editPost.sharedPost instead of being refetched — there is no URL being typed for it to resolve.
  • The URL is locked (LinkForm isUrlLocked): only the commentary is editable, which is all updateSquadPost accepts. The URL field and the preview's remove button are dropped, and focus starts in the commentary.
  • submitLink gained the edit branch it never had — only submitText handled editPostId. It routes through onUpdateSharePost, including the moderation path, which completes without a toast of its own (the plain update path already toasts from usePostToSquad, so adding one there would double it).
  • Submit validation no longer demands a resolved URL/preview pair while editing, which would otherwise leave the button permanently disabled.
  • Dirty-tracking compares the commentary rather than the text fields, so closing an untouched share edit no longer prompts "Discard changes?".

Share to squad through the composer

Clicking a squad avatar in ShareBar, DiscussionShareRow, or the Share modal opened CreateSharedPostModal — the old editor. All three now open SmartComposerModal seeded for the share:

  • The post rides in as the link preview (preview={post}, initialUrl={post.permalink}), so nothing is refetched and the composer's existing internal-share path applies: preview.id → addPostToSquad, moderation when the squad requires it, and multi-squad sharing via sharedPostId — a capability the old modal never had.
  • The clicked squad is preselected via initialSquadId, but the audience stays editable.
  • A new onPosted callback on SmartComposerModal carries the ShareToSquad analytics event the old modal fired from onSharedSuccessfully.
  • CreateSharedPostModal is deleted along with its spec and its LazyModal registration; SocialShare renders the composer inline for the same dep-cycle reason it rendered the old modal inline.

What deliberately did not move

  • Moderation items keep /posts/[id]/edit. That page edits a pending submission (useSourcePostModerationById), which is a different entity from a post — the composer cannot represent it.
  • LiveRoomChatPanel stays as it is. It is a chat input, not a post composer: one line, send-on-enter, in a sidebar. A full-screen drawer and a bottom action bar would make it worse.
  • ControlledMarkdownInput (profile bio) is a plain markdown field, not a composer.

Dead code removed

CreateSharedPostModal, CreateLiveRoomForm, and CreatePoll were each left referenced by nothing (or only their own specs), so they are deleted rather than carried forward.

Events

No new tracking events — StartShareToSquad/ShareToSquad keep firing from the same triggers.

Experiment

No new experiments.

Preview domain

https://claude-edit-post-new-composer.preview.app.daily.dev

Editing a shared link still opened the old /posts/[id]/edit page: the
menu only routed freeform and welcome posts to SmartComposerModal, and
the modal forced kind to 'text' whenever editPost was set, so it could
not represent a share at all.

- Derive the kind from editPost.type, prefill the commentary the way the
  old page did (a share with no commentary carries the shared post's own
  title, which is not the author's text), and seed the preview from the
  post rather than refetching it
- Lock the URL while editing: only the commentary is editable, matching
  what the API accepts
- Add the missing edit branch to submitLink, including the moderation
  path, which completes without a toast of its own
- Route share posts to the modal; moderation items keep the page, which
  edits a pending submission the composer cannot represent
- Delete CreateLiveRoomForm and CreatePoll, referenced by nothing

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Aug 27, 2026 2:32pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Aug 27, 2026 2:32pm

Request Review

Squad share triggers (ShareBar, DiscussionShareRow, Share modal) now open
SmartComposerModal seeded with the post as the link preview and the squad
preselected, replacing CreateSharedPostModal. The composer's link flow
already covers internal shares (preview.id -> addPostToSquad, moderation,
multi-squad via sharedPostId), so the old modal is deleted along with its
lazy-modal registration. A new onPosted callback carries the ShareToSquad
analytics event that the old modal's onSharedSuccessfully used to fire.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tsahimatsliah tsahimatsliah changed the title feat(composer): edit shared posts in the new composer feat(composer): edit shared posts and share-to-squad in the new composer Aug 4, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A composer opened pre-filled (share-to-squad, ?share= deep links) counted
its own seed as unsaved changes, so closing it untouched asked to discard
a draft the user never wrote.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tsahimatsliah and others added 2 commits August 5, 2026 00:43
Comments explaining what the code already says, narrating fixed bugs, or
restating test names are removed; the ones that survive state constraints
the code cannot show (platform quirks, cross-file contracts, do-not-readd
traps).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- share-edit save now shows its in-flight state (isUpdatePostLoading joins
  isPosting)
- the mobile composer drawer portals to the root, so opening it from the
  Share modal's drawer no longer traps it in a transformed ancestor
- editing always targets the post's own source instead of falling back to
  the personal audience when the squad is no longer postable
- a moderated share edit is no longer logged as a post creation
- the share-edit dirty check trims like the seed comparison does
- a locked link with no surviving shared post renders no empty preview card
- CommentMarkdownInput skips the visualViewport subscription when it fills
  its container (the value was discarded)
- the locked-link no-refetch spec now actually exercises the guard

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tsahimatsliah and others added 2 commits August 5, 2026 01:21
Live verification found two defects: a freeform post with no body (title +
cover) could never save a title edit because submit demanded a body, and
the desktop 'Add a comment' composer opened unfocused — the by-id focus
helper races the lazy chunk and TipTap's async editor, so the composer now
owns its focus through the queued autofocus path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tsahimatsliah and others added 2 commits August 5, 2026 09:20
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
rebelchris and others added 2 commits August 27, 2026 16:10
The base branch backed the edit-validation relaxation out of the comments
PR; it belongs here, where useComposerSubmit.spec covers it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rebelchris
rebelchris changed the base branch from main to claude/mobile-comment-input-fix-2e164b August 27, 2026 14:12
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