Skip to content

Commit d28f062

Browse files
aksOpsPaperclip-Paperclipclaude
committed
fix: remove dead Run Analysis button, URL-encode node IDs, replace Tailwind CDN
- F1: Replace dead POST /api/analyze button with CLI instructions (index/enrich/serve) - F2: URL-encode node IDs in HTMX hx-get attributes using #uris.escapePathSegment() - F3: Build Tailwind CSS locally via existing Vite pipeline, remove CDN dependency Co-Authored-By: Paperclip <noreply@paperclip.ing> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent abf7f92 commit d28f062

7 files changed

Lines changed: 46 additions & 51 deletions

File tree

src/main/frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc -b && vite build",
8+
"build": "tsc -b && vite build && npm run build:explorer-css",
9+
"build:explorer-css": "npx tailwindcss -i ./src/explorer.css -o ../resources/static/css/explorer.css --minify",
910
"preview": "vite preview"
1011
},
1112
"dependencies": {

src/main/frontend/src/explorer.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
[x-cloak] { display: none !important; }
6+
.htmx-indicator { display: none; }
7+
.htmx-request .htmx-indicator { display: inline-block; }
8+
.htmx-request.htmx-indicator { display: inline-block; }
9+
.card-stagger:nth-child(1) { animation-delay: 0ms; }
10+
.card-stagger:nth-child(2) { animation-delay: 30ms; }
11+
.card-stagger:nth-child(3) { animation-delay: 60ms; }
12+
.card-stagger:nth-child(4) { animation-delay: 90ms; }
13+
.card-stagger:nth-child(5) { animation-delay: 120ms; }
14+
.card-stagger:nth-child(6) { animation-delay: 150ms; }
15+
.card-stagger:nth-child(7) { animation-delay: 180ms; }
16+
.card-stagger:nth-child(8) { animation-delay: 210ms; }
17+
::-webkit-scrollbar { width: 6px; height: 6px; }
18+
::-webkit-scrollbar-track { background: transparent; }
19+
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }

src/main/frontend/tailwind.config.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import type { Config } from 'tailwindcss';
22

33
export default {
44
darkMode: 'class',
5-
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
5+
content: [
6+
'./index.html',
7+
'./src/**/*.{js,ts,jsx,tsx}',
8+
'../resources/templates/**/*.html',
9+
],
610
theme: {
711
extend: {
812
colors: {
@@ -20,6 +24,7 @@ export default {
2024
950: '#1e1b4b',
2125
},
2226
surface: {
27+
DEFAULT: '#f8fafc',
2328
0: '#ffffff',
2429
50: '#f8fafc',
2530
100: '#f1f5f9',
@@ -33,6 +38,15 @@ export default {
3338
850: '#162032',
3439
900: '#0f172a',
3540
950: '#0a0a1a',
41+
dark: '#0f172a',
42+
},
43+
card: {
44+
DEFAULT: '#ffffff',
45+
dark: '#1e293b',
46+
},
47+
muted: {
48+
DEFAULT: '#64748b',
49+
dark: '#94a3b8',
3650
},
3751
},
3852
fontFamily: {

src/main/resources/static/css/explorer.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/resources/templates/explorer/fragments/nodes-grid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ <h2 class="text-lg font-semibold capitalize" th:text="${kind}">kind</h2>
4949
class="text-[10px] px-1.5 py-0.5 rounded bg-violet-100 dark:bg-violet-900/30 text-violet-700 dark:text-violet-300 font-mono"
5050
th:text="${ann}">@ann</span>
5151
</div>
52-
<button th:attr="hx-get='/ui/fragments/detail/' + ${node['id']}"
52+
<button th:attr="hx-get='/ui/fragments/detail/' + ${#uris.escapePathSegment(node['id'])}"
5353
hx-target="#content" hx-swap="innerHTML"
5454
class="text-xs font-medium px-3 py-1.5 rounded-md text-muted dark:text-muted-dark hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors whitespace-nowrap">
5555
Details

src/main/resources/templates/explorer/fragments/search-results.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h2 class="text-lg font-semibold">
3838
<div th:if="${node['file_path'] != null}" class="text-xs text-muted dark:text-muted-dark font-mono truncate"
3939
th:text="${node['file_path']}">file</div>
4040
</div>
41-
<button th:attr="hx-get='/ui/fragments/detail/' + ${node['id']}"
41+
<button th:attr="hx-get='/ui/fragments/detail/' + ${#uris.escapePathSegment(node['id'])}"
4242
hx-target="#content" hx-swap="innerHTML"
4343
class="text-xs font-medium px-3 py-1.5 rounded-md text-muted dark:text-muted-dark hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors whitespace-nowrap">
4444
Details

src/main/resources/templates/explorer/index.html

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,10 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>OSSCodeIQ Explorer</title>
88

9-
<script src="https://cdn.tailwindcss.com"></script>
10-
<script>
11-
tailwind.config = {
12-
darkMode: 'class',
13-
theme: {
14-
extend: {
15-
colors: {
16-
brand: { 50: '#eff6ff', 100: '#dbeafe', 200: '#bfdbfe', 400: '#60a5fa', 500: '#3b82f6', 600: '#2563eb', 700: '#1d4ed8', 800: '#1e40af', 900: '#1e3a5f' },
17-
surface: { DEFAULT: '#f8fafc', dark: '#0f172a' },
18-
card: { DEFAULT: '#ffffff', dark: '#1e293b' },
19-
muted: { DEFAULT: '#64748b', dark: '#94a3b8' }
20-
},
21-
animation: {
22-
'fade-in': 'fadeIn 0.3s ease-out',
23-
'slide-up': 'slideUp 0.3s ease-out',
24-
},
25-
keyframes: {
26-
fadeIn: { '0%': { opacity: '0' }, '100%': { opacity: '1' } },
27-
slideUp: { '0%': { opacity: '0', transform: 'translateY(8px)' }, '100%': { opacity: '1', transform: 'translateY(0)' } },
28-
}
29-
}
30-
}
31-
}
32-
</script>
9+
<link rel="stylesheet" th:href="@{/css/explorer.css}">
3310
<script th:src="@{/js/htmx.min.js}"></script>
3411
<script defer th:src="@{/js/alpine.min.js}"></script>
3512

36-
<style>
37-
[x-cloak] { display: none !important; }
38-
.htmx-indicator { display: none; }
39-
.htmx-request .htmx-indicator { display: inline-block; }
40-
.htmx-request.htmx-indicator { display: inline-block; }
41-
.card-stagger:nth-child(1) { animation-delay: 0ms; }
42-
.card-stagger:nth-child(2) { animation-delay: 30ms; }
43-
.card-stagger:nth-child(3) { animation-delay: 60ms; }
44-
.card-stagger:nth-child(4) { animation-delay: 90ms; }
45-
.card-stagger:nth-child(5) { animation-delay: 120ms; }
46-
.card-stagger:nth-child(6) { animation-delay: 150ms; }
47-
.card-stagger:nth-child(7) { animation-delay: 180ms; }
48-
.card-stagger:nth-child(8) { animation-delay: 210ms; }
49-
::-webkit-scrollbar { width: 6px; height: 6px; }
50-
::-webkit-scrollbar-track { background: transparent; }
51-
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
52-
</style>
53-
5413
<script>
5514
function themeManager() {
5615
return {
@@ -366,11 +325,12 @@ <h3 class="font-semibold text-sm capitalize" th:text="${kindEntry['kind']}">kind
366325
<svg class="mx-auto w-12 h-12 text-muted dark:text-muted-dark mb-4" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
367326
<path d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"/>
368327
</svg>
369-
<p class="text-muted dark:text-muted-dark">No nodes found. Run an analysis first.</p>
370-
<button hx-post="/api/analyze" hx-swap="none"
371-
class="mt-4 text-sm font-medium px-4 py-2 rounded-lg bg-brand-600 text-white hover:bg-brand-700 transition-colors">
372-
Run Analysis
373-
</button>
328+
<p class="text-muted dark:text-muted-dark mb-2">No nodes found. Run the analysis pipeline from the CLI first:</p>
329+
<div class="inline-block text-left bg-slate-100 dark:bg-slate-800 rounded-lg p-4 mt-2">
330+
<code class="block text-sm font-mono text-slate-700 dark:text-slate-300 mb-1">code-iq index /path/to/repo</code>
331+
<code class="block text-sm font-mono text-slate-700 dark:text-slate-300 mb-1">code-iq enrich /path/to/repo</code>
332+
<code class="block text-sm font-mono text-slate-700 dark:text-slate-300">code-iq serve /path/to/repo</code>
333+
</div>
374334
</div>
375335
</div>
376336
</main>

0 commit comments

Comments
 (0)