LemmyNet / lemmy-ui

The official web app for lemmy.
https://join-lemmy.org/
GNU Affero General Public License v3.0
878 stars 334 forks source link

Add an button to reach users saved items besides the personal menu #2613

Closed Ninguem closed 1 week ago

Ninguem commented 1 month ago

Requirements

Describe the feature you'd like

It is cumbersome to have to go to the personal menu, choose profile and select saved to view saved posts. A little button besides the personal menu (top right) would be great! Near the ones that are already there (notifications, search...).

Tmpod commented 1 month ago

I made the following (very crude) userscript to patch in a button like that:

// ==UserScript==
// @name        Lemmy saved icon
// @namespace   Violentmonkey Scripts
// @match       https://lemmy.pt/*
// @grant       none
// @version     1.0
// @author      -
// @description Adds a navbar icon to your saved articles.
// ==/UserScript==

window.addEventListener('load', function() {

user = document.querySelector("#dropdownUser a").href;

saved = document.createElement("li");
saved.innerHTML = `
<li id="navSaved" class="nav-item">
  <a class="nav-link d-inline-flex align-items-center d-md-inline-block" href="${user}?view=Saved">
    S
  </a>
</li>
`;

navbarIcons = document.getElementById("navbarIcons");
dropdownUser = document.getElementById("dropdownUser");
navbarIcons.insertBefore(saved, dropdownUser);

}, false);
dessalines commented 1 week ago

We have this on the bottom bar in jerboa, and could add it to lemmy-ui-leptos. If someone wants to add it here, I'll re-open this issue and assign it to them.