docs: fix README versioning table v1.5.0/v1.6.0, remove fix scripts from tracking
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -37,3 +37,4 @@ next-env.d.ts
|
||||
# logs
|
||||
logs
|
||||
*.log
|
||||
fix_*.py
|
||||
|
||||
@@ -143,6 +143,8 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
| Version | Date | Highlights |
|
||||
|---------|------|------------|
|
||||
| [1.6.0](CHANGELOG.md#160---2026-03-18) | 2026-03-18 20:34 | SEO web audit, URL fetching, auto web search for SEO mode |
|
||||
| [1.5.0](CHANGELOG.md#150---2026-03-18) | 2026-03-18 20:29 | Modification progress overlay, preview blink fix |
|
||||
| [1.4.0](CHANGELOG.md#140---2026-03-18) | 2026-03-18 19:57 | Review Code button, web search grounding, responsive preview, model selector fix |
|
||||
| [1.3.0](CHANGELOG.md#130---2026-03-18) | 2026-03-18 18:51 | Plan-first workflow, OpenRouter, post-coding UX, enhanced prompt engine |
|
||||
| [1.2.0](CHANGELOG.md#120---2026-01-19) | 2026-01-19 19:16 | SEO agent fixes, Z.AI API validation |
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
||||
with open(fp, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Fix the array that lost all its quotes
|
||||
old = '{([[full, Full], [desktop, Desktop], [tablet, Tablet], [mobile, Mobile]] as const).map(([size, label]) => ('
|
||||
new = '{([["full", "Full"], ["desktop", "Desktop"], ["tablet", "Tablet"], ["mobile", "Mobile"]] as const).map(([size, label]) => ('
|
||||
|
||||
if old in content:
|
||||
content = content.replace(old, new, 1)
|
||||
print('Fixed array quotes')
|
||||
else:
|
||||
print('WARNING: Could not find array')
|
||||
|
||||
with open(fp, 'w') as f:
|
||||
f.write(content)
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
||||
with open(fp, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
changes = 0
|
||||
|
||||
# Fix 1: viewMode === preview -> viewMode === "preview"
|
||||
old = 'viewMode === preview && ('
|
||||
new = 'viewMode === "preview" && ('
|
||||
if old in content:
|
||||
content = content.replace(old, new, 1)
|
||||
changes += 1
|
||||
print('Fix 1: viewMode quote restored')
|
||||
|
||||
# Fix 2: className=flex -> className="flex"
|
||||
old = 'className=flex items-center gap-1 mt-1.5'
|
||||
new = 'className="flex items-center gap-1 mt-1.5"'
|
||||
if old in content:
|
||||
content = content.replace(old, new, 1)
|
||||
changes += 1
|
||||
print('Fix 2: className quote restored')
|
||||
|
||||
# Fix 3: Restore quotes in the device button className
|
||||
# The issue is the className prop lost its opening quote and the string content lost quotes
|
||||
old_btn_class = '''className={cn(
|
||||
px-2 py-1 text-[9px] font-black uppercase rounded-md transition-all border,
|
||||
deviceSize === size
|
||||
? bg-blue-500 text-white border-blue-500 shadow-md
|
||||
: text-blue-300/50 border-transparent hover:text-blue-200 hover:bg-blue-900/30
|
||||
)}'''
|
||||
new_btn_class = '''className={cn(
|
||||
"px-2 py-1 text-[9px] font-black uppercase rounded-md transition-all border",
|
||||
deviceSize === size
|
||||
? "bg-blue-500 text-white border-blue-500 shadow-md"
|
||||
: "text-blue-300/50 border-transparent hover:text-blue-200 hover:bg-blue-900/30"
|
||||
)}'''
|
||||
if old_btn_class in content:
|
||||
content = content.replace(old_btn_class, new_btn_class, 1)
|
||||
changes += 1
|
||||
print('Fix 3: Button className quotes restored')
|
||||
|
||||
with open(fp, 'w') as f:
|
||||
f.write(content)
|
||||
|
||||
print(f'Applied {changes}/3 fixes')
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
||||
with open(fp, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
changes = 0
|
||||
|
||||
# CHANGE 1: Add deviceSize state after viewMode state
|
||||
for i, line in enumerate(lines):
|
||||
if 'const [viewMode, setViewMode]' in line and 'useState' in line:
|
||||
new_lines = [
|
||||
line,
|
||||
' const [deviceSize, setDeviceSize] = useState<"full" | "desktop" | "tablet" | "mobile">("full");\n',
|
||||
' const deviceWidths: Record<string, string> = { full: "100%", desktop: "1280px", tablet: "768px", mobile: "375px" };\n',
|
||||
]
|
||||
lines[i:i+1] = new_lines
|
||||
changes += 1
|
||||
print('Change 1: Added deviceSize state')
|
||||
break
|
||||
|
||||
# CHANGE 2: Find canvas wrapper and add device-size wrapper around LiveCanvas
|
||||
for i, line in enumerate(lines):
|
||||
if 'flex-1 overflow-auto relative bg-[#050505]' in line and i > 1400:
|
||||
print('Found canvas wrapper at line', i+1)
|
||||
# Find LiveCanvas line
|
||||
for j in range(i, min(i+10, len(lines))):
|
||||
if '<LiveCanvas' in lines[j]:
|
||||
# Insert wrapper div before LiveCanvas
|
||||
indent = ' '
|
||||
wrapper = indent + '<div className="mx-auto transition-all duration-300 h-full"\n'
|
||||
wrapper += indent + ' style={deviceSize !== "full"\n'
|
||||
wrapper += indent + ' ? { width: deviceWidths[deviceSize], maxWidth: "100%", border: "1px solid rgba(30,58,138,0.3)", borderRadius: "12px", overflow: "hidden", boxShadow: "0 20px 60px rgba(0,0,0,0.5)" }\n'
|
||||
wrapper += indent + ' : undefined}>\n'
|
||||
lines[j:j] = [wrapper]
|
||||
changes += 1
|
||||
print('Change 2: Added device wrapper before LiveCanvas')
|
||||
break
|
||||
break
|
||||
|
||||
with open(fp, 'w') as f:
|
||||
f.writelines(lines)
|
||||
|
||||
print('Applied', changes, 'changes')
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
||||
with open(fp, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
changes = 0
|
||||
|
||||
for i, line in enumerate(lines):
|
||||
if 'flex-1 overflow-hidden relative' in line and i > 1400:
|
||||
lines[i] = ' <div className="flex-1 overflow-auto relative bg-[#050505]">\n'
|
||||
changes += 1
|
||||
print('Fixed overflow at line', i+1)
|
||||
|
||||
for j in range(i, min(i+10, len(lines))):
|
||||
if '<LiveCanvas' in lines[j]:
|
||||
ind = ' '
|
||||
w = ind + '<div className="mx-auto transition-all duration-300 h-full"\n'
|
||||
w += ind + ' style={deviceSize !== "full"\n'
|
||||
w += ind + ' ? { width: deviceWidths[deviceSize], maxWidth: "100%",\n'
|
||||
w += ind + ' border: "1px solid rgba(30,58,138,0.3)",\n'
|
||||
w += ind + ' borderRadius: "12px", overflow: "hidden",\n'
|
||||
w += ind + ' boxShadow: "0 20px 60px rgba(0,0,0,0.5)" }\n'
|
||||
w += ind + ' : undefined}>\n'
|
||||
lines[j:j] = [w]
|
||||
changes += 1
|
||||
print('Added device wrapper before LiveCanvas at line', j+1)
|
||||
break
|
||||
break
|
||||
|
||||
with open(fp, 'w') as f:
|
||||
f.writelines(lines)
|
||||
|
||||
print('Applied', changes, 'changes')
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Fix the broken reviewCode template literal."""
|
||||
|
||||
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
||||
with open(fp, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Find and replace the broken reviewPrompt line
|
||||
# The problem: backticks inside template literal need to be escaped with \`
|
||||
old_line = ' const reviewPrompt = `Please review this generated code for bugs, security issues, performance problems, and best practices. Provide specific improvements:\\n\\n\\\\`\\\\`\\\\`${previewData.language || "code"}\\n${previewData.data}\\n\\\\`\\\\`\\\\`';'
|
||||
|
||||
new_line = ' const reviewPrompt = "Please review this generated code for bugs, security issues, performance problems, and best practices. Provide specific improvements:\\n\\n\`\`\`" + (previewData.language || "code") + "\\n" + previewData.data + "\\n\`\`\`";'
|
||||
|
||||
if old_line in content:
|
||||
content = content.replace(old_line, new_line, 1)
|
||||
print("Fixed reviewCode template literal")
|
||||
else:
|
||||
# Try with the actual escaped content
|
||||
# Let's just find it by the function start and replace the whole function
|
||||
print("Trying line-by-line approach...")
|
||||
lines = content.split('\n')
|
||||
for i, line in enumerate(lines):
|
||||
if 'const reviewPrompt' in line and 'review this generated code' in line:
|
||||
print(f"Found at line {i+1}: {line[:80]}...")
|
||||
lines[i] = new_line
|
||||
print("Fixed")
|
||||
break
|
||||
content = '\n'.join(lines)
|
||||
|
||||
with open(fp, 'w') as f:
|
||||
f.write(content)
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
||||
with open(fp, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
bt = chr(96) # backtick character
|
||||
nl = chr(92) + 'n' # \n
|
||||
|
||||
for i, line in enumerate(lines):
|
||||
if 'const reviewPrompt' in line and 'review this generated code' in line:
|
||||
new_line = ' const reviewPrompt = "Please review this generated code for bugs, security issues, performance problems, and best practices. Provide specific improvements:" + "' + nl + '" + "' + nl + '" + "' + bt*3 + '" + (previewData.language || "code") + "' + nl + '" + previewData.data + "' + nl + '" + "' + bt*3 + '";\n'
|
||||
lines[i] = new_line
|
||||
print(f'Fixed line {i+1}')
|
||||
print(repr(new_line))
|
||||
break
|
||||
|
||||
with open(fp, 'w') as f:
|
||||
f.writelines(lines)
|
||||
210
fix_v1.4.0.py
210
fix_v1.4.0.py
@@ -1,210 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Apply v1.4.0 improvements: model color fix, review button, web search grounding."""
|
||||
|
||||
import re
|
||||
|
||||
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
||||
with open(fp, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
changes = 0
|
||||
|
||||
# ============================================================
|
||||
# CHANGE 1: Fix model selector text color
|
||||
# ============================================================
|
||||
old_option = '{availableModels.map(m => <option key={m} value={m}>{m}</option>)}'
|
||||
new_option = '{availableModels.map(m => <option key={m} value={m} className="bg-[#0b1414] text-white">{m}</option>)}'
|
||||
|
||||
if old_option in content:
|
||||
content = content.replace(old_option, new_option, 1)
|
||||
changes += 1
|
||||
print("Change 1: Fixed <option> text color to white")
|
||||
else:
|
||||
print("WARNING: Could not find option map")
|
||||
|
||||
# Also add text-white to the <select> className
|
||||
old_select_class = 'className="text-[10px] font-bold h-8 px-2 rounded-lg border border-blue-100 dark:border-blue-900 bg-white/80 dark:bg-[#0b1414]/80 focus:ring-2 focus:ring-blue-400/30 transition-all outline-none min-w-[120px]"'
|
||||
new_select_class = 'className="text-[10px] font-bold h-8 px-2 rounded-lg border border-blue-100 dark:border-blue-900 bg-white/80 dark:bg-[#0b1414]/80 focus:ring-2 focus:ring-blue-400/30 transition-all outline-none min-w-[120px] text-slate-900 dark:text-white"'
|
||||
|
||||
if old_select_class in content:
|
||||
content = content.replace(old_select_class, new_select_class, 1)
|
||||
changes += 1
|
||||
print("Change 1b: Added text-white to select element")
|
||||
else:
|
||||
print("WARNING: Could not find select className")
|
||||
|
||||
# ============================================================
|
||||
# CHANGE 2: Add ShieldCheck to lucide-react imports
|
||||
# ============================================================
|
||||
old_import = ' Wand2, LayoutPanelLeft, Play, Orbit, Plus, Key'
|
||||
new_import = ' Wand2, LayoutPanelLeft, Play, Orbit, Plus, Key, ShieldCheck'
|
||||
|
||||
if old_import in content:
|
||||
content = content.replace(old_import, new_import, 1)
|
||||
changes += 1
|
||||
print("Change 2: Added ShieldCheck to imports")
|
||||
else:
|
||||
print("WARNING: Could not find lucide import line")
|
||||
|
||||
# ============================================================
|
||||
# CHANGE 3: Add reviewCode function after approveAndGenerate
|
||||
# ============================================================
|
||||
old_approve = ''' const approveAndGenerate = () => {
|
||||
setAssistStep("generating");
|
||||
handleSendMessage(undefined, "Approved. Please generate the code according to the plan.", true);
|
||||
};'''
|
||||
|
||||
new_approve = ''' const approveAndGenerate = () => {
|
||||
setAssistStep("generating");
|
||||
handleSendMessage(undefined, "Approved. Please generate the code according to the plan.", true);
|
||||
};
|
||||
|
||||
const reviewCode = () => {
|
||||
if (!previewData?.data) return;
|
||||
setAssistStep("generating");
|
||||
const reviewPrompt = `Please review this generated code for bugs, security issues, performance problems, and best practices. Provide specific improvements:\\n\\n\\\`\\\`\\\`${previewData.language || "code"}\\n${previewData.data}\\n\\\`\\\`\\\``;
|
||||
handleSendMessage(undefined, reviewPrompt, true);
|
||||
};'''
|
||||
|
||||
if old_approve in content:
|
||||
content = content.replace(old_approve, new_approve, 1)
|
||||
changes += 1
|
||||
print("Change 3: Added reviewCode function")
|
||||
else:
|
||||
print("WARNING: Could not find approveAndGenerate block")
|
||||
|
||||
# ============================================================
|
||||
# CHANGE 4: Add Review Code button (grid-cols-2 -> 3)
|
||||
# ============================================================
|
||||
old_grid = '''<div className="mt-4 grid grid-cols-2 gap-2 animate-in zoom-in-95 duration-300">
|
||||
<Button
|
||||
onClick={() => { setShowCanvas(true); setViewMode(isPreviewRenderable(previewData as PreviewData) ? "preview" : "code"); }}
|
||||
className="bg-blue-600 hover:bg-blue-500 text-white font-black uppercase text-[10px] tracking-widest py-4 rounded-xl shadow-lg shadow-blue-500/20"
|
||||
>
|
||||
<Zap className="h-3.5 w-3.5 mr-1.5" /> {t.activateArtifact}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => { setAssistStep("idle"); setInput("Modify this: "); setTimeout(() => { const el = document.querySelector<HTMLInputElement>(`[data-ai-input]`); if (el) el.focus(); }, 100); }}
|
||||
variant="outline"
|
||||
className="bg-slate-500/10 hover:bg-slate-500/20 border-slate-500/20 text-slate-300 font-black uppercase text-[10px] tracking-widest py-4 rounded-xl"
|
||||
>
|
||||
<LayoutPanelLeft className="h-3.5 w-3.5 mr-1.5" /> Request Modifications
|
||||
</Button>
|
||||
</div>'''
|
||||
|
||||
new_grid = '''<div className="mt-4 grid grid-cols-3 gap-2 animate-in zoom-in-95 duration-300">
|
||||
<Button
|
||||
onClick={() => { setShowCanvas(true); setViewMode(isPreviewRenderable(previewData as PreviewData) ? "preview" : "code"); }}
|
||||
className="bg-blue-600 hover:bg-blue-500 text-white font-black uppercase text-[10px] tracking-widest py-4 rounded-xl shadow-lg shadow-blue-500/20"
|
||||
>
|
||||
<Zap className="h-3.5 w-3.5 mr-1.5" /> {t.activateArtifact}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={reviewCode}
|
||||
disabled={!previewData?.data}
|
||||
variant="outline"
|
||||
className="bg-emerald-500/10 hover:bg-emerald-500/20 border-emerald-500/20 text-emerald-300 font-black uppercase text-[10px] tracking-widest py-4 rounded-xl"
|
||||
>
|
||||
<ShieldCheck className="h-3.5 w-3.5 mr-1.5" /> Review Code
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => { setAssistStep("idle"); setInput("Modify this: "); setTimeout(() => { const el = document.querySelector<HTMLInputElement>(`[data-ai-input]`); if (el) el.focus(); }, 100); }}
|
||||
variant="outline"
|
||||
className="bg-slate-500/10 hover:bg-slate-500/20 border-slate-500/20 text-slate-300 font-black uppercase text-[10px] tracking-widest py-4 rounded-xl"
|
||||
>
|
||||
<LayoutPanelLeft className="h-3.5 w-3.5 mr-1.5" /> Request Modifications
|
||||
</Button>
|
||||
</div>'''
|
||||
|
||||
if old_grid in content:
|
||||
content = content.replace(old_grid, new_grid, 1)
|
||||
changes += 1
|
||||
print("Change 4: Added Review Code button (grid-cols-3)")
|
||||
else:
|
||||
print("WARNING: Could not find post-coding buttons block")
|
||||
|
||||
# ============================================================
|
||||
# CHANGE 5: Add webSearchEnabled state after isProcessing
|
||||
# ============================================================
|
||||
old_state = ' const [isProcessing, setIsProcessing] = useState(false);'
|
||||
new_state = ' const [isProcessing, setIsProcessing] = useState(false);\n const [webSearchEnabled, setWebSearchEnabled] = useState(false);'
|
||||
|
||||
if old_state in content:
|
||||
content = content.replace(old_state, new_state, 1)
|
||||
changes += 1
|
||||
print("Change 5: Added webSearchEnabled state")
|
||||
else:
|
||||
print("WARNING: Could not find isProcessing state")
|
||||
|
||||
# ============================================================
|
||||
# CHANGE 6: Add web search toggle button in toolbar
|
||||
# (After the model select closing </select> and before the
|
||||
# canvas toggle div)
|
||||
# ============================================================
|
||||
old_toolbar = ''' </select>
|
||||
<div className="flex items-center gap-1 ml-1 border-l border-blue-100 dark:border-blue-900 pl-2">'''
|
||||
|
||||
new_toolbar = ''' </select>
|
||||
<button
|
||||
onClick={() => setWebSearchEnabled(prev => !prev)}
|
||||
className={`flex items-center gap-1 h-8 px-2 rounded-lg text-[10px] font-bold transition-all border ${
|
||||
webSearchEnabled
|
||||
? "bg-amber-500/20 border-amber-500/40 text-amber-300"
|
||||
: "bg-transparent border-transparent text-slate-400/70 hover:text-slate-300 hover:bg-slate-500/10"
|
||||
}`}
|
||||
>
|
||||
<Search className="h-3.5 w-3.5" /> {webSearchEnabled ? "ON" : "Search"}
|
||||
</button>
|
||||
<div className="flex items-center gap-1 ml-1 border-l border-blue-100 dark:border-blue-900 pl-2">'''
|
||||
|
||||
if old_toolbar in content:
|
||||
content = content.replace(old_toolbar, new_toolbar, 1)
|
||||
changes += 1
|
||||
print("Change 6: Added web search toggle button")
|
||||
else:
|
||||
print("WARNING: Could not find toolbar insertion point")
|
||||
|
||||
# ============================================================
|
||||
# CHANGE 7: Add web search enrichment in handleSendMessage
|
||||
# Before generateAIAssistStream call, after formattedHistory
|
||||
# ============================================================
|
||||
old_stream = ''' const response = await modelAdapter.generateAIAssistStream(
|
||||
{
|
||||
messages: [...formattedHistory, { role: "user" as const, content: finalInput, timestamp: new Date() }],'''
|
||||
|
||||
new_stream = ''' // Web search grounding: enrich prompt with search results if enabled
|
||||
let enrichedInput = finalInput;
|
||||
if (webSearchEnabled) {
|
||||
setStatus("Searching the web...");
|
||||
try {
|
||||
const searchRes = await fetch("/api/search?q=" + encodeURIComponent(finalInput.split("\\n")[0].substring(0, 200)));
|
||||
if (searchRes.ok) {
|
||||
const searchData = await searchRes.json();
|
||||
if (searchData.results && searchData.results.length > 0) {
|
||||
const searchContext = searchData.results.slice(0, 5).map((r: { title: string; url: string; snippet: string }, i: number) =>
|
||||
`${i + 1}. **${r.title}** (${r.url}) - ${r.snippet}`
|
||||
).join("\\n");
|
||||
enrichedInput = `[WEB SEARCH CONTEXT - Top 5 relevant results]\\n${searchContext}\\n\\n---\\nUsing the above search results as reference context, answer the user query. Cite sources when relevant.\\n\\nUser query: ${finalInput}`;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("Web search failed:", e);
|
||||
}
|
||||
setStatus(null);
|
||||
}
|
||||
|
||||
const response = await modelAdapter.generateAIAssistStream(
|
||||
{
|
||||
messages: [...formattedHistory, { role: "user" as const, content: enrichedInput, timestamp: new Date() }],'''
|
||||
|
||||
if old_stream in content:
|
||||
content = content.replace(old_stream, new_stream, 1)
|
||||
changes += 1
|
||||
print("Change 7: Added web search enrichment before AI call")
|
||||
else:
|
||||
print("WARNING: Could not find generateAIAssistStream call")
|
||||
|
||||
with open(fp, 'w') as f:
|
||||
f.write(content)
|
||||
|
||||
print(f"\nApplied {changes}/7 changes to AIAssist.tsx")
|
||||
Reference in New Issue
Block a user