mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-08 22:55:50 +08:00
Remove fast project display names option
This commit is contained in:
@@ -71,14 +71,10 @@ router.get(
|
||||
const skipSynchronization =
|
||||
readQueryStringValue(req.query.skipSynchronization).trim() === '1' ||
|
||||
readQueryStringValue(req.query.skipSync).trim() === '1';
|
||||
const fastDisplayNames =
|
||||
readQueryStringValue(req.query.fastDisplayNames).trim() === '1' ||
|
||||
readQueryStringValue(req.query.fastNames).trim() === '1';
|
||||
const sessionsLimit = readOptionalNumericQueryValue(req.query.sessionsLimit) ?? undefined;
|
||||
const sessionsOffset = readOptionalNumericQueryValue(req.query.sessionsOffset) ?? undefined;
|
||||
const projects = await getProjectsWithSessions({
|
||||
skipSynchronization,
|
||||
fastDisplayNames,
|
||||
sessionsLimit,
|
||||
sessionsOffset,
|
||||
});
|
||||
|
||||
@@ -54,7 +54,6 @@ type ProgressUpdate = {
|
||||
|
||||
type GetProjectsWithSessionsOptions = {
|
||||
skipSynchronization?: boolean;
|
||||
fastDisplayNames?: boolean;
|
||||
sessionsLimit?: number;
|
||||
sessionsOffset?: number;
|
||||
};
|
||||
@@ -117,15 +116,6 @@ export async function generateDisplayName(projectName: string, actualProjectDir:
|
||||
return projectPath;
|
||||
}
|
||||
|
||||
function generateFastDisplayName(projectPath: string): string {
|
||||
if (projectPath.startsWith('/')) {
|
||||
const parts = projectPath.split('/').filter(Boolean);
|
||||
return parts[parts.length - 1] || projectPath;
|
||||
}
|
||||
|
||||
return projectPath.replace(/-/g, '/');
|
||||
}
|
||||
|
||||
function normalizeSessionPagination(options: SessionPaginationOptions = {}): { limit: number; offset: number } {
|
||||
const rawLimit = Number.isFinite(options.limit) ? Math.floor(Number(options.limit)) : DEFAULT_PROJECT_SESSIONS_PAGE_SIZE;
|
||||
const rawOffset = Number.isFinite(options.offset) ? Math.floor(Number(options.offset)) : 0;
|
||||
@@ -249,9 +239,7 @@ export async function getProjectsWithSessions(
|
||||
const displayName =
|
||||
row.custom_project_name && row.custom_project_name.trim().length > 0
|
||||
? row.custom_project_name
|
||||
: options.fastDisplayNames
|
||||
? generateFastDisplayName(projectPath)
|
||||
: await generateDisplayName(path.basename(projectPath) || projectPath, projectPath);
|
||||
: await generateDisplayName(path.basename(projectPath) || projectPath, projectPath);
|
||||
|
||||
const sessionsPage = readProjectSessionsPageByPath(projectPath, {
|
||||
limit: options.sessionsLimit,
|
||||
|
||||
Reference in New Issue
Block a user