Enha: mime to see marks

This commit is contained in:
Grail Finder
2025-09-10 09:38:07 +03:00
parent a1f38c2b26
commit 6daab9cb1a
4 changed files with 54 additions and 7 deletions

View File

@@ -4,11 +4,11 @@
{{range .}}
<div class="flex items-center justify-between p-2 rounded">
<span class="font-mono text-sm">
<span class="text-{{.ActorColor}}-600">{{.Actor}}:</span>
<span class="text-{{.ActorColor}}-600">{{.Actor}}:</span>
<span class="text-gray-600">{{.Action}}:</span>
<span class="text-{{.WordColor}}-500 font-medium">{{.Word}}</span>
{{if .Number}}
<span class="text-gray-400">- {{.Number}}</span>
<span class="text-gray-400">- {{.Number}}</span>
{{end}}
</span>
</div>
@@ -16,9 +16,22 @@
</div>
<script>
if (!window.actionHistoryScrollSet) {
// Use HTMX's after-swap event to scroll after content updates
document.addEventListener('htmx:afterSwap', function(evt) {
if (evt.target.id === 'actionHistoryContainer' || evt.detail.target.id === 'actionHistoryContainer') {
const container = document.getElementById('actionHistoryContainer');
if (container) {
container.scrollTop = container.scrollHeight;
}
}
});
// Fallback for initial load
htmx.onLoad(function(target) {
if (target.id === 'actionHistoryContainer') {
target.scrollToBottom();
const container = document.getElementById('actionHistoryContainer');
if (container) {
container.scrollTop = container.scrollHeight;
}
}
});
window.actionHistoryScrollSet = true;