feat(ui): add workspace customization and simplify navigation

This commit is contained in:
poyrazavsever
2026-07-17 12:47:54 +03:00
parent b04031a3e3
commit dafd9eb344
24 changed files with 855 additions and 224 deletions
+11 -2
View File
@@ -128,15 +128,20 @@ export class BrandingService {
throw new DomainError("FORBIDDEN", "Instance marka ayarları başka bir owner'a ait.");
}
const update = { ...parsed.data };
if (parsed.data.primaryColor && parsed.data.accentColor === undefined) {
update.accentColor = deriveAccentColor(parsed.data.primaryColor);
}
if (existing) {
this.repository.update({ ...parsed.data, updatedByUserId: scope.ownerUserId });
this.repository.update({ ...update, updatedByUserId: scope.ownerUserId });
} else {
this.repository.create({
id: "default",
ownerUserId: scope.ownerUserId,
updatedByUserId: scope.ownerUserId,
...DEFAULT_BRANDING,
...parsed.data,
...update,
});
}
return this.getPublic();
@@ -202,6 +207,10 @@ export function contrastRatio(first: string, second: string): number {
return (Math.max(firstLuminance, secondLuminance) + 0.05) / (Math.min(firstLuminance, secondLuminance) + 0.05);
}
export function deriveAccentColor(primary: string): string {
return mixHex(primary, "#FFFFFF", 0.88);
}
function readableForeground(background: string): "#000000" | "#FFFFFF" {
return contrastRatio(background, "#000000") >= contrastRatio(background, "#FFFFFF")
? "#000000"