Skip to content

Commit 91a8d6e

Browse files
authored
fix(ui): prevent theme flash and align search filter buttons (#41)
- base.html: apply stored theme synchronously in <head> so light-mode users no longer see a brief dark paint on every navigation - search.html: vertically center the All / Ask Logs / Agent Logs filter buttons with the Search heading
1 parent 0018ce7 commit 91a8d6e

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

templates/base.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<title>{% block title %}Cursor Chat Browser{% endblock %}</title>
7+
<!-- Apply stored theme BEFORE the stylesheet loads to avoid a dark->light
8+
flash on every navigation when light is the user's preference. -->
9+
<script>
10+
(function () {
11+
try {
12+
var t = localStorage.getItem('theme') || 'dark';
13+
document.documentElement.setAttribute('data-theme', t);
14+
} catch (e) {}
15+
})();
16+
</script>
717
<link rel="stylesheet" href="/static/css/style.css">
818
<!-- Highlight.js for code syntax highlighting -->
919
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/vs2015.min.css" id="hljs-theme">

templates/search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="search-page">
55
<div class="page-header">
66
<h1>Search</h1>
7-
<div class="btn-group">
7+
<div class="btn-group" style="align-self:center">
88
<button class="btn" id="filter-all" onclick="setFilter('all')">All</button>
99
<button class="btn btn-outline" id="filter-chat" onclick="setFilter('chat')">Ask Logs</button>
1010
<button class="btn btn-outline" id="filter-composer" onclick="setFilter('composer')">Agent Logs</button>

0 commit comments

Comments
 (0)