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

Addons: create project admin page to configure addons #211

Closed
humitos opened this issue Aug 31, 2023 · 8 comments · Fixed by readthedocs/readthedocs.org#11031
Closed

Addons: create project admin page to configure addons #211

humitos opened this issue Aug 31, 2023 · 8 comments · Fixed by readthedocs/readthedocs.org#11031
Assignees
Labels
Accepted Accepted issue on our roadmap Feature New feature

Comments

@humitos
Copy link
Member

humitos commented Aug 31, 2023

The new addons project will give users a lot of flexibility: we will eventually allow them to use the JSON response to build anything they want on the frontend (see readthedocs/addons#13) and also because they could also inject the web-components by hand.

However, for the most common use case (no "development configuration") we still want to provide a way to customize some of the addons like "Default filter" on search, the root_selector for docdiff and others. I'm thinking all these things could be a page (or Addons subpages -- like one per addon: Addons -> Search) with a simple form on the project Admin for now.

Things we want to expose to configure currently (there will be more, sure):

It may be too soon to start working on this development, but I want to start the conversation to understand if we all are in the same page.

I'd like to start collecting opinions here because there are different ideas around how to do this and I'd like to think more deeply on them. We can always say: "These are the defaults and there is no way to change them unless you inject the web-components by yourself and pass attributes", like: <readthedocs-search default-filter="project: test-builds"></readthedocs-search>, which is totally valid as well (in particular at this stage)

@humitos humitos added the Needed: design decision A core team decision is required label Aug 31, 2023
@agjohnson
Copy link
Contributor

we still want to provide a way to customize some of the addons like "Default filter" on search

+1 here, for very common options at least.

These are the defaults and there is no way to change them unless you inject the web-components by yourself and pass attributes"

This is definitely an option too, though I might save this option for more advanced customization though? I'd say for basic configuration adding UI is indeed the way to go.

I'm thinking all these things could be a page (or Addons subpages -- like one per addon: Addons -> Search) with a simple form on the project Admin for now.

Hrm, I'm in between options here myself. I might lean towards the tabbed interface with multiple form instances. It's a little bit harder to get initial page load correct, but the overall UX is quite nice. It saves us from redundant views/templates too.

  • Single form instance with multiple field sets
    • 👍 Single form, no added UI need. Easy to handle errors.
    • 👎 Potentially a very long form. Harder to break apart later.
  • Multiple form instances passed to single view/template. Tabbed interface for each addon component
    • 👍 Nice UX. Short forms.
    • 👎 Hard to handle errors because of tabs
  • Multiple views for each form, subpages of addons admin page
    • 👍 Nice UX. Short forms. Easy to handle form errors
    • 👎 Potentially redundant template work. Needs a new pattern for project admin sub sub page (Project -> Settings -> Addons -> Docdiff)

So overall, I'd probably say we'd be safe if we implement these all as small, individual forms, and can aim for a single project settings subpage. I don't think we're describing anything else, but I'd only implement the templates on the new dashboard.

@agjohnson
Copy link
Contributor

Also, related to my comment on beta opt out in chat, this UI could be something that we add more immediately too. Same pattern as above, but the form option is "Opt in to addons beta", which sets the Version.addons. Or perhaps something else, as we want future versions opted in as well.

This would be an opt-in mechanism we can point users to, and opt-out mechanism if the project has immediate problem, and a reason to point to the new dashboard.

@humitos
Copy link
Member Author

humitos commented Sep 1, 2023

Also, related to my comment on beta opt out in chat

In general, I'd like you to add links when referencing things we talked about outside the issue itself. Otherwise, this is lost next week when the people involved in that chat lose their memory. Besides, it's just a black box for people that were not involved.

@humitos
Copy link
Member Author

humitos commented Sep 1, 2023

@agjohnson you mentioned really good points here. I'll think more about them because I'm not clearly visualizing the different approaches yet, but looks like an interesting conversation to have maybe sooner than later

@humitos
Copy link
Member Author

humitos commented Sep 22, 2023

Note for my future self: allow users to configure "which version to compare against" on docdiff. See readthedocs/addons#154

@humitos
Copy link
Member Author

humitos commented Nov 8, 2023

We already have a customer asking to change the positioning. Currently, it's botton-right, but we have other positions already implemented. See https://github.com/readthedocs/readthedocs-client/blob/f74dfbacf490a1080ff728290dc3b39b9221f9cf/src/flyout.css#L12-L30

I'd like to be able to configure these pre-defined settings via the admin page of the project itself.

Context: https://readthedocs.slack.com/archives/C029M3W01KR/p1699452339345109

@humitos
Copy link
Member Author

humitos commented Nov 8, 2023

Also, related to my comment on beta opt out in chat, this UI could be something that we add more immediately too. Same pattern as above, but the form option is "Opt in to addons beta", which sets the Version.addons.

This is already implemented in #213 and we are pointing users to this page when they ask for this.

@humitos humitos added Accepted Accepted issue on our roadmap Feature New feature and removed Needed: design decision A core team decision is required labels Nov 22, 2023
@humitos
Copy link
Member Author

humitos commented Nov 22, 2023

I'm removing the design decision label since we all agree about having a WebUI to configure the addons. I'm also adding to the following sprint so we can start working on it.

@agjohnson agjohnson added this to the New dashboard features milestone Dec 8, 2023
humitos added a commit to readthedocs/readthedocs.org that referenced this issue Dec 11, 2023
Currently, we have two filters on shown by default in the search modal.
However, they are not super useful to work together.

I changed this behavior (for now) to be:

* Default: search on the current project
* Include subprojects: also include results from subprojects

Note this will be configurable by the user once we expose the addons admin page
in readthedocs/ext-theme#211

Closes readthedocs/addons#209
humitos added a commit to readthedocs/readthedocs.org that referenced this issue Dec 12, 2023
Currently, we have two filters on shown by default in the search modal.
However, they are not super useful to work together.

I changed this behavior (for now) to be:

* Default: search on the current project
* Include subprojects: also include results from subprojects

Note this will be configurable by the user once we expose the addons admin page
in readthedocs/ext-theme#211

Closes readthedocs/addons#209
humitos added a commit to readthedocs/readthedocs.org that referenced this issue Jan 15, 2024
Add all the configuration options to the `AddonsConfigForm` so the user is able
to enable/disable each of the addons independently.

Closes readthedocs/ext-theme#211
humitos added a commit that referenced this issue Jan 15, 2024
This is the correct way to render a Crispy form.
It's also required for #211
@humitos humitos moved this from Planned to Needs review in 📍Roadmap Jan 15, 2024
humitos added a commit to readthedocs/readthedocs.org that referenced this issue Jan 22, 2024
* Addons: update form to show all the options

Add all the configuration options to the `AddonsConfigForm` so the user is able
to enable/disable each of the addons independently.

Closes readthedocs/ext-theme#211

* Addons: create an `AddonsConfig` for projects automatically

* Addons: remove features related to them

* Create `AddonsConfig` object automatically

Create an `AddonsConfig` object when going to the form view to edit its
preferences. By default, disable all the addons for now.

* Remove the Crispy layout from Python code

* Update tests

* Typo

* Missing save the object

* Make form label more explicit
@github-project-automation github-project-automation bot moved this from Needs review to Done in 📍Roadmap Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Feature New feature
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants