feat: Market Intel UI Polish - Hide History in Modal & Better Project Naming

This commit is contained in:
2025-12-29 15:17:04 +00:00
parent 457d0e06d8
commit 9c22a762b9
2 changed files with 252 additions and 278 deletions

View File

@@ -46,9 +46,25 @@ const App: React.FC = () => {
const saveData = async () => {
if (!referenceUrl) return;
let dynamicName = projectName;
try {
const refHost = new URL(referenceUrl).hostname.replace('www.', '');
if (analysisResults && analysisResults.length > 0) {
// Use the first analyzed company as the title anchor
dynamicName = `${analysisResults[0].companyName} (Ref: ${refHost})`;
} else if (competitors && competitors.length > 0) {
dynamicName = `Search: ${refHost} Lookalikes`;
} else if (!projectName || projectName === "New Project") {
dynamicName = `Draft: ${refHost}`;
}
} catch (e) {
dynamicName = projectName || "Untitled Project";
}
const dataToSave = {
id: projectId,
name: projectName || new URL(referenceUrl).hostname,
name: dynamicName,
created_at: new Date().toISOString(), // DB updates updated_at automatically
currentStep: step,
language,