From e8bdbe501764a19be1b207f91656ce81a1daebe2 Mon Sep 17 00:00:00 2001 From: Dominic Huber Date: Sat, 11 Apr 2026 16:09:37 +0200 Subject: [PATCH 1/2] improve-glossary-ui --- src/app/glossary/page.tsx | 102 ++++++++++++++++++++++---------- src/content/glossary/altcoin.md | 2 +- 2 files changed, 72 insertions(+), 32 deletions(-) diff --git a/src/app/glossary/page.tsx b/src/app/glossary/page.tsx index 45b36a2..9fa8d58 100644 --- a/src/app/glossary/page.tsx +++ b/src/app/glossary/page.tsx @@ -81,7 +81,26 @@ export default function GlossaryPage() { normalizedLetter === selectedLetter return matchesSearch && matchesLetter - }).sort((a, b) => a.term.localeCompare(b.term)) + }).sort((a, b) => { + if (searchQuery) { + const query = searchQuery.toLowerCase() + + // 1. Exact match in title gets highest priority + const aExact = a.term.toLowerCase() === query + const bExact = b.term.toLowerCase() === query + if (aExact && !bExact) return -1 + if (!aExact && bExact) return 1 + + // 2. Partial match in title or aliases gets second priority + const aInTitle = a.term.toLowerCase().includes(query) || (a.aliases && a.aliases.some(alias => alias.toLowerCase().includes(query))) + const bInTitle = b.term.toLowerCase().includes(query) || (b.aliases && b.aliases.some(alias => alias.toLowerCase().includes(query))) + if (aInTitle && !bInTitle) return -1 + if (!aInTitle && bInTitle) return 1 + } + + // 3. Fallback to alphabetical sorting + return a.term.localeCompare(b.term) + }) }, [terms, searchQuery, selectedLetter]) const handleClearFilters = () => { @@ -111,18 +130,18 @@ export default function GlossaryPage() { {/* Filter & Search Section */} -
-
+
+
{/* Top Row: Search and Clear */} -
-
- +
+
+ setSearchQuery(e.target.value)} /> @@ -132,9 +151,9 @@ export default function GlossaryPage() { )} @@ -147,8 +166,8 @@ export default function GlossaryPage() { + ))} +
+
+ )} + {isLoading ? (
@@ -207,27 +248,26 @@ export default function GlossaryPage() { -
-

+
+

{term.term}

- {term.relatedArticle && ( -
- - SBI-{term.relatedArticle.padStart(3, '0')} - -
- )} - -

- {term.shortDefinition} -

+ {/* Expandable description on hover */} +
+
+
+

+ {term.shortDefinition} +

-
- Read full definition → +
+ Read full definition → +
+
+
diff --git a/src/content/glossary/altcoin.md b/src/content/glossary/altcoin.md index 13b4005..221d6a9 100644 --- a/src/content/glossary/altcoin.md +++ b/src/content/glossary/altcoin.md @@ -3,7 +3,7 @@ term: "Altcoin" aliases: ["altcoins"] slug: "altcoin" category: "General" -shortDefinition: "An altcoin (alternative coin) is any cryptocurrency other than Bitcoin...." +shortDefinition: "An altcoin (alternative coin) is any cryptocurrency other than Bitcoin." relatedArticle: "" published: true --- From 4d7e6b09d490006cbf12491115ce0de3e9f25f4e Mon Sep 17 00:00:00 2001 From: Dominic Huber Date: Sat, 11 Apr 2026 16:21:34 +0200 Subject: [PATCH 2/2] add-cta-to-glossary --- src/app/glossary/page.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/app/glossary/page.tsx b/src/app/glossary/page.tsx index 9fa8d58..8a21ac5 100644 --- a/src/app/glossary/page.tsx +++ b/src/app/glossary/page.tsx @@ -6,6 +6,7 @@ import { Badge } from '@/components/ui/badge' import { Input } from '@/components/ui/input' import { Button } from '@/components/ui/button' import { Search, X } from 'lucide-react' +import CTAButton from '@/components/ui/cta-button' import { useState, useMemo, useEffect } from 'react' interface GlossaryTerm { @@ -284,6 +285,24 @@ export default function GlossaryPage() {

+ + {/* CTA Section */} +
+
+
+
+

Eager to learn more about the Bitcoin ecosystem?

+

+ Explore our research on Bitcoin's ecosystem spanning accross 6 different domains. +

+
+ + View our Research + +
+
+
+
) } \ No newline at end of file