TidGi-Desktop/src/services/windows/WindowProperties.ts
lin onetwo ed198d375b
Feat/git chart (#651)
* feat: basic git gui using @tomplum/react-git-log

* Replace menu bar toggle with mini window shortcut

Removed the menu bar toggle option and its Windows-specific logic from the View menu. Added a new menu item for toggling the Tidgi mini window, using a configurable keyboard shortcut from preferences.

* update i18n

* refactor: use table for default view for cleaner timeline

* test: commit

* Add realtime git log updates and e2e test support

Implements detection and display of uncommitted changes in the Git Log window, adds a commit button for uncommitted changes, and refreshes data in response to git state changes using an observable. Adds e2e test step definitions and log markers for commit, revert, and checkout operations to support automated testing. Removes alert popups from commit, revert, and checkout actions in the UI.

* refactor: steps with descripton

* fix: watch fs on git checkout

* fix: echo of file on start

* feat: loading state on revert

* feat: ai commit message

* feat: check free model

* fix: remove duplicated backup action

* fix: git method wrong place

* fix: model not auto filled

* refactor: preload $:/info/tidgi/workspaceID by 'module-type': 'info',

* fix: workspace context menu

* fix: show correct menu on view

* feat: let tooltip show files instead of hash

* feat: view dark theme

* feat: better diff ui, and upgrade dugite

* Update aiCommitMessage.ts

* Update gitLog.feature

* fix: menu click test

* fix: The isInitialLoad check is computed twice

* fix: import wiki form cursor position wrong

* fix: git log frequently load data

* fix: hide wiki menu

* fix: import wiki form not working

* fix: timer not cleared

* onBlur handler that resets the field to the current valid preference value

* fix: review error

* Update useGitLogData.ts

* Update newAgent.feature

* Update newAgent.feature

* fix: test randomly fail

* fix

* fix

* Update wiki.ts

* fix: wait for mark

* Git-Sync-JS logger fix

* Git-Sync-JS more logs

* Git-sync-js fix no commiter email

* Update gitOperations.ts
2025-11-08 15:04:34 +08:00

130 lines
3.3 KiB
TypeScript

import type { CreateWorkspaceTabs } from '@/windows/AddWorkspace/constants';
import type { PreferenceSections } from '@services/preferences/interface';
import { IWorkspace } from '@services/workspaces/interface';
export enum WindowNames {
about = 'about',
addWorkspace = 'addWorkspace',
/**
* Open any website URL, this is a popup window that user can open a help resource.
*/
any = 'any',
auth = 'auth',
editWorkspace = 'editWorkspace',
/**
* Git history viewer window
*/
gitHistory = 'gitHistory',
/**
* Window with workspace list and new wiki button on left side bar
* We only have a single instance of main window, that is the app window.
*/
main = 'main',
tidgiMiniWindow = 'tidgiMiniWindow',
notifications = 'notifications',
preferences = 'preferences',
/**
* Second wiki window in a popup window.
*/
secondary = 'secondary',
spellcheck = 'spellcheck',
/**
* browserView that loads the wiki webpage
* We will have multiple view window, each main workspace will have one.
*/
view = 'view',
}
/**
* Width height of windows
*/
export const windowDimension: Record<WindowNames, { height?: number; width?: number }> = {
[WindowNames.main]: {
width: 1200,
height: 768,
},
[WindowNames.secondary]: {
width: 961,
height: 768,
},
[WindowNames.any]: {
width: 1200,
height: 768,
},
[WindowNames.tidgiMiniWindow]: {
width: 500,
height: 600,
},
[WindowNames.about]: {
width: 400,
height: 420,
},
[WindowNames.auth]: {
width: 400,
height: 220,
},
[WindowNames.view]: {
width: undefined,
height: undefined,
},
[WindowNames.addWorkspace]: {
width: 690,
height: 800,
},
[WindowNames.editWorkspace]: {
width: 420,
height: 600,
},
[WindowNames.gitHistory]: {
width: 1600,
height: 800,
},
[WindowNames.preferences]: {
width: 840,
height: 700,
},
[WindowNames.notifications]: {
width: 400,
height: 585,
},
[WindowNames.spellcheck]: {
width: 400,
height: 590,
},
};
export interface IPreferenceWindowMeta {
preferenceGotoTab?: PreferenceSections;
preventClosingWindow?: boolean;
}
/**
* metadata that send to window when create them.
* Please make all property partial (?:), so wo can always assign {} as default metadata without type warning
*/
export interface WindowMeta {
[WindowNames.about]: undefined;
[WindowNames.addWorkspace]: { addWorkspaceTab?: CreateWorkspaceTabs };
[WindowNames.any]: { uri?: string };
[WindowNames.auth]: undefined;
[WindowNames.editWorkspace]: { workspaceID?: string };
[WindowNames.gitHistory]: { workspaceID?: string };
[WindowNames.main]: { forceClose?: boolean };
[WindowNames.tidgiMiniWindow]: undefined;
[WindowNames.notifications]: undefined;
[WindowNames.preferences]: IPreferenceWindowMeta;
[WindowNames.spellcheck]: undefined;
[WindowNames.secondary]: undefined;
[WindowNames.view]: IBrowserViewMetaData;
}
export type IPossibleWindowMeta<M extends WindowMeta[WindowNames] = WindowMeta[WindowNames.main]> = {
windowName: WindowNames;
} & M;
/**
* Similar to WindowMeta, but is for WebContentsView (workspace web content) and popup window from the WebContentsView
*/
export interface IBrowserViewMetaData {
isPopup?: boolean;
workspace?: IWorkspace;
}