Skip to content

Commit e6734a3

Browse files
djinni-hpproCopilot
andcommitted
Fix provider icon display with proper Alpine.js directives
- Replace broken template literals with Alpine.js :class and x-text directives - Add getNoteSyncIcon() helper method to get icon symbol based on status - Properly bind classes for color and background based on sync status - Status icons: ✓ (ok, green), ⟳ (syncing, blue), ⚠ (partial, yellow), ✗ (error, red), ○ (idle, gray) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8f98637 commit e6734a3

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/index.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,10 @@ <h3 class="text-lg font-semibold" x-text="noteEditorNoteId ? ('Editing: #' + not
186186
<span class="text-xs font-bold" x-show="note.priority" x-text="'P:' + note.priority"></span>
187187
</div>
188188
<div class="flex items-center gap-2">
189-
<span class="text-xs ${getNoteSyncIconClass(getNoteSyncStatus(note).status).color} ${getNoteSyncIconClass(getNoteSyncStatus(note).status).bg} rounded-full p-1.5 shadow-sm">
190-
${getNoteSyncStatus(note).status === 'ok' ? '✓' : getNoteSyncStatus(note).status === 'syncing' ? '⟳' : getNoteSyncStatus(note).status === 'partial' ? '⚠' : getNoteSyncStatus(note).status === 'error' ? '✗' : '○'}
189+
<span class="text-xs rounded-full p-1.5 shadow-sm" :class="getNoteSyncIconClass(getNoteSyncStatus(note).status).color + ' ' + getNoteSyncIconClass(getNoteSyncStatus(note).status).bg">
190+
<span x-text="getNoteSyncIcon(getNoteSyncStatus(note).status)"></span>
191191
</span>
192192
<h4 class="text-base font-bold truncate mb-2" :style="{ 'color': getNoteColor(note) }" x-text="note.title"></h4>
193-
<span class="text-xs ${getNoteSyncStatus(note).status === 'ok' ? 'text-green-600' : getNoteSyncStatus(note).status === 'syncing' ? 'text-blue-600' : getNoteSyncStatus(note).status === 'partial' ? 'text-yellow-600' : getNoteSyncStatus(note).status === 'error' ? 'text-red-600' : 'text-gray-600'} ml-2">
194-
${getNoteSyncStatus(note).status}
195-
</span>
196193
</div>
197194
<p class="text-sm line-clamp-5 break-all" x-text="getNotePreview(note.content)"></p>
198195
</div>

src/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,17 @@ document.addEventListener('alpine:init', () => { Alpine.data('mainApp', () => ({
408408
return { icon: 'clock', color: 'text-gray-400', bg: 'bg-gray-100' };
409409
}
410410
},
411+
412+
getNoteSyncIcon(status) {
413+
switch(status) {
414+
case 'ok': return '✓';
415+
case 'syncing': return '⟳';
416+
case 'partial': return '⚠';
417+
case 'error': return '✗';
418+
case 'idle': return '○';
419+
default: return '○';
420+
}
421+
},
411422

412423
getNoteSummary(note) {
413424
const status = this.getNoteSyncStatus(note);

0 commit comments

Comments
 (0)