Skip to content

feat: redo the env/namespace switcher component to handle branches#4238

Merged
markphelps merged 9 commits into
v2from
v2-env-namespace-branch-picker
May 27, 2025
Merged

feat: redo the env/namespace switcher component to handle branches#4238
markphelps merged 9 commits into
v2from
v2-env-namespace-branch-picker

Conversation

@markphelps

Copy link
Copy Markdown
Collaborator

Fixes: #4235

This redoes the EnvironmentNamespaceSwitcher to handle branched enviornments as well
It also moves the BranchCreation component to the header only when we are on a base branch

Screen Shot 2025-05-23 at 11 51 31

Screen Shot 2025-05-23 at 11 51 24

This feels better to me as now branches show up like 'real' environments, since they are

Note: There are still issues that occur if you are on a flag page in one env/namespace and then switch to another env/namespace that does not contain that item, this shows an error. We'll need to fix this seperately

@markphelps
markphelps requested a review from a team as a code owner May 23, 2025 15:52
@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label May 23, 2025
@markphelps
markphelps requested a review from erka May 23, 2025 15:52
@codecov

codecov Bot commented May 23, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (v2@b519929). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff          @@
##             v2    #4238   +/-   ##
=====================================
  Coverage      ?   50.97%           
=====================================
  Files         ?      121           
  Lines         ?    12759           
  Branches      ?        0           
=====================================
  Hits          ?     6504           
  Misses        ?     5728           
  Partials      ?      527           
Flag Coverage Δ
unittests 50.97% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erka

erka commented May 23, 2025

Copy link
Copy Markdown
Contributor

The first instinct is to position the "Create Branch" icon in that spot.

image

But ... the selector is already quite complex, so adding more might not be ideal. It’s probably better to add extra spacing on the left and right between the border and the environment names.

The use of a tooltip for actions is interesting—I'm curious if this is a new direction or pattern you're trying out. Usually, actions like “Copy to namespace” or “Create a flag” are handled through dialogs or slideovers, so this stands out a bit.

@markphelps

Copy link
Copy Markdown
Collaborator Author

The first instinct is to position the "Create Branch" icon in that spot.

image

But ... the selector is already quite complex, so adding more might not be ideal. It’s probably better to add extra spacing on the left and right between the border and the environment names.

I did actually try that first! It did look a bit cluttered and I felt like if you had several environments it would be repetitive
, although I guess we could make the button only show on hover.

Also from a UX point, I thought to myself 'if I want to create a branch from an existing env, i would probably already be 'in' that env and not go looking in the env/namespace switcher'

The use of a tooltip for actions is interesting—I'm curious if this is a new direction or pattern you're trying out. Usually, actions like “Copy to namespace” or “Create a flag” are handled through dialogs or slideovers, so this stands out a bit.

Yeah I also struggled with this. I used a popover component because theres only field in the form, and not much content that i could think to display that would justify a modal or slideover, as I thought those would look weird with just one field and two buttons

Signed-off-by: Mark Phelps <[email protected]>
@markphelps

Copy link
Copy Markdown
Collaborator Author

@erka I improved the x-padding for the menu items

@erka

erka commented May 23, 2025

Copy link
Copy Markdown
Contributor

There might be another bug related to namespace selection, but I haven’t traced it yet.

Screencast.From.2025-05-23.22-07-12.mp4

@markphelps

Copy link
Copy Markdown
Collaborator Author

Ah yes i saw that once too but thought it was a fluke

@markphelps

Copy link
Copy Markdown
Collaborator Author

@erka I believe I fixed the issue with switching namespaces

Signed-off-by: Mark Phelps <[email protected]>

@erka erka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice

@markphelps
markphelps merged commit 72e7fca into v2 May 27, 2025
@markphelps
markphelps deleted the v2-env-namespace-branch-picker branch May 27, 2025 11:42
markphelps added a commit that referenced this pull request May 27, 2025
* v2:
  feat: redo the env/namespace switcher component to handle branches (#4238)
  chore: update vite to v6.3.5 and drop react-helmet (#4241)
  fix(ui): v2 clean the styles and refine some texts on support page (#4240)
  chore(deps): v2 drop unused packages (#4239)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants