Skip to content

feat: Labs option in preferences#5057

Draft
Luc-Mcgrady wants to merge 12 commits into
mainfrom
labs
Draft

feat: Labs option in preferences#5057
Luc-Mcgrady wants to merge 12 commits into
mainfrom
labs

Conversation

@Luc-Mcgrady

@Luc-Mcgrady Luc-Mcgrady commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Linked issue (required)

closes #4871

How to test (required)

Find "Labs" as a new option in the preferences

Checklist (minimum)

  • I ran ./ninja check or an equivalent relevant check locally.
  • I added or updated tests when the change is non-trivial or behavior changed.

Details

I've implemented the "Labs" feature in a web-view as I presume we are moving away from QT and
Currently these options have no function. Before we can add the functionality we should try and come up with the pattern that we should use to register new flags.

UI evidence (required for visual changes; otherwise N/A)

image image

Scope

  • This PR is focused on one change (no unrelated edits).

@Luc-Mcgrady Luc-Mcgrady marked this pull request as draft June 23, 2026 10:50
@read-the-docs-community

read-the-docs-community Bot commented Jun 23, 2026

Copy link
Copy Markdown

Documentation build overview

📚 Anki | 🛠️ Build #33379722 | 📁 Comparing 019d58a against latest (7188bf3)

  🔍 Preview build  

4 files changed
± genindex.html
± autoapi/anki/config/index.html
± autoapi/anki/decks/index.html
± autoapi/aqt/webview/index.html

@carolcani carolcani self-assigned this Jun 25, 2026
@GithubAnon0000

Copy link
Copy Markdown
Contributor

Wouldn't alert-danger be the better choice here compaired to alert-warning? The FSRS section of the deck options uses alert-danger for the parameter field (if you try to modify it). It would signal that the experimental features are potentially unstable or break compatibilty.

Also: I know we didn't do that for the other alert boxes either, but having a "warning" icon might help the user to easily catch that the box is a warning box. It might be helpful for A11Y too, since icons will be recognizable even if e.g. the colors aren't.

And another thing, this one for @focushover: you said "labs" is a common term used. Maybe that's mac specific but a quick search on the internet and based on my experiences it is mostly just called something like "Experiments" or "Experimental features" or similar. "Labs" to me is non-obvious; though, of course, a single click into the tab would show what this is all about. But wouldn't it be prefered to make it clear from the get go by just naming it after what it is (experimental)?

@Luc-Mcgrady

Copy link
Copy Markdown
Contributor Author

I've added a ⚠️ 👍

In my opinion "alert-danger" should be used for values that are almost always damaging to the user. For example a 99% DR or as you say manually editing the parameters. While experiments are dangerous in the sense that they are less tested, there is still reason for the user to want to use the experiments so I'd say a "alert-warning" is probably for the best.

Comment thread ts/routes/preferences/+page.svelte Outdated
<div class="container">
<Warning
warning="These features may change, break, or be removed without notice, use at your own risk."
warning="⚠️ These features may change, break, or be removed without notice, use at your own risk."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For consistency, maybe it is possible to prepend that icon on every Warning Box? Not sure if the current code allows this, but that would be better than having to remember to add the icon to every box.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That wasn't very clear on my side. I meant as in: whenever you use the Warning box, it automatically prepairs the icon for you. So if you want to add another warning box somewhere, you'd only have to add the text. Somewhat like the color that is always the same, you do not have to manually specifiy that.

Perhaps CSS could be used to prepend that icon?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could use a

.alert-warning::before {content="⚠️"}

but that seems more complicated. I'm not sure if there are any more warnings on this page and if there were I'm not sure if they would need a ⚠️.

Comment thread qt/aqt/forms/preferences.ui Outdated
closes  #5073

Saves the values set in
- #5057

Saves it to the currently open collections json config. I'm not sure if
this approach might have problems with
#4289 (comment). A
situation where the main window has Anki API access while also
displaying user supplied JavaScript would be terrible so we should be
careful with this.

Test by enabling the "ping" labs option and then reload Anki or switch
profile to the same profile.
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.

Create a settings UI for enabling/disabling experimental features (feature flags)

5 participants