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

Add fragment or args redirect to samples page #1054

Merged
merged 6 commits into from
Jan 30, 2024

Conversation

rafael-rosa-knowcode
Copy link
Contributor

@rafael-rosa-knowcode rafael-rosa-knowcode commented Dec 14, 2023

GitHub Issue (If applicable):

From Uno issue unoplatform/uno#14746

The idea of this PR is that it is possible to access the Samples using a direct link.
For example, pass the address https://gallery.platform.uno/#combobox and get directly to the ComboBox samples page.

image

This other PR will update the Docs to redirect to a specific sample. unoplatform/uno#14833

image

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

For now we don't have any redirection that allows you to access a sample directly.

What is the new behavior?

This PR implements a redirection that allows you to access a sample directly.
Using URL address for Wasm (e.g https://gallery.platform.uno/#ComboBox) and command line parameters for GTK.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested on iOS.
  • Tested on Wasm.
  • Tested on Android.
  • Tested on UWP.
  • Tested in both Light and Dark themes.
  • Associated with an issue (GitHub or internal)

Other information

This issue is related to the Add link for Gallery and Playground on Docs Reference

Internal Issue (If applicable):

Include Reference Link to the Playground and Gallery in each Control Documentation
unoplatform/uno#14746

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net

@rafael-rosa-knowcode
Copy link
Contributor Author

To validate using the link on the PR publish.

https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net/#ComboBox

And check the change on the code.
image

Or you can try to do passing parameter on the GTK

image

The most of the other changes are about
parameter to methods
or Javascript to the window.location.hash. (Already used in the playground.)

https://github.com/unoplatform/Uno.Playground/blob/ba525f1e11c7188d6bc8f4810bbfcb0246b87759/src/Uno.Playground.WASM/ts/FragmentNavigation.ts#L4

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net

1 similar comment
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net

Copy link

github-actions bot commented Jan 2, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net

1 similar comment
Copy link

github-actions bot commented Jan 3, 2024

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net

@jeromelaban jeromelaban changed the title Add hash or args redirect to samples page Add anchor or args redirect to samples page Jan 10, 2024
@jeromelaban jeromelaban changed the title Add anchor or args redirect to samples page Add fragment or args redirect to samples page Jan 10, 2024
@rafael-rosa-knowcode
Copy link
Contributor Author

@jeromelaban
Isn't this change something interesting or something we want?
Because it could make it easier for users.
And we have already implemented the links in the documentation, this part would be missing.
Can you review again?

@jeromelaban
Copy link
Member

@rafael-rosa-knowcode I can't this PR to work with the staging site, even with the #combobox fragment. Could you take a look?

And to answer your question, yes, it's a very useful feature.

@rafael-rosa-knowcode rafael-rosa-knowcode force-pushed the dev/ramr/issueUno14746-addHashRedirect branch from 6eecda4 to a2095df Compare January 30, 2024 19:15
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net

1 similar comment
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net

@rafael-rosa-knowcode
Copy link
Contributor Author

@jeromelaban
About

I can't this PR to work with the staging site, even with the #combobox fragment. Could you take a look?

I updated it to allow capitalized text or not, (InvariantCultureIgnoreCase)

This was working. (ComboBox)
https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net/#ComboBox

And now this will work too. (combobox)
https://white-field-08c5cf00f-1054.eastus2.3.azurestaticapps.net/#combobox

@jeromelaban
Copy link
Member

This is working very nicely! Thanks!

@jeromelaban jeromelaban merged commit c645a47 into master Jan 30, 2024
16 checks passed
@jeromelaban jeromelaban deleted the dev/ramr/issueUno14746-addHashRedirect branch January 30, 2024 21:43
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