Skip to content

feat: initial implementation for caps lock warning - #154

Draft
kerembayulgen wants to merge 1 commit into
bragefuglseth:mainfrom
kerembayulgen:main
Draft

feat: initial implementation for caps lock warning#154
kerembayulgen wants to merge 1 commit into
bragefuglseth:mainfrom
kerembayulgen:main

Conversation

@kerembayulgen

Copy link
Copy Markdown

Simple caps lock warning

It does not show currently up while typing as I thought that the user would be acknowledging it before starting to type and it would be a distraction

Also, I think that the warning should be in bold text, but I haven't seen any GNOME apps use anything besides the "warning" style class.

Simple prototype for a caps lock warning. Currently does not show while typing.
@bragefuglseth

bragefuglseth commented May 30, 2026

Copy link
Copy Markdown
Owner

Hi, and thanks for the pull request! I have some thoughts on how the design of this should work:

  1. The warning should be on its own page in the bottom_stack widget and not be shown alongside the "Just Start Typing" label
  2. The warning should be shown anytime caps lock is on, regardless of whether you're currently typing or not

This is cleaner and more useful design wise, but complicates the code part a bit. I suggest creating a new function in typing_test.rs called update_bottom_stack that, whenever called, changes the visible child of the bottom_stack to an appropriate one depending on:

  • Whether a typing test is_running()
  • The state of the caps lock key
  • The return value of text_view_focused() (if the text view is not focused, nothing should be done with bottom_stack at all since focus.rs is doing some stuff with it then. kinda hacky to have different parts of the code manage it that way, but doing it differently would require more refactoring).

update_bottom_stack() should then be called everywhere in the code where the child is currently being set to the label or the "empty page" directly.

If you have any questions, let me know.

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