Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Editor Menu #3028

Merged
merged 16 commits into from
May 3, 2024
Merged

feat: Editor Menu #3028

merged 16 commits into from
May 3, 2024

Conversation

ianjon3s
Copy link
Contributor

@ianjon3s ianjon3s commented Apr 17, 2024

Screen.Recording.2024-04-26.at.14.50.12.mov

What does this PR do?

  • Adds EditorMenu (behind a feature flag)
  • Handles routes, layouts and views
  • Displays current flow settings components in new locations
    • Do we really want this, or just the "useable" components?

Next steps

  • Handle "View edit history button"
  • Drop feature flag, drop "Flow Settings" from top right menu

Copy link

github-actions bot commented Apr 17, 2024

Removed vultr server and associated DNS entries

@ianjon3s ianjon3s force-pushed the ian/editor-sidebar-menu branch 2 times, most recently from d04e959 to 12b0ab0 Compare April 23, 2024 15:36
@DafyddLlyr DafyddLlyr force-pushed the ian/editor-sidebar-menu branch from 6358329 to a079028 Compare April 26, 2024 12:42
@@ -17,37 +17,33 @@ const TestEnvironmentWarning = styled(Box)(({ theme }) => ({
}));

const TestEnvironmentBanner: React.FC = () => {
const [showWarning, setShowWarning] = useState(true);
const [isTestEnvBannerVisible, hideTestEnvBanner] = useStore(state => [state.isTestEnvBannerVisible, state.hideTestEnvBanner]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now controlled at a store level as it was being re-rendered (and therefore going back to visible) on each route change.

I think this is the same issue we're seeing with everything re-rendering when we got to /nodes routes. See comment below on this 👍


const isActive = (route: string) => lastChunk.url.pathname.endsWith(route);

const routes = [
Copy link
Contributor

@DafyddLlyr DafyddLlyr Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ianjon3s This pattern of splitting up "content" and "code" is a good one to be aware of.

We now have a list of items we're iterating over with the .map() below.

It's now a bit simpler to add or remove a menu item, or control the visual appearance of all of them consistently 👍

const [flow, ...breadcrumbs] = req.params.flow.split(",");
return (
<>
<FlowEditor key={flow} flow={flow} breadcrumbs={breadcrumbs} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This duplication of FlowEditor is worth being aware of. It matches the current setup where this is attached the view and duplicated that way (just a <span/> is rendered in the current setup.

It's the cause of our re-rendering when we go to /node routes - react-navi is re-rendering all other views, even those unaffected for some reason.

I repeated previous attempts with memoization here to attempt to solve this with the same results as before.

The Header is also re-rendering when children change, so this may be a wider (or higher level) issue. Happy to carry on looking into it without holding up this PR.

})),
),

"/submissions-log": compose(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not hidden these routes behind a feature flag as there's nothing sensitive or different here, and they've not very discoverable.

@DafyddLlyr DafyddLlyr changed the title wip: Editor sidebar menu feat: Editor Menu Apr 26, 2024
@DafyddLlyr DafyddLlyr marked this pull request as ready for review April 26, 2024 14:38
@DafyddLlyr DafyddLlyr requested a review from a team April 26, 2024 14:39
@DafyddLlyr DafyddLlyr mentioned this pull request Apr 26, 2024
3 tasks
@ianjon3s ianjon3s force-pushed the ian/editor-sidebar-menu branch from 26a8058 to 29b329f Compare April 30, 2024 11:19
@DafyddLlyr
Copy link
Contributor

Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this works as expected for me! Thanks especially for tweaking some component heirarchies and starting to make a dent in the unexpected re-renders.

Based on level of surprise/confusion this week to new editor styles, merging behind a feature flag definitely feels right for now.

For me, the left menu icons are visually competing a bit with the icons/buttons at the top of the right sidebar now, not sure it feels intuitive yet where I find each type of thing (eg submissions log on left but analytics on right?). One to easily revisit in a followup PR & keep adjusting behind feature flag tho 🙂

@DafyddLlyr
Copy link
Contributor

Thanks for the review! Agreed that these changes are probably best released as part of a wider refresh with a bit of communication around it 👍

@DafyddLlyr DafyddLlyr merged commit 2b227a8 into main May 3, 2024
12 checks passed
@DafyddLlyr DafyddLlyr deleted the ian/editor-sidebar-menu branch May 3, 2024 08:01
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