feat(b2b-marketing): Finalize grounding architecture and frontend improvements
- Upgrade backend to use gemini-2.5-flash with sanitized HTML parsing (no token limit). - Implement robust retry logic and increased timeouts (600s) for deep analysis. - Add file-based logging for prompts and responses. - Fix API endpoint (v1) and regex parsing issues. - Frontend: Optimize PDF export (landscape, no scrollbars), fix copy-paste button, add 'Repeat Step 6' feature. - Update documentation to 'Completed' status.
This commit is contained in:
@@ -51,19 +51,55 @@ export const StepDisplay: React.FC<StepDisplayProps> = ({ title, summary, header
|
||||
onDataChange(newRows);
|
||||
};
|
||||
|
||||
const fallbackCopyTextToClipboard = (text: string) => {
|
||||
const textArea = document.createElement("textarea");
|
||||
textArea.value = text;
|
||||
|
||||
// Ensure textarea is not visible but part of DOM
|
||||
textArea.style.position = "fixed";
|
||||
textArea.style.left = "-9999px";
|
||||
textArea.style.top = "0";
|
||||
|
||||
document.body.appendChild(textArea);
|
||||
textArea.focus();
|
||||
textArea.select();
|
||||
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
setCopySuccess(t.copySuccess);
|
||||
setTimeout(() => setCopySuccess(''), 2000);
|
||||
} catch (err) {
|
||||
console.error('Fallback: Oops, unable to copy', err);
|
||||
setCopySuccess(t.copyFailure);
|
||||
setTimeout(() => setCopySuccess(''), 2000);
|
||||
}
|
||||
|
||||
document.body.removeChild(textArea);
|
||||
};
|
||||
|
||||
const handleCopyToClipboard = (text: string) => {
|
||||
navigator.clipboard.writeText(text).catch(err => console.error('Failed to copy text: ', err));
|
||||
if (!navigator.clipboard) {
|
||||
fallbackCopyTextToClipboard(text);
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(text).catch(err => {
|
||||
console.error('Failed to copy text: ', err);
|
||||
fallbackCopyTextToClipboard(text);
|
||||
});
|
||||
};
|
||||
|
||||
const handleCopyTable = () => {
|
||||
const tsvString = convertArrayToTsv(headers, filteredRows);
|
||||
if (!navigator.clipboard) {
|
||||
fallbackCopyTextToClipboard(tsvString);
|
||||
return;
|
||||
}
|
||||
navigator.clipboard.writeText(tsvString).then(() => {
|
||||
setCopySuccess(t.copySuccess);
|
||||
setTimeout(() => setCopySuccess(''), 2000);
|
||||
}).catch(err => {
|
||||
console.error('Failed to copy table: ', err);
|
||||
setCopySuccess(t.copyFailure);
|
||||
setTimeout(() => setCopySuccess(''), 2000);
|
||||
fallbackCopyTextToClipboard(tsvString);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -173,7 +209,7 @@ export const StepDisplay: React.FC<StepDisplayProps> = ({ title, summary, header
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="overflow-x-auto">
|
||||
<div className="overflow-x-auto print:overflow-visible print:block">
|
||||
<table className="w-full table-fixed text-sm text-left text-slate-500 dark:text-slate-400">
|
||||
<thead className="text-xs text-slate-700 dark:text-slate-300 uppercase bg-slate-100 dark:bg-slate-700">
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user