fix: library row icons → outline SVG + context menu width
- library.html L591: item.icon (emoji) → self._renderIcon('file')
- library.html: +_renderIcon() helper with validNames filter
- app.css: context-menu min-width:200px → width:max-content + max-width:240px
- 143 tests passent
This commit is contained in:
@@ -588,7 +588,7 @@ function libraryPage() {
|
|||||||
if (isFolder) {
|
if (isFolder) {
|
||||||
html += '<span class="row-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"/></svg></span>';
|
html += '<span class="row-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7z"/></svg></span>';
|
||||||
} else {
|
} else {
|
||||||
html += '<span class="row-icon">' + (item.icon || '\ud83d\udcc4') + '</span>';
|
html += '<span class="row-icon">' + self._renderIcon(item.icon, 'file') + '</span>';
|
||||||
}
|
}
|
||||||
// Title or rename input
|
// Title or rename input
|
||||||
if (isRenaming) {
|
if (isRenaming) {
|
||||||
@@ -617,6 +617,13 @@ function libraryPage() {
|
|||||||
|
|
||||||
_escHtml(s) { var d=document.createElement('div'); d.textContent = s||''; return d.innerHTML; },
|
_escHtml(s) { var d=document.createElement('div'); d.textContent = s||''; return d.innerHTML; },
|
||||||
_escAttr(s) { return String(s||'').replace(/&/g,'&').replace(/"/g,'"').replace(/</g,'<').replace(/>/g,'>'); },
|
_escAttr(s) { return String(s||'').replace(/&/g,'&').replace(/"/g,'"').replace(/</g,'<').replace(/>/g,'>'); },
|
||||||
|
_renderIcon(icon, fallback) {
|
||||||
|
var name = icon || fallback || 'file';
|
||||||
|
// Only allow known icon names, otherwise use fallback
|
||||||
|
var valid = ['folder','file','star','link','trash','book','home','settings','lock','globe','image','edit','calendar','users','user','search','tag','bar-chart','grid','list','align-left','zap','paperclip','key','refresh','upload'];
|
||||||
|
if (valid.indexOf(name) === -1) name = fallback || 'file';
|
||||||
|
return getSvgIcon(name, 14);
|
||||||
|
},
|
||||||
|
|
||||||
_recomputeFlatItems() {
|
_recomputeFlatItems() {
|
||||||
var result = [];
|
var result = [];
|
||||||
|
|||||||
+2
-1
@@ -684,7 +684,8 @@ input, select, textarea { font-family: inherit; color: inherit; }
|
|||||||
border: 1px solid var(--border-light);
|
border: 1px solid var(--border-light);
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-md);
|
||||||
box-shadow: 0 8px 24px rgba(0,0,0,0.4);
|
box-shadow: 0 8px 24px rgba(0,0,0,0.4);
|
||||||
min-width: 200px;
|
width: max-content;
|
||||||
|
max-width: 240px;
|
||||||
padding: var(--space-xs) 0;
|
padding: var(--space-xs) 0;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
Reference in New Issue
Block a user