Skip to content

Commit 9dd5897

Browse files
committed
Enhance ArticleExtractPanel: add panel readiness state and prevent rendering until ready
1 parent efbb8fe commit 9dd5897

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

apps/qwksearch-web/components/ResearchAgent/components/ArticleReader/ArticleExtractPanel.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const ArticleExtractPanel: React.FC<ArticleExtractPanelProps> = (props) => {
5959
const [isDesktop, setIsDesktop] = useState(false);
6060
const [panelWidth, setPanelWidth] = useState(contextPanelWidth);
6161
const [isResizing, setIsResizing] = useState(false);
62+
const [isPanelReady, setIsPanelReady] = useState(false);
6263
const resizeRef = useRef<HTMLDivElement>(null);
6364

6465
// Track window width for desktop/mobile layout
@@ -103,7 +104,10 @@ const ArticleExtractPanel: React.FC<ArticleExtractPanelProps> = (props) => {
103104
// Extract URL content when panel opens
104105
useEffect(() => {
105106
if (isOpen && url) {
107+
setIsPanelReady(false);
106108
extractURL();
109+
} else if (!isOpen) {
110+
setIsPanelReady(false);
107111
}
108112
}, [isOpen, url]);
109113

@@ -157,6 +161,7 @@ const ArticleExtractPanel: React.FC<ArticleExtractPanelProps> = (props) => {
157161

158162
checkIfFavorited();
159163
setIsLoadingExtract(false);
164+
setIsPanelReady(true);
160165
};
161166

162167
const checkIfFavorited = async () => {
@@ -300,12 +305,7 @@ const ArticleExtractPanel: React.FC<ArticleExtractPanelProps> = (props) => {
300305
<ArticlePanelHeader onClose={onClose} />
301306

302307
<div className="flex-1 overflow-y-auto">
303-
{isLoadingExtract ? (
304-
<div className="flex justify-center items-center h-full">
305-
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500"></div>
306-
</div>
307-
) : (
308-
<div className="p-4 space-y-6">
308+
<div className="p-4 space-y-6">
309309
<div className="space-y-4">
310310
<ArticleActionButtons
311311
isLoadingAI={isLoadingAI}
@@ -386,12 +386,12 @@ const ArticleExtractPanel: React.FC<ArticleExtractPanelProps> = (props) => {
386386
/>
387387
)}
388388
</div>
389-
)}
390389
</div>
391390
</div>
392391
);
393392

394-
if (!isOpen) return null;
393+
// Don't render panel until it's open and content is ready
394+
if (!isOpen || !isPanelReady) return null;
395395

396396
// Mobile: Full-screen overlay panel
397397
if (!isDesktop) {

packages/agent-toolkit/src/config/language-models-database.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ export const LANGUAGE_MODELS = [
1212
"provider": "NVIDIA",
1313
"docs": "https://docs.api.nvidia.com/nim/reference/llm-apis",
1414
"api_key": "https://build.nvidia.com/settings/api-keys",
15-
"default": "nvidia/nemotron-3-super-120b-a12b",
15+
"default": "nvidia/llama-3.1-nemotron-70b-instruct",
1616
"models": [
17+
{
18+
"name": "Llama 3.1 Nemotron 70B Instruct",
19+
"id": "nvidia/llama-3.1-nemotron-70b-instruct",
20+
"contextLength": 131_072,
21+
"free": true,
22+
"type": "text-generation"
23+
},
1724
{
1825
"name": "Nemotron 3 Super 120B",
1926
"id": "nvidia/nemotron-3-super-120b-a12b",

0 commit comments

Comments
 (0)