Skip to content

chore: remove legacy reply editor orphaned by threaded annotation cleanup - #839

Merged
kduncanhsu merged 2 commits into
box:masterfrom
kduncanhsu:chore/remove-legacy-reply-editor
Nov 19, 2026
Merged

kduncanhsu merged 2 commits into
box:masterfrom
kduncanhsu:chore/remove-legacy-reply-editor

Conversation

@kduncanhsu

@kduncanhsu kduncanhsu commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #823. Removing the isThreadedAnnotation flag deleted PopupReply, which was the only consumer of the legacy Draft.js reply editor. That left the editor components, plus the props and store state that only fed them, unreachable. This PR removes them. There is no behavior change, since PopupV2 was already the only popup rendered.

Changes

Deleted orphaned components

  • components/ReplyForm/: ReplyForm, ReplyFormContainer, ReplyButton, types.ts, styles, mocks, and tests
  • components/ReplyField/: ReplyField, ReplyFieldContainer, MentionItem, withMentionDecorator, styles, and tests
  • components/Popups/PopupList.tsx and PopupList.scss, plus their tests (only used by ReplyField)
  • components/ItemList/ (only used by PopupList)

Popup layer

  • popup/PopupLayer.tsx: Removed the unused setMessage and message props. handleSubmit now requires text, which PopupV2 always passes.
  • popup/PopupContainer.tsx: Removed message from mapStateToProps and setMessage from mapDispatchToProps

Store

  • store/creator: Removed the cursor and message state, setCursorAction, setMessageAction, getCreatorCursor, and getCreatorMessage
  • store/users: Removed the getCollaborators selector, which was only used by ReplyFieldContainer. PopupV2 uses the result of fetchCollaboratorsAction directly.
  • store/options: Removed the getScale selector, whose only production caller was the PopupReply removed in fix: remove isThreadedAnnotation feature flag #823. The scale state stays because BaseAnnotator.init still sets it.

Messages and styles

  • components/Popups/messages.ts: Removed ariaLabelReplyField, buttonCancel, buttonPost, fieldPlaceholder, and popupListPrompt. The locale files will be updated by the translation pipeline.
  • components/Popups/PopupBase.scss: Removed the .ba-ItemList, .ba-ReplyForm, and .ba-Popup-footer rules

Intentionally kept

  • draft-js, formik, scroll-into-view-if-needed, and the draft-js/immutable resolution stay in package.json, because box-ui-elements declares them as peer dependencies.

Testing

  • All 108 test suites / 1,090 tests pass
  • TypeScript compiles cleanly
  • ESLint passes with zero warnings; Stylelint passes
  • Production build succeeds

Summary by CodeRabbit

  • Changes
    • Removed the in-app reply and mention composition interface, including collaborator suggestions and reply submission controls.
    • Popup creation now uses the submitted text directly; saved message and cursor state are no longer maintained.
    • Removed the popup list and reply-related interface elements.

…anup

Removing the isThreadedAnnotation flag (box#823) deleted PopupReply, which was
the only consumer of the Draft.js-based reply editor. This removes the code
that became unreachable as a result:

- ReplyForm, ReplyField, MentionItem, withMentionDecorator, PopupList, and
  ItemList components, with their styles, mocks, and tests
- Unused setMessage/message props from PopupLayer and PopupContainer
- Creator store cursor and message state, along with setCursorAction,
  setMessageAction, getCreatorCursor, and getCreatorMessage
- The getCollaborators selector
- Popup messages and PopupBase styles used only by the removed editor
@kduncanhsu
kduncanhsu requested a review from a team as a code owner November 19, 2026 22:19
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Duncan Hsu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

This pull request removes reply composition and collaborator mention-selection components, along with related styles, exports, tests, and creator cursor/message state. Popup submission now requires text and uses it directly for staged highlights, regions, and drawings.

Changes

Legacy Reply UI and Creator State

Layer / File(s) Summary
Remove creator cursor and message state
src/store/creator/*, src/popup/PopupContainer.tsx, src/popup/PopupLayer.tsx, related tests and mocks
Creator state, actions, and selectors no longer include cursor or message. Popup props no longer carry message state, and popup submission uses its required text directly.
Remove collaborator mention selection
src/components/ItemList/*, src/components/Popups/PopupList*, src/components/ReplyField/*, src/store/users/*, src/components/Popups/PopupBase.scss
The list, popup, and reply-field mention-selection components and collaborator selector are removed, along with their supporting tests and styles.
Remove reply form and validation
src/components/ReplyForm/*, src/components/Popups/messages.ts, src/components/Popups/PopupBase.scss
The reply form, button, container, and associated types are removed. Their tests, mocks, form messages, and footer styles are also removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related PRs

  • box/box-annotations#823: Removes non-threaded annotation paths and PopupReply; this pull request continues the related removal of reply and popup components.

Suggested reviewers: ahorowitz123, jackiejou, jstoffan

Merge Risk: Minimal · up to ad00c

This cleanup removes unused reply editor and mention-selection code and the creator cursor and message state. The popup submit path is stated to keep working, since PopupV2 already supplies the text. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title says the PR removes the legacy reply editor that was orphaned by the threaded annotation cleanup. The raw summary confirms that the change deletes the ReplyField, ReplyForm, ReplyButton, Pop…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title says the PR removes the legacy reply editor that was orphaned by the threaded annotation cleanup. The raw summary confirms that the change deletes the ReplyField, ReplyForm, ReplyButton, PopupList, and ItemList components, along with their styles, mocks, tests, and related store state. The title is specific and matches the main change. It is a 'chore' prefix, which is conventional for cleanup work. It is 73 characters, within a typical single-line length.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the popup flow,
The cursor and old message go.
No mention list or form remains,
Text now travels through the staged lanes.
I thump my paws: the change is done!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd141851-ecaf-4b8b-842d-58eb7639801d
Commits

Reviewing files that changed from the base of the PR and between b4f18e5 and ad00ce1.

Files selected for processing: 52

  • src/components/ItemList/ItemList.scss
  • src/components/ItemList/ItemList.tsx
  • src/components/ItemList/ItemRow.scss
  • src/components/ItemList/ItemRow.tsx
  • src/components/ItemList/__mocks__/ItemRow.tsx
  • src/components/ItemList/__tests__/ItemList-test.tsx
  • src/components/ItemList/__tests__/ItemRow-test.tsx
  • src/components/ItemList/index.ts
  • src/components/Popups/PopupBase.scss
  • src/components/Popups/PopupList.scss
  • src/components/Popups/PopupList.tsx
  • src/components/Popups/__tests__/PopupList-test.tsx
  • src/components/Popups/messages.ts
  • src/components/ReplyField/MentionItem.scss
  • src/components/ReplyField/MentionItem.tsx
  • src/components/ReplyField/ReplyField.scss
  • src/components/ReplyField/ReplyField.tsx
  • src/components/ReplyField/ReplyFieldContainer.tsx
  • src/components/ReplyField/__tests__/MentionItem-test.tsx
  • src/components/ReplyField/__tests__/ReplyField-test.tsx
  • src/components/ReplyField/__tests__/ReplyFieldContainer-test.tsx
  • src/components/ReplyField/__tests__/withMentionDecorator-test.tsx
  • src/components/ReplyField/index.ts
  • src/components/ReplyField/withMentionDecorator.tsx
  • src/components/ReplyForm/ReplyButton.tsx
  • src/components/ReplyForm/ReplyForm.scss
  • src/components/ReplyForm/ReplyForm.tsx
  • src/components/ReplyForm/ReplyFormContainer.tsx
  • src/components/ReplyForm/__mocks__/ReplyForm.tsx
  • src/components/ReplyForm/__mocks__/ReplyFormContainer.tsx
  • src/components/ReplyForm/__mocks__/index.ts
  • src/components/ReplyForm/__tests__/ReplyButton-test.tsx
  • src/components/ReplyForm/__tests__/ReplyForm-test.tsx
  • src/components/ReplyForm/__tests__/ReplyFormContainer-test.tsx
  • src/components/ReplyForm/index.ts
  • src/components/ReplyForm/types.ts
  • src/popup/PopupContainer.tsx
  • src/popup/PopupLayer.tsx
  • src/popup/__tests__/PopupContainer-test.tsx
  • src/popup/__tests__/PopupLayer-test.tsx
  • src/region/__tests__/RegionCreation-test.tsx
  • src/store/__mocks__/index.ts
  • src/store/creator/__mocks__/creatorState.ts
  • src/store/creator/__tests__/reducer-test.ts
  • src/store/creator/__tests__/selectors-test.ts
  • src/store/creator/actions.ts
  • src/store/creator/reducer.ts
  • src/store/creator/selectors.ts
  • src/store/creator/types.ts
  • src/store/users/__tests__/selectors-test.ts
  • src/store/users/index.ts
  • src/store/users/selectors.ts
Files with no reviewable changes: 48

  • src/components/ItemList/ItemList.scss
  • src/components/ItemList/ItemList.tsx
  • src/components/ItemList/ItemRow.scss
  • src/components/ItemList/ItemRow.tsx
  • src/components/ItemList/mocks/ItemRow.tsx
  • src/components/ItemList/tests/ItemList-test.tsx
  • src/components/ItemList/tests/ItemRow-test.tsx
  • src/components/ItemList/index.ts
  • src/components/Popups/PopupBase.scss
  • src/components/Popups/PopupList.scss
  • src/components/Popups/PopupList.tsx
  • src/components/Popups/tests/PopupList-test.tsx
  • src/components/Popups/messages.ts
  • src/components/ReplyField/MentionItem.scss
  • src/components/ReplyField/MentionItem.tsx
  • src/components/ReplyField/ReplyField.scss
  • src/components/ReplyField/ReplyField.tsx
  • src/components/ReplyField/ReplyFieldContainer.tsx
  • src/components/ReplyField/tests/MentionItem-test.tsx
  • src/components/ReplyField/tests/ReplyField-test.tsx
  • src/components/ReplyField/tests/ReplyFieldContainer-test.tsx
  • src/components/ReplyField/tests/withMentionDecorator-test.tsx
  • src/components/ReplyField/index.ts
  • src/components/ReplyField/withMentionDecorator.tsx
  • src/components/ReplyForm/ReplyButton.tsx
  • src/components/ReplyForm/ReplyForm.scss
  • src/components/ReplyForm/ReplyForm.tsx
  • src/components/ReplyForm/ReplyFormContainer.tsx
  • src/components/ReplyForm/mocks/ReplyForm.tsx
  • src/components/ReplyForm/mocks/ReplyFormContainer.tsx
  • src/components/ReplyForm/mocks/index.ts
  • src/components/ReplyForm/tests/ReplyButton-test.tsx
  • src/components/ReplyForm/tests/ReplyForm-test.tsx
  • src/components/ReplyForm/tests/ReplyFormContainer-test.tsx
  • src/components/ReplyForm/index.ts
  • src/components/ReplyForm/types.ts
  • src/popup/PopupContainer.tsx
  • src/popup/tests/PopupContainer-test.tsx
  • src/popup/tests/PopupLayer-test.tsx
  • src/region/tests/RegionCreation-test.tsx
  • src/store/mocks/index.ts
  • src/store/creator/mocks/creatorState.ts
  • src/store/creator/actions.ts
  • src/store/creator/selectors.ts
  • src/store/creator/types.ts
  • src/store/users/tests/selectors-test.ts
  • src/store/users/index.ts
  • src/store/users/selectors.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@kduncanhsu
kduncanhsu merged commit 3b0f48f into box:master Nov 19, 2026
11 of 12 checks passed
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.

3 participants