feat(popup-v2): wire reply edit and delete to threaded comments API#760
Merged
Merged
Conversation
Threads in PopupV2 can now edit and delete replies. Reply edits dispatch
to PUT /undoc/comments/{id} and reply deletes to DELETE
/undoc/comments/{id} via the box-ui-elements ThreadedComments client.
- Adds updateReplyAction and deleteReplyAction thunks. Both reject
upfront when the reply is not present in state so callers receive a
typed error instead of an opaque server response.
- Adds reducer cases that replace or remove the targeted reply on
fulfilled.
- Threads the canEdit permission through replyToTextMessage so the
edit affordance reflects backend permissions.
- Widens the Token type with TokenMap so consumers can pass a per-typed
file id resolver for avatar fetching.
7 tasks
replyToTextMessage was not setting updatedAt on the message, so the edit indicator never appeared on edited replies even though the backend returns modified_at on the comment object. The Reply type also did not declare the field.
8 tasks
jmcbgaston
reviewed
Jun 1, 2026
jmcbgaston
reviewed
Jun 1, 2026
jmcbgaston
reviewed
Jun 1, 2026
- Flip resolveStringToken discriminator to check the typed file id key before falling back to the literal shape. Avoids misrouting a TokenMap whose entry happens to contain a read or write key. - Drop dead getState resets at the end of two reply-thunk rejection tests; the surrounding lifecycle hooks already restore state. - Extend mockSelectorValues to accept per-test overrides and route the four token-flow avatar tests through it. Removes the duplicated mockUseSelector switch from each test.
jmcbgaston
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PUT/DELETE /undoc/comments/{id}).updateReplyActionanddeleteReplyActionthunks. Both reject upfront when the reply is missing from state instead of forwarding empty permissions to the server.canEditthroughreplyToTextMessageso the edit affordance reflects backend permissions.Tokentype withTokenMapso consumers can pass a per-typed-file-id resolver for avatar fetching.Test plan
PUT /undoc/comments/{id}?file_id={fileId}.DELETE /undoc/comments/{id}?file_id={fileId}.updateAnnotationAction(unchanged behavior).can_edit/can_deletepermission flags.{ read, write }literal, a function resolver, or a per-typed-file-id map.