feat(frontend): add runtime-configurable loading tips with branded dots#817
feat(frontend): add runtime-configurable loading tips with branded dots#817jeremyeder wants to merge 2 commits intomainfrom
Conversation
Replace joke loading messages with educational tips about ACP features. Tips are now runtime-configurable via LOADING_TIPS environment variable, allowing updates without code deployment. Changes: - Add 4 branded loading dots (#0066B1, #522DAE, #F40000, white) - Double dot size for better visibility - Add markdown link support in tips [text](url) - Add /api/config/loading-tips endpoint - Add React Query hook with session-long caching - Extract defaults to shared lib/loading-tips.ts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Add URL scheme validation in parseMarkdownLinks to prevent javascript: injection - Reset messageIndex when tips.length changes to prevent undefined access - Increase white dot stroke contrast (#E0E0E0 -> #9CA3AF) for light backgrounds - Add gcTime: Infinity to prevent cache garbage collection - Namespace query key as ['config', 'loading-tips'] Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
test |
Claude Code ReviewSummaryPR 817 adds runtime-configurable loading tips to replace static joke messages in the Issues by SeverityBlocker IssuesNone. Critical Issues1. Runtime TypeError when custom tips array is shorter than defaults File: When Trace:
Suggested fix: // 1. Defensive guard in parseMarkdownLinks
function parseMarkdownLinks(text: string): React.ReactNode {
if (!text) return null;
// rest unchanged
}
// 2. Initialize from DEFAULT_LOADING_TIPS length (always safe), re-sync on change
const [messageIndex, setMessageIndex] = React.useState(
() => Math.floor(Math.random() * DEFAULT_LOADING_TIPS.length)
);
React.useEffect(() => {
if (tips.length > 0) {
setMessageIndex((prev) => prev % tips.length);
}
}, [tips.length]);Major Issues1. Hardcoded hex colors in SVG break theming File: The four dots use raw hex values ( Suggested fix: Define them as named brand colors in // tailwind.config: theme.extend.colors.brand = { blue: '#0066B1', purple: '#522DAE', red: '#F40000' }
<circle fill="var(--brand-blue)" ... />2. White dot is invisible on light backgrounds File: The fourth dot has Suggested fix: <circle
className="loading-dot loading-dot-4"
cx="50" cy="8" r="6"
fill="var(--muted-foreground)"
/>Minor Issues1. Excessive JSDoc on straightforward functions Files: Per project convention, only add comments where logic is not self-evident. The names 2. URL validation in File: The current scheme-prefix check correctly blocks const isSafeUrl = (() => {
try {
const u = new URL(href);
return u.protocol === 'https:' || u.protocol === 'http:';
} catch {
return false;
}
})();Positive Highlights
Recommendations (priority order)
Reviewed by Claude Sonnet 4.6 against ambient-code/platform standards. 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
Summary
LOADING_TIPSenvironment variable[text](url)syntaxChanges
/api/config/loading-tipsserves tips from env var with fallbackuseLoadingTips()with React Query caching (staleTime: Infinity)lib/loading-tips.tsfor default tipsConfiguration
Set
LOADING_TIPSenv var as JSON array:LOADING_TIPS='["Tip: First tip", "Tip: Second tip", "[Link text](https://example.com)"]'Or use a ConfigMap (example in artifacts folder).
Test plan
LOADING_TIPSenv var set to custom JSON🤖 Generated with Claude Code