-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Addons: allow to set a "Default" or a explicit position for flyout #11891
Merged
Conversation
This file contains 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
- Add a new `flyout_position` field to the `AddonsConfig` model - Show the field in the form - Return the field in the APIv3 to be consumed by the frontend * Related readthedocs/addons#434
stsewd
approved these changes
Jan 8, 2025
ericholscher
reviewed
Jan 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice simple approach to try this out on 👍
humitos
added a commit
to readthedocs/addons
that referenced
this pull request
Jan 14, 2025
Initial POC to prove if this idea is possible and how we feel about it. I put together an example of what I understand we want to build here 😅 . In this example, the theme author will make explicitly how they want to use `readthedocs-flyout` HTML tag: ```html <readthedocs-flyout position="top-right"></readthedocs-flyout> ``` That will add the class `top-right` and show the flyout as follows: ![Screenshot_2025-01-08_12-44-20](https://github.com/user-attachments/assets/14ed7946-a1ab-4c44-84dc-d2a9ee456b8c) However, the project author can change the `position` value from the dashboard if they prefer to override the theme's default value: ![Peek 2025-01-08 12-46](https://github.com/user-attachments/assets/d8ab340b-2fc1-4704-ac0e-4a12bfe0ae07) * Related #51 * Requires readthedocs/ext-theme#554 * Requires readthedocs/readthedocs.org#11891 * Example using https://test-builds.readthedocs.io/en/addons-theme-defaults/ * Closes #434
Tests on .com are failing because of this change, tests on .com need to be changed to have this new field. |
humitos
added a commit
to readthedocs/addons
that referenced
this pull request
Jan 22, 2025
Initial POC to prove if this idea is possible and how we feel about it. I put together an example of what I understand we want to build here 😅 . In this example, the theme author will make explicitly how they want to use `readthedocs-flyout` HTML tag: ```html <readthedocs-flyout position="top-right"></readthedocs-flyout> ``` That will add the class `top-right` and show the flyout as follows: ![Screenshot_2025-01-08_12-44-20](https://github.com/user-attachments/assets/14ed7946-a1ab-4c44-84dc-d2a9ee456b8c) However, the project author can change the `position` value from the dashboard if they prefer to override the theme's default value: ![Peek 2025-01-08 12-46](https://github.com/user-attachments/assets/d8ab340b-2fc1-4704-ac0e-4a12bfe0ae07) * Related #51 * Requires readthedocs/ext-theme#554 * Requires readthedocs/readthedocs.org#11891 * Example using https://test-builds.readthedocs.io/en/addons-theme-defaults/ * Closes #434
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.
flyout_position
field to theAddonsConfig
model