From 202e615e2bf2afd3c4301b6bc976ca2038154b56 Mon Sep 17 00:00:00 2001 From: Yves Gugger Date: Thu, 18 Dec 2025 14:14:37 +0100 Subject: [PATCH] fix: TLD Matrix shows own domain correctly as taken + Portfolio table responsive 1. TLD Matrix fix: - Pass original_is_taken flag to run_tld_matrix() - If main domain check shows taken, force same TLD to show as taken - Fixes incorrect "available" display for owned domains 2. Portfolio table: - Use minmax() for flexible column widths - Smaller gaps and padding for compact layout - Smaller action buttons (w-8 h-8) - Shorter column labels (Bought, Exp.) --- .../services/analyze/analyzers/tld_matrix.py | 7 +++- backend/app/services/analyze/tld_matrix.py | 36 ++++++++++++++++--- frontend/src/app/terminal/portfolio/page.tsx | 34 +++++++++--------- 3 files changed, 55 insertions(+), 22 deletions(-) diff --git a/backend/app/services/analyze/analyzers/tld_matrix.py b/backend/app/services/analyze/analyzers/tld_matrix.py index b171f12..d2f76fb 100644 --- a/backend/app/services/analyze/analyzers/tld_matrix.py +++ b/backend/app/services/analyze/analyzers/tld_matrix.py @@ -10,7 +10,12 @@ class TldMatrixAnalyzer: ttl_seconds = 60 * 30 # 30m (availability can change) async def analyze(self, ctx: AnalyzeContext) -> list[AnalyzerContribution]: - rows = await run_tld_matrix(ctx.domain) + # If main domain check says it's taken, pass that info to TLD matrix + # This ensures the original TLD shows correctly as "taken" even if + # DNS-based checks fail (e.g., domain registered but no DNS records) + original_is_taken = ctx.check and not ctx.check.is_available + + rows = await run_tld_matrix(ctx.domain, original_is_taken=original_is_taken) item = AnalyzeItem( key="tld_matrix", label="TLD Matrix", diff --git a/backend/app/services/analyze/tld_matrix.py b/backend/app/services/analyze/tld_matrix.py index 53910a6..36bfe5c 100644 --- a/backend/app/services/analyze/tld_matrix.py +++ b/backend/app/services/analyze/tld_matrix.py @@ -48,11 +48,21 @@ async def _check_one(domain: str) -> TldMatrixRow: ) -async def run_tld_matrix(domain: str, tlds: list[str] | None = None) -> list[TldMatrixRow]: - sld = (domain or "").split(".")[0].lower().strip() +async def run_tld_matrix(domain: str, tlds: list[str] | None = None, original_is_taken: bool = False) -> list[TldMatrixRow]: + """ + Check availability for the same SLD across multiple TLDs. + + Args: + domain: The full domain being analyzed (e.g., "akaya.ch") + tlds: List of TLDs to check (defaults to DEFAULT_TLDS) + original_is_taken: If True, force the original domain's TLD to show as taken + """ + parts = (domain or "").lower().strip().split(".") + sld = parts[0] if parts else "" + original_tld = parts[-1] if len(parts) > 1 else "" tlds = [t.lower().lstrip(".") for t in (tlds or DEFAULT_TLDS)] - # Avoid repeated checks and the original TLD duplication + # Avoid repeated checks seen = set() candidates: list[str] = [] for t in tlds: @@ -62,5 +72,23 @@ async def run_tld_matrix(domain: str, tlds: list[str] | None = None) -> list[Tld seen.add(d) rows = await asyncio.gather(*[_check_one(d) for d in candidates]) - return list(rows) + result = list(rows) + + # If the original domain is known to be taken, ensure its TLD shows as taken + # This fixes cases where DNS-based quick checks incorrectly show "available" + # for domains that are registered but have no DNS records + if original_is_taken and original_tld: + result = [ + TldMatrixRow( + tld=r.tld, + domain=r.domain, + is_available=False, + status="taken", + method=r.method, + error=r.error, + ) if r.tld == original_tld else r + for r in result + ] + + return result diff --git a/frontend/src/app/terminal/portfolio/page.tsx b/frontend/src/app/terminal/portfolio/page.tsx index eba89ca..2731f74 100755 --- a/frontend/src/app/terminal/portfolio/page.tsx +++ b/frontend/src/app/terminal/portfolio/page.tsx @@ -1346,31 +1346,31 @@ export default function PortfolioPage() { ) : (
{/* Desktop Table Header */} -
+
Registrar
- - - -
Yield
Health
-
Actions
+
Actions
{/* Table Body */} @@ -1393,7 +1393,7 @@ export default function PortfolioPage() { )} > {/* DESKTOP ROW */} -
+
{/* Domain */}