local-workspace: add Open button on file hover like Library, opens in side preview panel
FlowDeck CI / test (push) Failing after 5s
FlowDeck CI / docker (push) Has been skipped

- Add openSidePeek(id) helper method to find node by id and open in side preview
- Update renderChildren() static HTML OPEN button: replace full page nav with selectForPreview
- Add OPEN button in Alpine x-for tree template actions div for file items
- Uses existing preview-panel (right side panel) instead of navigating away
This commit is contained in:
2026-07-22 08:25:39 -04:00
parent 13e0bfb28a
commit 288f99d81e
+11 -4
View File
@@ -1123,11 +1123,11 @@ window._wsInitData = (function() {
}
html += '<button class="ws-act" data-ws-action="rename" data-ws-id="'+escId+'" data-ws-name="'+escName+'" title="Rename">'+getSvgIcon('edit',14)+'</button>';
html += '<button class="ws-act danger" data-ws-action="delete" data-ws-id="'+escId+'" data-ws-name="'+escName+'" title="Delete">'+getSvgIcon('trash',14)+'</button>';
// Open button for files
// Open button for files — opens in side preview panel (like Library)
if (!c.is_folder) {
html += '<a href="/pages/'+escId+'" class="btn-open" style="display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border:1px solid var(--border);border-radius:4px;font-size:12px;color:var(--text-secondary);background:var(--bg-tertiary);cursor:pointer;text-decoration:none;margin-left:4px;opacity:0;"'
+ ' onmouseover="this.style.opacity=\'1\'" onmouseout="this.style.opacity=\'0\'"'
+ ' onclick="event.stopPropagation();return true">\u2931 Open</a>';
html += '<a href="#" class="btn-open hover-only" style="display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border:1px solid var(--border);border-radius:4px;font-size:12px;color:var(--text-secondary);background:var(--bg-tertiary);cursor:pointer;text-decoration:none;margin-left:auto;"'
+ ' onclick="event.stopPropagation();event.preventDefault();var d=window._wsData;if(d)d.openSidePeek('+escId+')"\n'
+ ' title="Open in side preview">\u21e2 Open</a>';
}
// Tags
if (c.tags && c.tags.length > 0) {
@@ -1791,6 +1791,10 @@ window._wsInitData = (function() {
},
openPage(id) { window.location = '/pages/'+id; },
openSidePeek(id) {
var node = this._findNodeById(this.tree, id) || this._findNodeById(this.displayTree, id);
if (node) this.selectForPreview(node);
},
startRename(node) {
this.target = node;
@@ -2441,6 +2445,9 @@ console.log('FLOWDECK v2.4.6 — IIFE done, _wsInitData keys:', Object.keys(wind
</template>
<button class="ws-act" @click.stop="startRename(node)" title="Rename">{{ fd_icon("edit",14) }}</button>
<button class="ws-act danger" @click.stop="deleteWithUndo(node)" title="Delete">{{ fd_icon("trash",14) }}</button>
<template x-if="!node.is_folder">
<a href="#" class="btn-open" @click.prevent.stop="selectForPreview(node)" title="Open in side preview" style="margin-left:auto;">↢ Open</a>
</template>
</div>
</div>
<!-- Children -->