Implement Stage 3: Enhance content metadata and validation features
- Added entity metadata fields to the Tasks model, including entity_type, taxonomy, and cluster_role. - Updated CandidateEngine to prioritize content relevance based on cluster mappings. - Introduced metadata completeness scoring in ContentAnalyzer. - Enhanced validation services to check for entity type and mapping completeness. - Updated frontend components to display and validate new metadata fields. - Implemented API endpoints for content validation and metadata persistence. - Migrated existing data to populate new metadata fields for Tasks and Content.
This commit is contained in:
@@ -214,11 +214,20 @@ const LayoutContent: React.FC = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Load balance if not already loaded
|
||||
if (!balance && !useBillingStore.getState().loading) {
|
||||
const billingState = useBillingStore.getState();
|
||||
// Load balance if not already loaded and not currently loading
|
||||
if (!balance && !billingState.loading) {
|
||||
loadBalance().catch((error) => {
|
||||
console.error('AppLayout: Error loading credit balance:', error);
|
||||
// Don't show error to user - balance is not critical for app functionality
|
||||
// But retry after a delay
|
||||
setTimeout(() => {
|
||||
if (!useBillingStore.getState().balance && !useBillingStore.getState().loading) {
|
||||
loadBalance().catch(() => {
|
||||
// Silently fail on retry too
|
||||
});
|
||||
}
|
||||
}, 5000);
|
||||
});
|
||||
}
|
||||
}, [isAuthenticated, balance, loadBalance, setMetrics]);
|
||||
@@ -226,12 +235,18 @@ const LayoutContent: React.FC = () => {
|
||||
// Update header metrics when balance changes
|
||||
// This sets credit balance which will be merged with page metrics by HeaderMetricsContext
|
||||
useEffect(() => {
|
||||
if (!isAuthenticated || !balance) {
|
||||
// Clear credit balance but keep page metrics
|
||||
if (!isAuthenticated) {
|
||||
// Only clear metrics when not authenticated (user logged out)
|
||||
setMetrics([]);
|
||||
return;
|
||||
}
|
||||
|
||||
// If balance is null, don't clear metrics - let page metrics stay visible
|
||||
// Only set credit metrics when balance is loaded
|
||||
if (!balance) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine accent color based on credit level
|
||||
let accentColor: 'blue' | 'green' | 'amber' | 'purple' = 'blue';
|
||||
if (balance.credits > 1000) {
|
||||
|
||||
Reference in New Issue
Block a user