gethomepage / homepage

A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations.
https://gethomepage.dev
GNU General Public License v3.0
19.57k stars 1.17k forks source link

QuckLaunch doesn't handle same name for bookmarks gracefully #1445

Closed davidsmejia closed 1 year ago

davidsmejia commented 1 year ago

Description

Hello 👋

I was setting up my bookmarks when I encountered a bug with the QuickLauncher. It doesn't seem to handle bookmarks with the same name attribute gracefully. I believe this is due to the key for the result loop uses the container/app/name attribute from the result. This is the line I am referring to: https://github.com/benphelps/homepage/blob/main/src/components/quicklaunch.jsx#L164

Potentially Related Issue: https://github.com/benphelps/homepage/issues/1395

Some potential solutions: A) Concatenate r.name and r.href

<li key={r.container ?? r.app ?? `${r.name}-${r.href}`}>

This should be unique enough to handle most scenarios as it would unique between bookmarks across ether other as well as against services. However service to service would not be unique.

B) Stringify the result object

<li key={JSON.stringify(r)}>

This would be the most unique for everything with the exception of an actual duplicate entry (which is possible someone might want?)

C) Add a unique identifier to all entries of servicesAndBookmarks around this line. https://github.com/benphelps/homepage/blob/main/src/pages/index.jsx#L179

<li key={r.id}>

I am open to hearing other solutions and would gladly PR for this change,

Steps to reproduce

  1. Add 2 bookmarks with name "Same" and unique hrefs.
  2. Add another unique bookmark name and href. (not sure if you have to do this)
  3. Use QuickLauncher to search for "Same" and you will see duplicates.

homepage version

v0.6.17

Installation method

Docker

Configuration

- Entertainment:
    - Twitch:
      - icon: si-twitch
        href: https://twitch.tv
    - HBO Max:
      - icon: si-hbo
        href: https://hbomax.com
    - Netflix:
      - icon: si-netflix
        href: https://netflix.com/
    - YouTube:
      - icon: si-youtube
        href: https://youtube.com/
- Developer:
    - Github:
      - icon: si-github
        href: https://github.com/davidsmejia

- Work Sites:
    - Refinebio:
      - icon: mdi-dna
        href: https://www.refine.bio
    - ScPCA Portal:
      - icon: mdi-fruit-citrus
        href: https://scpca.alexslemonade.org
    - Resources Portal:
      - icon: mdi-fruit-citrus
        href: https://resources.alexslemonade.org

- Work Repos:
    - Refinebio:
      - icon: si-github
        href: https://github.com/alexsLemonade/refinebio
    - ScPCA Portal:
      - icon: si-github
        href: https://github.com/alexsLemonade/scpca-portal
    - Resources Portal:
      - icon: si-github
        href: https://github.com/alexsLemonade/resources-portal

Container Logs

No response

Browser Logs

No response

Other

No response

Before submitting, I have made sure to

shamoon commented 1 year ago

Thanks, added you to the commit. Also fixed in another spot.

github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.