Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -694,19 +694,17 @@ Panel {
anchors.verticalCenter: parent.verticalCenter
spacing: Style.space(4)

PanelActionButton {
// Single-letter marks stand in for the Zed/Herdr logos
// so the buttons render in any panel font.
iconText: "Z"
SvgActionButton {
iconSource: "zed.svg"
tooltipText: row.kind === "open" ? "Open in Zed" : "Create and open in Zed"
foreground: root.foreground
fontFamily: root.fontFamily
enabled: !createProc.running && !herdrProc.running
onClicked: root.openInZed(row.index)
}

PanelActionButton {
iconText: "H"
SvgActionButton {
iconSource: "herdr.svg"
tooltipText: row.kind === "open" ? "Open in Herdr" : "Create in Herdr"
foreground: root.foreground
fontFamily: root.fontFamily
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Omarchy overlay plugin that fronts [`timber`](https://github.com/nnutter/timber)
managed Git worktrees, mirroring `timber tui`: fuzzy-filter the existing
worktrees, type `name@repo` to create, `enter` to open in Zed, or use
the trailing row icons to open in Zed (`Z`) or a Herdr space (`H`).
the trailing Zed/Herdr logo icons to open in Zed or a Herdr space.

## Requirements

Expand Down Expand Up @@ -40,8 +40,9 @@ Keys: the header is a quickfilter field — type to filter
`enter` open or create in Zed, `esc` clear then close. `tab` keeps the
platform meaning of switching to the next panel. Creating runs
`timber create --no-herdr name@repo` and opens the reported path in
Zed. Each selected row also offers trailing icons: `Z` opens in Zed
(same as `enter`), while `H` routes to Herdr — on a `name@repo` row
Zed. Each selected row also offers trailing logo icons: the Zed icon
opens in Zed (same as `enter`), while the Herdr icon routes to Herdr —
on a `name@repo` row
it runs `timber create --herdr name@repo`, on an existing worktree it
runs `timber herdr space --new name@repo` — the panel dismisses and a
`Timber Herdr space created` notification confirms instead of opening
Expand Down
74 changes: 74 additions & 0 deletions SvgActionButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import QtQuick
import qs.Commons
import qs.Ui

// Image-based sibling of PanelActionButton for the bundled Zed/Herdr
// SVG logos, which have no Nerd Font glyphs. Same box, hover fill,
// tooltip, and enabled gating as PanelActionButton; the image itself
// is rendered as-is (sourceSize keeps the raster crisp on hidpi).
BorderSurface {
id: root

property string iconSource: ""
property string tooltipText: ""
property color foreground: Color.foreground
property color hoverColor: foreground
property string fontFamily: Style.font.family
property real size: Style.space(22)

property bool focusable: false

signal clicked()

activeFocusOnTab: focusable
Keys.onReturnPressed: if (focusable) root.clicked()
Keys.onEnterPressed: if (focusable) root.clicked()
Keys.onSpacePressed: if (focusable) root.clicked()

implicitWidth: size
implicitHeight: size
radius: Style.cornerRadius

readonly property bool _showFocusRing: focusable && activeFocus
readonly property bool _hot: mouse.containsMouse && root.enabled

color: _showFocusRing
? Style.focusFillFor(hoverColor, hoverColor)
: (_hot
? Style.hoverFillFor(hoverColor, hoverColor)
: "transparent")
borderSpec: _showFocusRing ? Border.controlSpec("focus", hoverColor, hoverColor) : Border.none()

Behavior on color { ColorAnimation { duration: 60 } }

Image {
anchors.centerIn: parent
source: root.iconSource
width: root.size - Style.space(8)
height: root.size - Style.space(8)
fillMode: Image.PreserveAspectFit
smooth: true
mipmap: true
sourceSize.width: 88
sourceSize.height: 88
opacity: root.enabled ? 1.0 : 0.4
}

MouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: true
cursorShape: root.enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
enabled: root.enabled
onClicked: {
if (root.focusable) root.forceActiveFocus()
root.clicked()
}
}

PanelToolTip {
visible: root.tooltipText !== "" && mouse.containsMouse
text: root.tooltipText
fontFamily: root.fontFamily
}
}
6 changes: 6 additions & 0 deletions herdr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ node = "24"

[tasks.check]
description = "Syntax-check the plugin JavaScript and lint the QML"
run = "node --check TimberModel.js && node --check tests/model.test.mjs && bash tests/qml_lint.sh Panel.qml"
run = "node --check TimberModel.js && node --check tests/model.test.mjs && bash tests/qml_lint.sh Panel.qml && bash tests/qml_lint.sh SvgActionButton.qml"

[tasks.test]
description = "Run TimberModel unit tests"
Expand All @@ -23,7 +23,7 @@ set -euo pipefail
id="io.github.nnutter.omarchy-timber"
dest="${HOME}/.config/omarchy/plugins/${id}"
mkdir -p "$dest"
cp manifest.json Panel.qml TimberModel.js "$dest/"
cp manifest.json Panel.qml SvgActionButton.qml TimberModel.js herdr.svg zed.svg "$dest/"
if command -v omarchy-shell >/dev/null 2>&1; then
omarchy-shell shell rescanPlugins || echo "rescan failed: is omarchy-shell running?" >&2
omarchy restart shell
Expand Down
3 changes: 3 additions & 0 deletions zed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading