Coder Social home page Coder Social logo

kometenstaub / customizable-page-header-buttons Goto Github PK

View Code? Open in Web Editor NEW
83.0 3.0 0.0 7.56 MB

Add command buttons left to the standard buttons in Obsidian mobile (and desktop, if enabled).

License: MIT License

JavaScript 6.58% TypeScript 91.07% SCSS 2.35%

customizable-page-header-buttons's Introduction

Customizable Page Header and Title Bar Obsidian Plugin Discontinued, please use the Commander plugin

This plugin lets you add buttons that execute commands to page header in the mobile (and desktop, off by default) app.

It lets you choose from all commands and configure their icons. You can set icons from the core and lucide icons.

If you enable desktop compatibility, it will also let you configure buttons to be shown on both mobile and desktop, only desktop or only mobile.

On desktop, you can also add buttons to the title bar. You can add them to the left or right side and even exchange the center version text with buttons.

If you use Pane Relief, you can toggle whether to show the forward/backwards history count when you're adding back/forward buttons.

pane-relief-history-count

back-forward-settings

Thank you to @pjeby for supporting this in Pane Relief.

Known limitations

This plugin uses an internal API for showing the commands. That means for example that if some commands only work in edit mode, the last active pane before entering settings has to be in edit mode, otherwise you will not be able to select that command.

Example configuration

Example configuration

Example settings

Settings picture

Credits

Shoutout to @phibr0 for his awesome work on the Customizable Sidebar Plugin. The code that powers this plugins' settings (adding/removing commands/changing icons) is powered by an adapted version of his code.

Thanks to @pjeby the buttons auto-refresh on setting change and at startup. It will also tell Pane Relief when buttons changed so that title tooltips for the back/forward history count can, if needed, be updated and all the leaves will be populated when the workspace is changed (using monkey-around, which ISC-licensed).

customizable-page-header-buttons's People

Contributors

dependabot[bot] avatar kometenstaub avatar pjeby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

customizable-page-header-buttons's Issues

[Feature Request 😅] Customizable Titlebar

I would really like to have the ability to add commands to the titlebar in the same way that this plugin functions. I'm assuming you could copy over most or all of the functionality of this plugin with the only addition being the ability to choose where the command is added in the titlebar since there is the option of appending to titlebar-button-container mod-left and titlebar-button-container mod-right ... maybe even the titlebar text div in the center? Just an idea I wanted to throw your way! Go ahead and close this issue if its not of interest!

Lucide icons

Once Obsidian 0.13.27 is public, switch to lucide icons and deprecate feather icons.

Unclosable empty pane created after switching between panes, when all panes pinned

Thank you @kometenstaub for this very useful plugin!

When I have pinned all my open panes (i.e. right after pinning the last of my unpinned panes), as soon as I click another pane to move focus there, an empty pane appears. This reduces the amount of space to divide among the panes I actually want open (or is distracting as it will reopen if I close it as soon as I move between panes again).

I suspect this behavior may be related to issue #33 ("empty leaf created when closing file").

Steps to reproduce

  1. I have two* panes open. I can change back and forth between them without an empty pane appearing.
  2. I pin one of the two panes. I can change back and forth between them without an empty pane appearing.
  3. I pin the other of the two panes (i.e. I have two panes open; both tabs are pinned). When I click on the other pane to change focus to it, an empty pane appears
  4. Clicking the unwanted empty pane's "close file" link closes that unwanted empty pane and switches focus to one of my intentionally-open panes, but as soon as I switch focus to another pane the empty pane appears again (and stays until I close it).

*I tested this with three panes open as well; the unintended empty-pane-opening behavior does not happen if I've only pinned 2 of the 3 panes, and does happen after I've pinned all 3 of the 3 panes, so I suspect this behavior is linked to all open panes being pinned (i.e. set off by pinning of all open panes, rather than by pinning a second pane out of 3+ panes).

Before I started testing what could be causing this, I had something different going on: the same behavior, except clicking the "close" link on the unwanted empty pane did not close the pane, just switched my focus to another pane while leaving the unwanted pane open. I can't reproduce that now, but am noting in case anyone encounters it.

What I've tried

  • Quit and restarted Obsidian
  • Used View > Force Reload
  • Removed my custom CSS snippets without apparent impact on the issue
  • Disabled all other community plugins, did View > Force Reload, no impact on the issue

My setup

  • Core Obsidian, theme (Minimal 5.3.0) and all plugins updated as of 7/3/2022 10am ET
  • Obsidian v0.14.15
  • Customizable Page Header and Title Bar 4.5.0

I'll report back if I figure out what's causing this, but if anyone has suggestions I'd appreciate them. Thanks!

Configure per action desktop/mobile

First off, great plugin! loving this on mobile especially.

This is not crucial, but a nice to have :-)

Would it be possible to configure on a per command basis if it is visible on mobile or desktop or both?

Use: on mobile it is hard to get to the close document command, lots of tapping. but with your plugin I add this as a command and its always visible. However on desktop, this means i have the commands for closing document listed twice.

media panes don't get button

Media panes don't get the button. That means when one goes back to the markdown view, the view is already in the history and won't get the button.

The customizable page header buttons hide the page title (Mobile version)

Issue

  • I use Obsidian on iPhone and the customizable page header buttons just hide the page title.
    IMG_6824 | 100

  • Not to mention, the page header gets thicker and does not look neat.

Alternative

  1. I have to orientate my phone horizontally to see the page title.
    IMG_6823 | 200

  2. Reveal active file in navigation so I don't have to turn the phone horizontally.

Option to change page header font

Would be nice to have an option to change the Note’s Title font to accommodate for viewing text as more items are added by the plugin. Love the plugin!

Add css snippets as list items

I would like to select css snippets from the list

This may sound like.. nothing fancy, but could be a very nice toggle on/off button for some of our favorite snippets
:))

icon size inconsistent

compared to the icon size of the other icons in the top bar, the size is off. Tested on iOS with default theme.
Screenshot 2021-11-13 17 19 14

Buttons Are Not Showing Up on Title Bars in 0.16.2

Buttons --corresponding with and representing "Navigate Back" and "Navigate Forward" functions, for instance --aren't showing up on Obsidian's title bars (whether left, right, or center) in Obsidian version 0.16.2 --and this happens despite uninstalling and reinstalling the Plugin, being Customizable Page Header in this case, as well as closing and restarting this new version of Obsidian.

Compatibility with pane-relief plugin

My main purpose for trying this plugin was to add forward/back buttons to my page header, and use a snippet to hide them on the title bar or the title bar itself. I also like to use F11 to put obsidian in full screen mode, hiding the title-bar.

Customizable-page-header-buttons plugin works as described—adding the forward/back buttons. The individual panes have their own history from the pane-relief plugin, and the pane-relief hotkeys work.

The right click functionality of the pain-relief plugin does not exist on the buttons added to the page header with customizable-page-header-buttons plugin.

The right click function is basically a drop-down list of the button history to select a deeper level of navigation.

Is it possible to detect pane-relief plugin and if so replicate/use button code with the right click functions. Maybe add a toggle to turn off the numbers being displayed in-case someone would rather not have the extra visual clutter. I have low opacity on my page headers until hover so it would not bother me.

Thank you for this plugin. As it works now, I think it will be an upgrade to my workflow and anyone who uses work-spaces with multiple panes, as it makes sense to have this navigation at the page/pane level.

Screenshot_2022-03-27_01-10-58

Screenshot_2022-03-27_01-10-05

Screenshot_2022-03-27_01-06-40

wow amazing, but seem to mess with my YAML header files, anyway to fix that?

Hi!

this is an amazing plugin! been doing it for months manually until i discovered this :D

one issue i see is that i use YAML headers (which i do ), it sees to mess up the file by adding the header on top of the YAML header (even thought there is a title below YAML), ie:

image

anyway this can be fixed since all my thousands of files have YAML headers :D

thx!

Z

Page header buttons repeat when not is in separate window.

If I take a note and open it in a new window and then toggle the edit/reading button on the header all the buttons duplicate. I disabled all plugins but this one and it still occurred. In a tab/pane it does not duplicate the buttons at all.

image

Windows v0.15.9
Plugin v4.6.2

Also went to insider and updated plugin version and had same issue when clicking on the edit/reading button multiple times.

Windows v0.16.2
Plugin v4.7.2

Two Line Custom Title Bar

As the Title suggests, would it be possible to have more than one line in the Plugin. One, for the Title itself and second for the icons? Long Titles and several icons do not mix on iPad! Thanks!

[Feature Request] Buttons based on Workspaces

My FR is simple to explain: would be amazing if we have a way to define a set of buttons based on different workspaces

  • When I use the word workspace I mean the Workspace Core Plugin.

In other words, the FR is to be able to define a different set of buttons when I am inside of one specific workspace.

Right click for pane relief navigation registers as a left click

I’ve added back and forward buttons to my page header. I use the pane relief plugin to provide a navigable history on mouse right click. It's been working well. From today. the right click now also registers as a left click. The “dropdown” opens, but the page also changes. I made the update to v0.15.6 earlier and it still worked okay. I noticed the new behavior just after doing plugin update.

Expected behavior:

Left click navigates one step back or forward.
Right click reveals the known file history from pane relief plugin functionality. And a second click is required before note page changes.

Show buttons based on frontmatter

First of all, thanks for this plugin.

This is not a bug but a feature request.

There is possible add features show buttons based on frontmatter?

Example 1: Article note

favorite:

Show a custom button when favorite field exists into frontmatter.

Example 2: task note

completed:

Show a custom button when completed field exists into frontmatter.

Creates empty leaf when closing file

Hi,

When I have this plugin enabled, whenever I close a file (including a hover editor) then an empty pane shows with the words "No file is open". This is especially annoying if you close a hover editor window then in the main section a new empty leaf appears. If I disable this plugin this no longer happens.

I'm currently running 0.15.3 of Obsidian and 4.4.0 of the plugin.

Cheers,
David

Add icon for every new pane

The icons are added on a per pane basis, so need to be added each time a new pane opens, not just onload.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.