Files
orcs-code/src/components/LogoV2/feedConfigs.tsx
Anandan ba1b9913aa Finish eliminating remaining ANT-ONLY source labels (#360)
This extends the label-only cleanup to the remaining internal-only command,
debug, and heading strings so the source tree no longer contains ANT-ONLY
markers. The pass still avoids logic changes and only renames labels shown
in internal or gated surfaces.

Constraint: Update the existing label-cleanup PR without widening scope into behavior changes
Rejected: Leave the last ANT-ONLY strings for a later pass | low-cost cleanup while the branch is already focused on labels
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: The next phase should move off label cleanup and onto a separately scoped logic or rebrand slice
Tested: bun run build
Tested: bun run smoke
Tested: bun run verify:privacy
Tested: bun run test:provider
Tested: bun run test:provider-recommendation
Not-tested: Full repo typecheck (upstream baseline remains noisy)

Co-authored-by: anandh8x <test@example.com>
2026-04-04 23:58:34 +05:30

92 lines
3.0 KiB
TypeScript

import figures from 'figures';
import { homedir } from 'os';
import * as React from 'react';
import { Box, Text } from '../../ink.js';
import type { Step } from '../../projectOnboardingState.js';
import { formatCreditAmount, getCachedReferrerReward } from '../../services/api/referral.js';
import type { LogOption } from '../../types/logs.js';
import { getCwd } from '../../utils/cwd.js';
import { formatRelativeTimeAgo } from '../../utils/format.js';
import type { FeedConfig, FeedLine } from './Feed.js';
export function createRecentActivityFeed(activities: LogOption[]): FeedConfig {
const lines: FeedLine[] = activities.map(log => {
const time = formatRelativeTimeAgo(log.modified);
const description = log.summary && log.summary !== 'No prompt' ? log.summary : log.firstPrompt;
return {
text: description || '',
timestamp: time
};
});
return {
title: 'Recent Sessions',
lines,
footer: lines.length > 0 ? '/resume for more' : undefined,
emptyMessage: 'No recent sessions'
};
}
export function createWhatsNewFeed(releaseNotes: string[]): FeedConfig {
const lines: FeedLine[] = releaseNotes.map(note => {
if ("external" === 'ant') {
const match = note.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);
if (match) {
return {
timestamp: match[1],
text: match[2] || ''
};
}
}
return {
text: note
};
});
const emptyMessage = "external" === 'ant' ? 'Unable to fetch latest claude-cli-internal commits' : 'Check /release-notes for recent updates';
return {
title: "external" === 'ant' ? "Open Claude Updates [internal-only: Latest CC commits]" : "Open Claude Updates",
lines,
footer: lines.length > 0 ? '/release-notes for more' : undefined,
emptyMessage
};
}
export function createProjectOnboardingFeed(steps: Step[]): FeedConfig {
const enabledSteps = steps.filter(({
isEnabled
}) => isEnabled).sort((a, b) => Number(a.isComplete) - Number(b.isComplete));
const lines: FeedLine[] = enabledSteps.map(({
text,
isComplete
}) => {
const checkmark = isComplete ? `${figures.tick} ` : '';
return {
text: `${checkmark}${text}`
};
});
const warningText = getCwd() === homedir() ? 'Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.' : undefined;
if (warningText) {
lines.push({
text: warningText
});
}
return {
title: 'Tips for getting started',
lines
};
}
export function createGuestPassesFeed(): FeedConfig {
const reward = getCachedReferrerReward();
const subtitle = reward ? `Share Open Claude and earn ${formatCreditAmount(reward)} of extra usage` : 'Share Open Claude with friends';
return {
title: '3 guest passes',
lines: [],
customContent: {
content: <>
<Box marginY={1}>
<Text color="claude">[] [] []</Text>
</Box>
<Text dimColor>{subtitle}</Text>
</>,
width: 48
},
footer: '/passes'
};
}