Skip to content

#3460952: Implement add section and add element buttons

Closes #3460952

This MR:

  • Implements add section/component button.
    • The logic is if a node is on the root level, than the Add Section button renders. If the node has a parent, then the Add component button renders.
  • All primary menu related actions now live in its own slice called primaryMenuSlice.ts
  • Introduces a new ClickToInsertState in the slice.
  • The logic to handle where to insert a node based on if it is a component vs. section lives in clickToInsertHandler in List.tsx
  • AddButton component dispatches necessary info to the primaryMenuSlice which is used by the clickToInsertHandler.
  • Replaced Submenu with another Menubar.Root so we can control opening the inner menu in redux.
  • Overrode Radix's blue color to our blue that is a WCAG compliant one so we can pass it in to the Radix API
  • Adds a test in add-section.cy.js
    • There is only a test for 'Add section' because we aren't able to insert components inside a slot yet.

Things to note:

  • The first level menu with the icons and that tooltips will be removed in [#3462413] to match the updated designs.
Edited by Harumi Jang

Merge request reports