From d105a610dcc4d8b0315f95860df64eaed42cbcea Mon Sep 17 00:00:00 2001 From: "yves.gugger" Date: Wed, 10 Dec 2025 15:17:15 +0100 Subject: [PATCH] fix: Health check API + Portfolio UX improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API FIX: - quickHealthCheck now uses POST method (was GET) - Fixes 'int_parsing' error for domain_id PORTFOLIO UX: 1. Health Check now works correctly with POST /domains/health-check 2. Clear separation of List vs Sell: - 'List' button → Opens listing form (marketplace) - 'Sold?' button → Records completed sale (P&L tracking) 3. Improved Valuation Modal: - Shows 'Pounce Score Estimate' instead of just 'Estimated Value' - Color-coded confidence badge (high/medium/low) - Clear disclaimer about algorithmic estimate 4. Record Sale Modal: - Clear explanation of purpose (P&L tracking) - Hint to use 'List' button for marketplace LISTINGS PAGE: - Accepts ?domain= query parameter - Auto-opens create modal with prefilled domain - Seamless flow from Portfolio → List on Marketplace --- frontend/src/app/command/listings/page.tsx | 13 +++++- frontend/src/app/command/portfolio/page.tsx | 46 ++++++++++++++++----- frontend/src/lib/api.ts | 4 +- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/frontend/src/app/command/listings/page.tsx b/frontend/src/app/command/listings/page.tsx index 84c7013..8dafdc0 100755 --- a/frontend/src/app/command/listings/page.tsx +++ b/frontend/src/app/command/listings/page.tsx @@ -1,6 +1,7 @@ 'use client' import { useEffect, useState } from 'react' +import { useSearchParams } from 'next/navigation' import { useStore } from '@/lib/store' import { api } from '@/lib/api' import { CommandCenterLayout } from '@/components/CommandCenterLayout' @@ -61,11 +62,13 @@ interface VerificationInfo { export default function MyListingsPage() { const { subscription } = useStore() + const searchParams = useSearchParams() + const prefillDomain = searchParams.get('domain') const [listings, setListings] = useState([]) const [loading, setLoading] = useState(true) - // Modals + // Modals - auto-open if domain is prefilled const [showCreateModal, setShowCreateModal] = useState(false) const [showVerifyModal, setShowVerifyModal] = useState(false) const [selectedListing, setSelectedListing] = useState(null) @@ -89,6 +92,14 @@ export default function MyListingsPage() { loadListings() }, []) + // Auto-open create modal if domain is prefilled from portfolio + useEffect(() => { + if (prefillDomain) { + setNewListing(prev => ({ ...prev, domain: prefillDomain })) + setShowCreateModal(true) + } + }, [prefillDomain]) + const loadListings = async () => { setLoading(true) try { diff --git a/frontend/src/app/command/portfolio/page.tsx b/frontend/src/app/command/portfolio/page.tsx index f0b1c6b..5bf431a 100644 --- a/frontend/src/app/command/portfolio/page.tsx +++ b/frontend/src/app/command/portfolio/page.tsx @@ -25,6 +25,7 @@ import { Activity, Shield, AlertTriangle, + Tag, } from 'lucide-react' // Health status configuration @@ -447,11 +448,20 @@ export default function PortfolioPage() { onClick={() => openEditModal(domain)} title="Edit" /> + e.stopPropagation()} + className="px-3 py-2 text-xs font-medium text-accent hover:bg-accent/10 rounded-lg transition-colors flex items-center gap-1" + > + + List + )} - {/* Sell Modal */} + {/* Record Sale Modal - for tracking completed sales */} {showSellModal && selectedDomain && ( - setShowSellModal(false)}> + setShowSellModal(false)}>
+
+

Record a completed sale to track your profit/loss. This will mark the domain as sold in your portfolio.

+

Want to list it for sale instead? Use the "List" button.

+
@@ -647,16 +661,26 @@ export default function PortfolioPage() {

${valuation.estimated_value.toLocaleString()}

-

Estimated Value

+

Pounce Score Estimate

-
- Confidence - {valuation.confidence} +
+ Confidence Level + + {valuation.confidence} +
-
- Formula - {valuation.valuation_formula} +
+

Valuation Formula

+

{valuation.valuation_formula}

+
+
+

This is an algorithmic estimate based on domain length, TLD, and market patterns. Actual market value may vary.

diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 8b055eb..1e44b50 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -385,7 +385,9 @@ class ApiClient { // Quick health check for any domain (premium) async quickHealthCheck(domain: string) { - return this.request(`/domains/health-check?domain=${encodeURIComponent(domain)}`) + return this.request(`/domains/health-check?domain=${encodeURIComponent(domain)}`, { + method: 'POST', + }) } // TLD Pricing