Hints cover link text

I would like to adapt the hint positions in a way that they don’t cover the links. For example by moving them 4em to the left. I have tried adding :position "relative" :left "-4em" here:

(theme:themed-css (theme *browser*)
  `(".nyxt-hint" :background-color ,theme:background :color
    ,theme:on-background :font-family "monospace,monospace" :position "relative" :left "-4em" :padding
...

But this doesn’t help. Any ideas how to achieve this?

@MaxGyver83, we can provide it as a user-option.

See Add hints offset slot by aadcg · Pull Request #3173 · atlas-engineer/nyxt · GitHub.

Awesome! Thank you. How can I test it? Do I need the full build environment? Or can I simply copy the content of source/mode/hint.lisp in my ~/.config/nyxt/config.lisp?

You’d need to compile from source and run it. Then add the following to your config.

(define-configuration nyxt/mode/hint:hint-mode
  ((nyxt/mode/hint:hints-offset -4)))

Maybe copying the contents of hint.lisp would work, but that’s a hack and nothing is guaranteed.

There will be a new Nyxt release in 1 week nonetheless, so you can also wait a handful of days.

I have compiled it. It works. Thank you!
But as commented on the pull request, I would prefer separate settings for the x and the y offset. I have tried this locally. This did also work.
Apart from this, I think it would make sense to make sure the hint labels stay inside the window. When I set an x offset of -40, some hints got a negative absolute position and became unreadable.

Maybe even better than a pixel offset: Set on which side of the link the hint should be drawn.

Nyxt vs. Firefox + Surfingkeys:

2023-09-15 20.51.02 677x364 Region_cropped

2023-09-15 20.51.30 802x453 Region_cropped

@MaxGyver83 I’d suggest adding the second idea as a feature request on GitHub.

1 Like