feat: add icon and color support to project persistence (#439)

This commit is contained in:
Bohdan Triapitsyn
2026-02-17 19:14:04 +02:00
committed by GitHub
parent 4d71bb27eb
commit 4915e5f1fb
4 changed files with 21 additions and 4 deletions
+4
View File
@@ -1325,6 +1325,8 @@ const sanitizeProjects = (input) => {
const rawPath = typeof candidate.path === 'string' ? candidate.path.trim() : '';
const normalizedPath = rawPath ? path.resolve(normalizeDirectoryPath(rawPath)) : '';
const label = typeof candidate.label === 'string' ? candidate.label.trim() : '';
const icon = typeof candidate.icon === 'string' ? candidate.icon.trim() : '';
const color = typeof candidate.color === 'string' ? candidate.color.trim() : '';
const addedAt = Number.isFinite(candidate.addedAt) ? Number(candidate.addedAt) : null;
const lastOpenedAt = Number.isFinite(candidate.lastOpenedAt)
? Number(candidate.lastOpenedAt)
@@ -1341,6 +1343,8 @@ const sanitizeProjects = (input) => {
id,
path: normalizedPath,
...(label ? { label } : {}),
...(icon ? { icon } : {}),
...(color ? { color } : {}),
...(Number.isFinite(addedAt) && addedAt >= 0 ? { addedAt } : {}),
...(Number.isFinite(lastOpenedAt) && lastOpenedAt >= 0 ? { lastOpenedAt } : {}),
};