fix: resolve 3 critical UI bugs
CI / test (push) Failing after 4s
CI / lint (push) Failing after 3s

1. Refresh button no longer doubles header
   - Added ?fragment=1 param to filter/refresh HTMX requests
   - Board route returns board_fragment.html (columns only) for fragment requests
   - Refresh button uses window.location.reload() for full page reload

2. No more raw JSON in header
   - base.html: user info rendered server-side via template variable
   - board.py: decodes session cookie, passes user to template
   - Dashboard/board templates show Login/Deconnexion based on auth state

3. New issue form works
   - Replaced HTMX post with JS fetch (handleNewIssue)
   - Adds CSRF token to form submission
   - Reloads page on successful creation
   - Cleaner error handling
This commit is contained in:
2026-07-08 09:45:24 -04:00
parent e72c0dcbd8
commit a67f42bfe6
4 changed files with 189 additions and 279 deletions
+11 -3
View File
@@ -18,9 +18,17 @@
</a>
</div>
<div class="header-right">
<span id="user-info" hx-get="/auth/user" hx-trigger="load" hx-swap="innerHTML">
{% if user %}
<span id="user-info">
{% if user.avatar_url %}<img src="{{ user.avatar_url }}" width="20" height="20" class="avatar">{% endif %}
{{ user.login }}
<a href="/auth/logout" class="btn btn-sm">Déconnexion</a>
</span>
{% else %}
<span id="user-info">
<a href="/auth/login" class="btn btn-sm">🔑 Login</a>
</span>
{% endif %}
<button class="theme-toggle" onclick="toggleTheme()" title="Thème clair/sombre">🌓</button>
</div>
</header>
@@ -28,8 +36,7 @@
{% block content %}{% endblock %}
</main>
<!-- Card Detail Modal (global) -->
<div id="card-modal" class="modal-overlay" style="display:none" hx-target="#card-modal-content">
<div id="card-modal" class="modal-overlay" style="display:none">
<div class="modal-container">
<div class="modal-header">
<h3 id="card-modal-title">Détail</h3>
@@ -40,5 +47,6 @@
</div>
<script src="/static/js/app.js" defer></script>
{% block scripts %}{% endblock %}
</body>
</html>