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

fix: feature-specific segments link #4299

Merged
merged 9 commits into from
Aug 28, 2024
Merged

Conversation

kyle-ssg
Copy link
Member

@kyle-ssg kyle-ssg commented Jul 8, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

Fixes urls to a feature-specific segment.

How did you test this code?

  • Refreshed a url to a feature-specific segment

@kyle-ssg kyle-ssg requested a review from a team as a code owner July 8, 2024 16:30
@kyle-ssg kyle-ssg requested review from novakzaballa and removed request for a team July 8, 2024 16:31
Copy link

vercel bot commented Jul 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 9:39am
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 9:39am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview Aug 28, 2024 9:39am

@kyle-ssg kyle-ssg requested a review from rolodato July 8, 2024 16:31
@github-actions github-actions bot added front-end Issue related to the React Front End Dashboard fix labels Jul 8, 2024
@kyle-ssg kyle-ssg linked an issue Jul 8, 2024 that may be closed by this pull request
4 tasks
Copy link
Contributor

github-actions bot commented Jul 8, 2024

flagsmith image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith:pr-4299 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 8, 2024

flagsmith-api image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api:pr-4299 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 8, 2024

flagsmith-e2e image build finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-4299 Finished ✅ Skipped

Copy link
Contributor

github-actions bot commented Jul 8, 2024

flagsmith-frontend image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-frontend:pr-4299 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 8, 2024

flagsmith-private-cloud image build and security scan finished ✨

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4299 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Jul 8, 2024

Uffizzi Preview deployment-53958 was deleted.

Copy link
Member

@rolodato rolodato left a comment

Choose a reason for hiding this comment

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

This does fix links to feature-specific segments, but it does not enable the "Include Feature-Specific" option. Is that feasible to do as well?

My reasoning is that if you open a link to a segment, there's nothing in the segment itself or the URL that tells you it's feature-specific. If you close the modal intentionally or accidentally, it's more difficult to go back to where you were - especially considering that segment modals do not add browser history, so you can't use Back to re-open them after closing.

Also suggest a different title: fix: Fix links to feature-specific segments not opening the segment details modal

@github-actions github-actions bot added fix and removed fix labels Jul 24, 2024
@kyle-ssg
Copy link
Member Author

Ok if that's the usecase then it can only be solved by the modal being url based in the history, since segments are paged.

I've adjusted the behaviour such that the user can go back and forward in browser history

@kyle-ssg kyle-ssg requested a review from rolodato July 24, 2024 18:01
Copy link
Contributor

github-actions bot commented Jul 24, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-4299 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-4299 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-4299 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4299 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4299 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-4299 Finished ✅ Results

@rolodato
Copy link
Member

@kyle-ssg thanks for the update, I'm able to use browser navigation to get back to a closed segment modal now.

One last thing - would it be feasible to have the "Include Feature-Specific" option pre-selected if they open a link to a feature-specific segment? My reasoning is that, to get to a feature-specific segment from the Segments page, you need to have selected the "Include Feature-Specific" option at some point. Having it enabled when you open a link to a feature-specific segment seems more consistent with the navigation behaviour.

@kyle-ssg
Copy link
Member Author

Done @rolodato

@rolodato
Copy link
Member

@kyle-ssg I see we're including the featureSpecific URL parameter but it's not automatically added when opening a feature-specific segment if the parameter isn't already there.

This is definitely better than what we have now, but I was hoping to have this parameter added automatically if it's not there. For example, this URL is for a feature-specific segment:

https://flagsmith-frontend-staging-gui9akkrb-flagsmith.vercel.app/project/6605/segments?id=9766

which ends up as:

https://flagsmith-frontend-staging-gui9akkrb-flagsmith.vercel.app/project/6605/segments?id=9766&featureSpecific=false

Instead, I was expecting:

https://flagsmith-frontend-staging-gui9akkrb-flagsmith.vercel.app/project/6605/segments?id=9766&featureSpecific=true

@kyle-ssg
Copy link
Member Author

kyle-ssg commented Aug 28, 2024

@kyle-ssg I see we're including the featureSpecific URL parameter but it's not automatically added when opening a feature-specific segment if the parameter isn't already there.

I'm not sure how they'd get the url with a missing parameter to begin with. Regardless, this will now update based on the fetched segment.

@rolodato
Copy link
Member

It works! One last thing which I'm not sure was present before, is that toggling "Include Feature-Specific" changes the URL and adds a history entry, but navigating back/forward does not actually reflect this change in the page.

IMO toggling "Include Feature-Specific" should not add a history change, whether that happens through interaction or not. Or, it should add a history entry but reflect the state change correctly, but I would prefer the former option.

Screen.Recording.2024-08-28.at.08.58.47.mov

@kyle-ssg kyle-ssg added this pull request to the merge queue Aug 28, 2024
Merged via the queue into main with commit bb4a89c Aug 28, 2024
31 checks passed
@kyle-ssg kyle-ssg deleted the fix/link-feature-specific-segment branch August 28, 2024 13:03
@kyle-ssg
Copy link
Member Author

In the interest of not keeping PRs around for weeks on end, I've merged this for now. I can adjust the behaviour of this at a later date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Permalinks to feature-specific segments do not work
3 participants