-
Notifications
You must be signed in to change notification settings - Fork 0
DO NOT MERGE 2 #609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: derrick/cod-1379-if-there-is-no-remote-on-a-local
Are you sure you want to change the base?
DO NOT MERGE 2 #609
Changes from all commits
3ae3260
14ead08
d43d129
a957c1a
95b595f
92ef349
009d7b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import type { Notification } from "@usecodex/common-library"; | ||
| import { MESSAGE_TYPES } from "../../globals"; | ||
| import { handleSetStatusBarMessage, StatusBarData } from "../../helpers/notifications.helper"; | ||
| import BaseCommand from "../base/base.command"; | ||
| import { ExecutedCommandResponse } from "../base/command"; | ||
|
|
||
| export default class StatusBarUpdateCommand extends BaseCommand<Notification> { | ||
| public messageType: MESSAGE_TYPES = MESSAGE_TYPES.statusBarUpdate; | ||
| public statusData: StatusBarData; | ||
|
|
||
| constructor(statusData: StatusBarData) { | ||
| super(); | ||
| this.statusData = statusData; | ||
| } | ||
|
|
||
| async execute(): Promise<ExecutedCommandResponse<MESSAGE_TYPES, Notification>> { | ||
| try { | ||
| handleSetStatusBarMessage(this.statusData); | ||
| return this.formatSuccessResponse(); | ||
| } catch (err) { | ||
| this.logError(err); | ||
| return this.formatErrorResponse(); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import type { Notification } from "@usecodex/common-library"; | ||
| import { MESSAGE_TYPES } from "../../globals"; | ||
| import { handleStatusBarUpdate } from "../../helpers/notifications.helper"; | ||
| import { UserService } from "../../services/user.service"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
| import BaseCommand from "../base/base.command"; | ||
| import { ExecutedCommandResponse } from "../base/command"; | ||
|
|
@@ -18,7 +17,6 @@ export default class DeleteNotificationCommand extends BaseCommand<Notification> | |
| async execute(): Promise<ExecutedCommandResponse<MESSAGE_TYPES, Notification>> { | ||
| try { | ||
| await UserService.getInstance().getNotificationService().delete(this.notification.id); | ||
| await handleStatusBarUpdate(); | ||
|
|
||
| this.logAnalytics(new ContentEventAnalyticsData(this.notification)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of the |
||
| return this.formatSuccessResponse(this.notification); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import type { Notification } from "@usecodex/common-library"; | ||
| import { MESSAGE_TYPES } from "../../globals"; | ||
| import { handleStatusBarUpdate } from "../../helpers/notifications.helper"; | ||
| import { UserService } from "../../services/user.service"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
| import BaseCommand from "../base/base.command"; | ||
| import { ExecutedCommandResponse } from "../base/command"; | ||
|
|
@@ -18,7 +17,6 @@ export default class DeleteNotificationsCommand extends BaseCommand<Notification | |
| async execute(): Promise<ExecutedCommandResponse<MESSAGE_TYPES, Notification[]>> { | ||
| try { | ||
| await UserService.getInstance().getNotificationService().deleteMany(this.notifications); | ||
| await handleStatusBarUpdate(); | ||
|
|
||
| this.logAnalytics(new NonSensitiveEventAnalyticsData({})); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
| return this.formatSuccessResponse(this.notifications); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import { Notification } from "@usecodex/common-library"; | ||
| import { MESSAGE_TYPES } from "../../globals"; | ||
| import { handleSetStatusBarMessage } from "../../helpers/notifications.helper"; | ||
| import { UserService } from "../../services/user.service"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of 'handleSetStatusBarMessage' import suggests it is no longer used. Confirm its removal is intentional and that there are no unused references to it in the codebase. |
||
| import BaseCommand from "../base/base.command"; | ||
| import { ExecutedCommandResponse } from "../base/command"; | ||
|
|
@@ -24,7 +23,6 @@ export default class MarkAllNotificationsReadCommand extends BaseCommand<Notific | |
| await UserService.getInstance() | ||
| .getNotificationService() | ||
| .updateMany(readNotifications as Array<Notification>); | ||
| handleSetStatusBarMessage(readNotifications); | ||
|
|
||
| this.logAnalytics(new NonSensitiveEventAnalyticsData({})); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
| return this.formatSuccessResponse(readNotifications); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| import { Notification } from "@usecodex/common-library"; | ||
| import { MESSAGE_TYPES } from "../../globals"; | ||
| import { handleStatusBarUpdate } from "../../helpers/notifications.helper"; | ||
| import { UserService } from "../../services/user.service"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
| import BaseCommand from "../base/base.command"; | ||
| import { ExecutedCommandResponse } from "../base/command"; | ||
|
|
@@ -19,7 +18,6 @@ export default class UpdateNotificationCommand extends BaseCommand<Notification> | |
| await UserService.getInstance() | ||
| .getNotificationService() | ||
| .update(this.notification as Notification); | ||
| await handleStatusBarUpdate(); | ||
| return this.formatSuccessResponse(this.notification); | ||
| } catch (err) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
| this.logError(err); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,27 @@ | ||
| import * as vscode from "vscode"; | ||
| import { MESSAGE_TYPES } from "../../globals"; | ||
| import { VSCodeRepository } from "../../models/shared/vscodeRepository.model"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the removed |
||
| import { WorkspaceService } from "../../services/workspace.service"; | ||
| import { GitService } from "../../services/git.service"; | ||
| import BaseCommand from "../base/base.command"; | ||
|
|
||
| export default class GetRepositoriesCommand extends BaseCommand<VSCodeRepository[]> { | ||
| public messageType: MESSAGE_TYPES = MESSAGE_TYPES.getRepositories; | ||
|
|
||
| async execute() { | ||
| try { | ||
| const workspaceService = await WorkspaceService.getInstance(); | ||
| const repositories: VSCodeRepository[] = workspaceService.repositories; | ||
| const gitService = await GitService.getInstance(); | ||
|
|
||
| const remoteCheck = gitService.checkForRemotes(); | ||
|
|
||
| remoteCheck | ||
| .filter((it) => !it.hasRemote) | ||
| .forEach((repoCheck) => { | ||
| vscode.window.showErrorMessage( | ||
| `Uh-oh. No remote detected for this repo: ${repoCheck.rootUri}. Please connect a remote to continue.` | ||
| ); | ||
| }); | ||
|
Comment on lines
+16
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider handling the case where multiple repositories lack remotes more gracefully. Accumulating error messages and displaying them in a single dialog or notification could improve user experience by reducing potential spamming of error messages. |
||
|
|
||
| const repositories = await gitService.getRepositories(); | ||
| return this.formatSuccessResponse(repositories); | ||
| } catch (err) { | ||
| this.logError(err); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,6 +152,8 @@ const enum MESSAGE_TYPES { | |
| // URI | ||
| generateFileUri = "generateFileUri", | ||
| generateContextUri = "generateContextUri", | ||
|
|
||
| statusBarUpdate = "statusBarUpdate", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please ensure the new enum member 'statusBarUpdate' follows the naming convention of the existing members for consistency. |
||
| } | ||
|
|
||
| const enum NAVIGATION_ERROR_TYPES { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ import { | |
| UserNotificationType, | ||
| } from "@usecodex/common-library"; | ||
| import { MESSAGE_TYPES, PUSHER_EVENT_TYPES } from "../../globals"; | ||
| import { displayInformationMessage, handleStatusBarUpdate } from "../notifications.helper"; | ||
| import { displayInformationMessage } from "../notifications.helper"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
|
|
||
| import logger from "../logging.helper"; | ||
| import { WorkspaceService } from "../../services/workspace.service"; | ||
|
|
@@ -66,11 +66,11 @@ export async function pusherEventHandler(event: any, data: any) { | |
| } | ||
| } | ||
| } | ||
| data.notification && handleStatusBarUpdate(); | ||
|
|
||
| // Temporarly disable check for allowNotifications, in Terminal Velocity, we will re-implement this setting. | ||
| if (data.notification /* && LocalStorageManager.get(LOCAL_STORAGE_KEYS.allowNotifications) */) { | ||
| displayInformationMessage(data.notification); | ||
| SidebarService.getInstance().postMessage(MESSAGE_TYPES.statusBarUpdate); | ||
| } | ||
|
|
||
| data.notification && SidebarService.getInstance().postMessage(MESSAGE_TYPES.getNotifications, data.notification); // TODO: make this an array of 1 object | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,6 +58,7 @@ import GenerateContextUri from "../../commands/uri/contextUri.command"; | |
| import GetSearchSuggestionsCommand from "../../commands/search/getSearchSuggestions.command"; | ||
| import ExtensionVersion from "../../commands/client/extensionVersion.command"; | ||
| import ExtensionEnvironment from "../../commands/client/extensionEnvironment.command"; | ||
| import StatusBarUpdateCommand from "../../commands/extension/statusBarUpdate.command"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the newly imported |
||
|
|
||
| export async function sidebarMessageHandler( | ||
| message: WebviewOutgoingMessageTypes, | ||
|
|
@@ -252,28 +253,33 @@ export async function sidebarMessageHandler( | |
| case MESSAGE_TYPES.getNotifications: { | ||
| const getNotifications: GetNotificationsCommand = new GetNotificationsCommand(); | ||
| clientView.webview.postMessage(await getNotifications.execute()); | ||
| sendStatusBarUpdateMessage(clientView); | ||
|
Comment on lines
255
to
+256
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that |
||
| break; | ||
| } | ||
| case MESSAGE_TYPES.updateNotification: { | ||
| const markNotificationReadCommand: UpdateNotificationCommand = new UpdateNotificationCommand(message.value); | ||
| clientView.webview.postMessage(await markNotificationReadCommand.execute()); | ||
| sendStatusBarUpdateMessage(clientView); | ||
|
Comment on lines
261
to
+262
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verify that |
||
| break; | ||
| } | ||
| case MESSAGE_TYPES.markAllNotificationRead: { | ||
| const markAllNotificationReadCommand: MarkAllNotificationsReadCommand = new MarkAllNotificationsReadCommand( | ||
| message.value | ||
| ); | ||
| clientView.webview.postMessage(await markAllNotificationReadCommand.execute()); | ||
| sendStatusBarUpdateMessage(clientView); | ||
| break; | ||
| } | ||
| case MESSAGE_TYPES.deleteNotification: { | ||
| const deleteNotificationCommand: DeleteNotificationCommand = new DeleteNotificationCommand(message.value); | ||
| clientView.webview.postMessage(await deleteNotificationCommand.execute()); | ||
| sendStatusBarUpdateMessage(clientView); | ||
| break; | ||
| } | ||
| case MESSAGE_TYPES.deleteNotifications: { | ||
| const deleteNotificationsCommand: DeleteNotificationsCommand = new DeleteNotificationsCommand(message.value); | ||
| clientView.webview.postMessage(await deleteNotificationsCommand.execute()); | ||
| sendStatusBarUpdateMessage(clientView); | ||
|
Comment on lines
+270
to
+282
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the |
||
| break; | ||
| } | ||
| case MESSAGE_TYPES.gotoCodexNotificationObject: { | ||
|
|
@@ -415,6 +421,11 @@ export async function sidebarMessageHandler( | |
| clientView.webview.postMessage(await new ExtensionEnvironment().execute()); | ||
| break; | ||
| } | ||
| case MESSAGE_TYPES.statusBarUpdate: { | ||
| const statusBarUpdate = new StatusBarUpdateCommand(message.value); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the 'message.value' passed to the StatusBarUpdateCommand constructor is validated or sanitized to prevent potential security risks such as code injection. |
||
| await statusBarUpdate.execute(); | ||
| break; | ||
| } | ||
| case MESSAGE_TYPES.trackEvent: { | ||
| vscode.commands.executeCommand(COMMAND_TYPES.trackEvent, message.value); | ||
| break; | ||
|
|
@@ -425,3 +436,8 @@ export async function sidebarMessageHandler( | |
| } | ||
| } | ||
| } | ||
| function sendStatusBarUpdateMessage(clientView: vscode.WebviewView) { | ||
| clientView.webview.postMessage({ | ||
| type: MESSAGE_TYPES.statusBarUpdate, | ||
| }); | ||
|
Comment on lines
+441
to
+442
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a payload to the |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,14 +12,12 @@ import { MESSAGE_TYPES } from "../globals"; | |
| const OPEN = "Open"; | ||
| const OK = "Ok"; | ||
|
|
||
| async function handleStatusBarUpdate(): Promise<vscode.Disposable> { | ||
| const notifications = await UserService.getInstance().getNotifications(); | ||
| const notificationMessage = formatStatusBarMessage(notifications); | ||
| return updateStatusBar(notificationMessage, vscode.window); | ||
| export interface StatusBarData { | ||
| notifications: Notification[]; | ||
| } | ||
|
|
||
| function handleSetStatusBarMessage(notifications: Array<Notification>): vscode.Disposable { | ||
| const notificationMessage = formatStatusBarMessage(notifications); | ||
| function handleSetStatusBarMessage(statusData: StatusBarData): vscode.Disposable { | ||
| const notificationMessage = formatStatusBarMessage(statusData.notifications); | ||
| return updateStatusBar(notificationMessage, vscode.window); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The refactoring from a direct array of notifications to using a |
||
| } | ||
|
|
||
|
|
@@ -54,4 +52,4 @@ function displayInformationMessage(notification: Notification) { | |
| }); | ||
| } | ||
|
|
||
| export { handleStatusBarUpdate, handleSetStatusBarMessage, formatStatusBarMessage, displayInformationMessage }; | ||
| export { handleSetStatusBarMessage, formatStatusBarMessage, displayInformationMessage }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,7 +85,8 @@ export type WebviewOutgoingMessageTypes = | |
| | GetExtensionVersion | ||
| | GetExtensionEnvironment | ||
| | TrackPageMessage | ||
| | TrackEventMessage; | ||
| | TrackEventMessage | ||
| | StatusBarUpdate; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the new |
||
|
|
||
| export interface VSCodeMessage<T, V> { | ||
| type: T; | ||
|
|
@@ -201,6 +202,8 @@ type GetExtensionEnvironment = VSCodeMessage<MESSAGE_TYPES.getExtensionEnvironme | |
| type TrackEventMessage = VSCodeMessage<MESSAGE_TYPES.trackEvent, TrackEventMessageValue>; | ||
| type TrackPageMessage = VSCodeMessage<MESSAGE_TYPES.trackPage, TrackPageMessageValue>; | ||
|
|
||
| type StatusBarUpdate = VSCodeMessage<MESSAGE_TYPES.statusBarUpdate, StatusBarData>; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the new 'StatusBarUpdate' type includes all necessary properties for updating the status bar, and consider defining a schema or interface for 'StatusBarData' to enforce type safety and data structure consistency. |
||
|
|
||
| interface CodexBaseMessageValue { | ||
| codexId: number; | ||
| } | ||
|
|
@@ -254,3 +257,7 @@ export interface TrackPageMessageValue extends CodexBaseMessageValue { | |
| category?: string; | ||
| properties?: { [key: string]: any }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'any' type for the 'properties' value in the interface may lead to runtime errors and lacks type safety. Consider defining a more specific type or using generics to enforce type constraints. |
||
| } | ||
|
|
||
| export interface StatusBarData { | ||
| notifications: Notification[]; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,15 @@ export class GitService implements Singleton { | |
| } | ||
| } | ||
|
|
||
| public checkForRemotes(): { rootUri: string; hasRemote: boolean }[] { | ||
| return this.gitAPI.repositories.map((repository) => { | ||
| return { | ||
| rootUri: repository.rootUri.toString(), | ||
| hasRemote: repository?.state?.remotes?.length > 0, | ||
|
Comment on lines
+126
to
+129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method |
||
| }; | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Retrieves a remote repository; ideally returns the Origin, but if not, returns a fallback | ||
| * @param repository | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,6 +152,8 @@ const enum MESSAGE_TYPES { | |
| // URI | ||
| generateFileUri = "generateFileUri", | ||
| generateContextUri = "generateContextUri", | ||
|
|
||
| statusBarUpdate = "statusBarUpdate", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please ensure the new enum member 'statusBarUpdate' follows the naming convention of the existing members for consistency. |
||
| } | ||
|
|
||
| const enum COMMAND_TYPES { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,6 +121,7 @@ export type WebviewIncomingMessageTypes = | |
| | SetExtensionVersion | ||
| | GetExtensionEnvironment | ||
| | SetExtensionEnvironment | ||
| | StatusBarUpdate | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The addition of 'StatusBarUpdate' to the message types should be accompanied by corresponding handler implementation to ensure the new message type is processed correctly. |
||
| // Navigation | ||
| | NavigateVerificationPage | ||
| | NavigateOnboardingInviteTeamPage | ||
|
|
@@ -382,7 +383,7 @@ type GetExtensionVersion = { type: MESSAGE_TYPES.getExtensionVersion; value: und | |
| type SetExtensionVersion = ExecutedCommandResponse<MESSAGE_TYPES.setExtensionVersion, { version: string }>; | ||
| type GetExtensionEnvironment = { type: MESSAGE_TYPES.getExtensionEnvironment; value: undefined }; | ||
| type SetExtensionEnvironment = ExecutedCommandResponse<MESSAGE_TYPES.setExtensionEnvironment, { environment: string }>; | ||
|
|
||
| type StatusBarUpdate = ExecutedCommandResponse<MESSAGE_TYPES.statusBarUpdate, StatusBarUpdateData>; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider defining a type for the 'StatusBarUpdateData' used in the 'StatusBarUpdate' type to ensure type safety and maintainability. |
||
| // TODO: Break out navigation into own message type. | ||
| type NavigateNewContextItemPage = { | ||
| type: MESSAGE_TYPES.navigateNewContextItemPage; | ||
|
|
@@ -433,3 +434,8 @@ type GoTo = { | |
| value: Context[]; | ||
| }; | ||
| type NotFound = { type: MESSAGE_TYPES.notFound; value?: { message?: string } }; | ||
|
|
||
| type StatusBarUpdateData = { | ||
| type: MESSAGE_TYPES.statusBarUpdate; | ||
| value: undefined; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 'value' field in 'StatusBarUpdateData' should not be explicitly set to 'undefined'. If the intention is to have an optional 'value', simply omit the field or use 'value?: any'. |
||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,7 +85,8 @@ export type WebviewOutgoingMessageTypes = | |
| | GetExtensionVersion | ||
| | GetExtensionEnvironment | ||
| | TrackPageMessage | ||
| | TrackEventMessage; | ||
| | TrackEventMessage | ||
| | StatusBarUpdate; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please ensure that the new |
||
|
|
||
| export interface VSCodeMessage<T, V> { | ||
| type: T; | ||
|
|
@@ -201,6 +202,8 @@ type GetExtensionEnvironment = VSCodeMessage<MESSAGE_TYPES.getExtensionEnvironme | |
| type TrackEventMessage = VSCodeMessage<MESSAGE_TYPES.trackEvent, TrackEventMessageValue>; | ||
| type TrackPageMessage = VSCodeMessage<MESSAGE_TYPES.trackPage, TrackPageMessageValue>; | ||
|
|
||
| type StatusBarUpdate = VSCodeMessage<MESSAGE_TYPES.statusBarUpdate, StatusBarData>; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure that the new 'StatusBarUpdate' type includes all necessary properties for the status bar data and adheres to the established message format conventions. |
||
|
|
||
| interface CodexBaseMessageValue { | ||
| codexId: number; | ||
| } | ||
|
|
@@ -254,3 +257,7 @@ export interface TrackPageMessageValue extends CodexBaseMessageValue { | |
| category?: string; | ||
| properties?: { [key: string]: any }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider defining a more specific type for the 'properties' object values instead of 'any' to ensure type safety and prevent potential runtime errors. |
||
| } | ||
|
|
||
| export interface StatusBarData { | ||
| notifications: Notification[]; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Define a type for the elements of the 'notifications' array in the 'StatusBarData' interface to ensure consistency and type safety. |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider validating
statusDatabefore passing it tohandleSetStatusBarMessageto ensure it meets expected structure and content, enhancing security and robustness.