Repository navigation
Fix empty screen flash before nav on clicking project in top bar - #2156
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
david-crespo
force-pushed
the
fix-project-path
branch
from
April 17, 2024 03:43
7d275e7 to
55d1891
Compare
david-crespo
enabled auto-merge (squash)
April 17, 2024 03:48
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Apr 18, 2024
oxidecomputer/console@2ba444c...6334f0d * [6334f0db](oxidecomputer/console@6334f0db) bump omicron to latest main (no changes) * [46dbd9c8](oxidecomputer/console@46dbd9c8) oxidecomputer/console#2158 * [e94929ab](oxidecomputer/console@e94929ab) try 300ms minTime on RefreshButton SpinnerLoader * [b6da4154](oxidecomputer/console@b6da4154) oxidecomputer/console#2161 * [788389a8](oxidecomputer/console@788389a8) oxidecomputer/console#2157 * [fed9f4d4](oxidecomputer/console@fed9f4d4) oxidecomputer/console#2159 * [aa75f577](oxidecomputer/console@aa75f577) oxidecomputer/console#2160 * [eeb32a78](oxidecomputer/console@eeb32a78) oxidecomputer/console#2153 * [522d3ab1](oxidecomputer/console@522d3ab1) oxidecomputer/console#2156 * [c726356f](oxidecomputer/console@c726356f) oxidecomputer/console#2155 * [e2b0a7d0](oxidecomputer/console@e2b0a7d0) oxidecomputer/console#2151 * [a5af899a](oxidecomputer/console@a5af899a) oxidecomputer/console#2154 * [73263a4e](oxidecomputer/console@73263a4e) of course I didn't push to main without running the tests, why do you ask * [ea108b7e](oxidecomputer/console@ea108b7e) put firewall rules tab first on vpc detail
david-crespo
added a commit
to oxidecomputer/omicron
that referenced
this pull request
Apr 18, 2024
oxidecomputer/console@2ba444c...6334f0d * [6334f0db](oxidecomputer/console@6334f0db) bump omicron to latest main (no changes) * [46dbd9c8](oxidecomputer/console@46dbd9c8) oxidecomputer/console#2158 * [e94929ab](oxidecomputer/console@e94929ab) try 300ms minTime on RefreshButton SpinnerLoader * [b6da4154](oxidecomputer/console@b6da4154) oxidecomputer/console#2161 * [788389a8](oxidecomputer/console@788389a8) oxidecomputer/console#2157 * [fed9f4d4](oxidecomputer/console@fed9f4d4) oxidecomputer/console#2159 * [aa75f577](oxidecomputer/console@aa75f577) oxidecomputer/console#2160 * [eeb32a78](oxidecomputer/console@eeb32a78) oxidecomputer/console#2153 * [522d3ab1](oxidecomputer/console@522d3ab1) oxidecomputer/console#2156 * [c726356f](oxidecomputer/console@c726356f) oxidecomputer/console#2155 * [e2b0a7d0](oxidecomputer/console@e2b0a7d0) oxidecomputer/console#2151 * [a5af899a](oxidecomputer/console@a5af899a) oxidecomputer/console#2154 * [73263a4e](oxidecomputer/console@73263a4e) of course I didn't push to main without running the tests, why do you ask * [ea108b7e](oxidecomputer/console@ea108b7e) put firewall rules tab first on vpc detail
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed some janky behavior on nav when I click the project in the top bar.
2024-04-16-project-click-bug.mp4
This was due to that link going to
/projects/my-proj, which is not actually a real page in its own right: it does a client-side redirect to/project/my-proj/instances. In general our approach in cases like this (a parent route with a default child that we always redirect to) is to link directly to the default child.But I noticed is that path builder is not set up to encourage the right choice.
pb.project()went to/projects/my-projbecause it is used in the construction of many other paths, even though we don't actually ever want to link there. So what I did here is pull out aprojectBasehelper function that is used as the base for other routes, and changedpb.project()to go straight to/projects/my-proj/instances. This fixes the flash on the link in the top bar.The other thing I did that's sort of subtle is that I changed some calls to
pb.instances()topb.project()even though they return the same route. I wanted to go according to the semantics of the call site instead of what we know the resulting path to be. For example, if the user creates a project, we want to land on the project detail. That previously went topb.instances()because that is the correct path to land on. But what we want to land on in that case is not necessarily project instances, it's whatever the project detail path happens to be, which in this case is project instances, but it may not be in the future.