roam-toolkit
roam-toolkit copied to clipboard
Highlighting hint `w` shortcuts not work in page embed state
https://user-images.githubusercontent.com/4997466/165499485-d2505b28-5137-4576-adbf-1b0611439cbb.mp4
for example:
#Tag {{[[embed]]: [[Test Hello World!]]}}
In this scenario, w is not in effect and cannot open the embed [[Test Hello World!]] page title
is it related here? https://github.com/roam-unofficial/roam-toolkit/blob/770bc52395/src/ts/core/common/mouse.ts#L19
can confirm/reproduce. it seems to be related to how the html for that case is structured (span inside a), so the hint gets attached to the wrong element
@Stvad wow, great! Is it easy to fix? I'm also more than happy to help if needed! I would love this fix, 😁
Not sure, I think the fix would be to see if the elements found have sub-element that are links here https://github.com/roam-unofficial/roam-toolkit/blob/770bc52395d77990bb0fa80887f41df70d3dba62/src/ts/core/features/vim-mode/hint-view.ts#L51 And attach the class to those instead, but I’m not sure if that’d produce the desired behavior reliably. Contributions are welcome!
ok, but how can I access and click these sub-elements (span inside a)? do you mean the click() method would dispatch the event by the attached classes here?
Does that mean these classes roam-toolkit--hint roam-toolkit--hint1 should be attached to the span element?
Hey @Stvad , I just created the PR and deployed it to vercel, but it doesn't look like there is a roam/js version? https://roam-toolkit.vercel.app/no_preview_spatial.js
Apologies, I missed this! roam/js version is built off the separate branch atm (roam-js see #164 )
wow, thanks a lot! I just deployed and my PR seems to work well. https://roam-toolkit.vercel.app/entry.js