Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,18 @@ export const scopes: ScopeDefinition[] = [
category: 'Messaging',
icon: 'send'
},
{
scope: 'presences.read',
description: "Access to read your project's presences",
category: 'Presences',
icon: 'user-group'
},
{
scope: 'presences.write',
description: "Access to create, update, and delete your project's presences",
category: 'Presences',
icon: 'user-group'
},
{
scope: 'locale.read',
description: "Access to access your project's Locale service",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@
try {
const result = await sdk.forConsole.console.listProjectScopes();
const scopesById = new Map<string, ScopeDefinition>();
const localByScope = new Map(localScopes.map((s) => [s.scope, s]));

for (const scope of result.scopes) {
const fallback = localByScope.get(scope.$id);
scopesById.set(scope.$id, {
scope: scope.$id,
description: scope.description,
category: normalizeCategory(scope.category),
category: normalizeCategory(scope.category || fallback?.category || ''),
deprecated: scope.deprecated,
icon: ''
});
Comment on lines 127 to 133
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 The fallback applies category from the local scope definition when the API omits it, but icon is still hardcoded to '' even though fallback?.icon is available. This creates an inconsistency: if the API returns a presences scope without its category, the grouping recovers correctly, but the icon stays blank rather than using the locally defined 'user-group' value.

Suggested change
scopesById.set(scope.$id, {
scope: scope.$id,
description: scope.description,
category: normalizeCategory(scope.category),
category: normalizeCategory(scope.category || fallback?.category || ''),
deprecated: scope.deprecated,
icon: ''
});
scopesById.set(scope.$id, {
scope: scope.$id,
description: scope.description,
category: normalizeCategory(scope.category || fallback?.category || ''),
deprecated: scope.deprecated,
icon: fallback?.icon ?? ''
});

Expand Down