yoyurec / logseq-awesome-links

โญ Favicons for external links, page icons for internal. Logseq pluign
MIT License
107 stars 14 forks source link

the icon of page in namespace didnโ€™t appear in left sidebar #39

Open EasonSpirit opened 1 year ago

EasonSpirit commented 1 year ago

Info:

Description: A clear and concise description of what the bug is......

  1. when I disable both awesome ui and awesome links, we can see the logseq inner default page icon on left sidebar is here:

    ๆ— ๆ’ไปถๅผ€ๅฏ็š„ๆƒ…ๅ†ต
  2. when I enable awesome ui and disable awesome links, the default icon is gone, but still has a blank in front of the page name; the page I set icon is ok: image

  3. when I disable awesome ui and enable awesome links, both the default page icon and the page i have set icon didn't appear;

image

My awesome ui setting: image

To Reproduce: ...

  1. create page: create page [[X]] create page [[X/Y]] create page [[X/Z]] the page [[X/Y]] set an icon: icon:: ๐Ÿ—“๏ธ the page [[X/Z]] not set an icon:

  2. disable both awesome ui and awesome links: we can see

    • the page [[X/Y]] has an icon ๐Ÿ—“๏ธ in front of it
    • the page [[X/Z]] has a logseq default icon
  3. enable awesome ui and disable awesome links: we can see:

    • the page [[X/Y]] has an icon ๐Ÿ—“๏ธ in front of it
    • page [[X/Z]] has a blank in front of it;
  4. disable awesome ui and enable awesome links we can see:

    • the page [[X/Y]] has nothing in front of it
    • page [[X/Z]] has nothing in front of it;

Expected behavior:

  1. enable awesome ui and disable awesome links:

    • the page [[X/Y]] has an icon ๐Ÿ—“๏ธ in front of it
    • page [[X/Z]] has a logseq default icon in front of it;
  2. disable awesome ui and enable awesome links

    • the page [[X/Y]] has an icon ๐Ÿ—“๏ธ in front of it
    • page [[X/Z]] has a awesome ui default icon in front of it;

Screenshots If applicable, add screenshots to help explain your problem.

Attach files Add (via drag-n-drop) .zip with .md files (if it needs) to help with bugfixind

Sergih28 commented 1 year ago

Hi @huanhuanqiongqiong

It's probably not the best solution, but I found why it happened. When you have the feature enable icon/color for internal pages? enabled, it shows the icons everywhere but deletes them from the left sidebar.

The css causing this is in this file:

.is-awLi-enabled .page-icon:not(.whiteboard-page .page-icon) {
    display: none !important;
}

This removes the icons from the left sidebar, and the page title. I had a very hard time trying ot overwrite that line that has !important and gets executed after your custom css.

But the solution has been to give it higher specificity by going up in selectors.

So adding this to your custom.css file should fix it:

#left-sidebar .bd .page-icon:not(.whiteboard-page .page-icon) {
  display: inline !important;
}

I think it would be good if @yoyurec can add an new option that does not hide this icons when the enable icon/color for internal pages? is enabled.

That said, it does work for the pages that have an icon::, but not with pages that inherit it with page-type, as those get a default icon instead of the inherited one ๐Ÿ˜ข.

PS: I used this as well to re-enable the page icons beside the page title in the opened page

.page .page-title .title .page-icon:not(.whiteboard-page .page-icon) {
  display: inline !important;
}