Ghost/apps
Kevin Ansfield 0ac587e94a
Refactored comments-ui form management (#21621)
ref https://linear.app/ghost/issue/PLG-230
closes https://linear.app/ghost/issue/PLG-256

Adding an in-reply-to reference link/snippet to reply forms was proving difficult with the previous setup due the amount of data that needed to be passed up and down a deeply nested component tree. This refactor lays the groundwork for making that easier and aims to make form autoclose behaviour more centralised by keeping the open form state in app context and the opening/closing of forms in actions so there's less need for messy local state and to drill functions down the component tree.

- replaces `openFormCount` context state with an `openCommentForms` array
  - keeping detailed open form references in the application state means the display of forms is centrally managed rather than managed via local state inside components
  - it simplifies some of the problems faced with the `<PublishedComment>` component that previously managed form display. That component is re-used for both the top-level comment as well as replies even though replying on a reply puts the top-level comment into reply mode meaning we had a mess of local state and passed-through functions to work around the component having varying behaviour depending on nesting level
  - `openFormCount` is still available on the application state via `useMemo` on the provider meaning the implementation of `openCommentForms` is hidden from app code that just needs to know if forms are open
- removes `<AutocloseForm>` as the autoclose behaviour is now controlled via the `openCommentForm` action
- updated `<Form>` so it manages the "has unsaved changes" properties on `openFormComments` ready for use by `openCommentForm`'s autoclosing behaviour
2024-11-14 18:26:23 +00:00
..
admin-x-activitypub Stopped HTML cards with fixed width from causing overflow in the drawer 2024-11-14 17:45:59 +00:00
admin-x-demo 🌐 Updated packages for improved i18n support (#21218) 2024-10-03 22:27:16 +00:00
admin-x-design-system Updated menu items to not trigger parent element on click (#21618) 2024-11-14 11:13:37 +00:00
admin-x-framework Improved ActivityPub drawer view UI (#21521) 2024-11-07 15:59:29 +00:00
admin-x-settings 🐛 Fixed marketplace theme installation route (#21616) 2024-11-14 03:41:47 +00:00
announcement-bar Added Dev Container setup (#21279) 2024-10-24 11:15:08 -07:00
comments-ui Refactored comments-ui form management (#21621) 2024-11-14 18:26:23 +00:00
portal Updated Signup Page (#21434) 2024-11-05 10:51:14 +01:00
signup-form Added Dev Container setup (#21279) 2024-10-24 11:15:08 -07:00
sodo-search 🐛 Fixed search state bug & missing last result (#21417) 2024-10-28 12:50:15 +07:00