Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@iamllama
Copy link
Contributor

@iamllama iamllama commented Jun 2, 2025

image

Forum post: https://forums.ankiweb.net/t/allow-having-multiple-io-mask-colours/61137

This pr proposes to add a new fill tool to the io editor, which would bring it closer to the IOE addon feature-wise

Copy link
Member

@dae dae left a comment

Choose a reason for hiding this comment

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

One minor suggestion: if fill is set to #000000, we could clear the explicit value.

@abdnh @krmanik heads up in case you want to add anything; plan to merge this in tomorrow if you don't raise any objections

},
] as const;

export type ActiveTool = typeof tools[number]["id"];
Copy link
Member

Choose a reason for hiding this comment

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

TIL this is possible in TypeScript! Thank you for the typing improvements too. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One minor suggestion: if fill is set to #000000, we could clear the explicit value.

Not sure if i understood correctly 🤔 The fill attr isn't saved in the cloze if its set to the default mask colour (#ffeba2), like the angle attr when its 0. If its changed to be cleared when set to #000000 then users' existing io notes using the default mask colour would have their notes bloated with it

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, that's a thinko on my part - from https://github.com/ankitects/anki/pull/4048/files#diff-a1adc784721911f5063bdb67703c3f2892d9fb58d5ee1738e0df305f7062f5caR361 I assumed #000 was the default. If our default is a color the user is unlikely to be able to pick easily, no point trying to remove it if it's the default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sorry, was mistaken as well. The text "clozes" behave differently, they don't save the fill attr when its the default text colour (#000000) and regular masks don't save it when its the default mask colour

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If our default is a color the user is unlikely to be able to pick easily

The datalist element should be able to provide preset options for the colour input, and seems to work in external/mobile browsers but not in anki itself, even though its chromium version should support it

Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing Qt overlooked something when trying to integrate it into their own color picker implementation.

Anyway, thank you as always for your contributions :-)

@dae dae merged commit 174b199 into ankitects:main Jun 4, 2025
1 check passed
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.

2 participants