mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
* 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
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
import { When } from '@cucumber/cucumber';
|
|
import type { ApplicationWorld } from './application';
|
|
|
|
When('I click menu {string}', async function(this: ApplicationWorld, menuPath: string) {
|
|
const electronApp = this.app;
|
|
if (!electronApp) {
|
|
throw new Error('Electron app is not available');
|
|
}
|
|
|
|
// Split menu path like "Wiki > Commit Now"
|
|
const menuItems = menuPath.split('>').map(item => item.trim());
|
|
|
|
// Navigate through menu hierarchy and click the final item
|
|
await electronApp.evaluate(({ Menu }, menuPath: string[]) => {
|
|
// Get application menu
|
|
const appMenu = Menu.getApplicationMenu();
|
|
if (!appMenu) {
|
|
throw new Error('Application menu not found');
|
|
}
|
|
|
|
// Find menu item by path
|
|
let currentMenu: Electron.Menu = appMenu;
|
|
let targetItem: Electron.MenuItem | undefined;
|
|
|
|
for (let index = 0; index < menuPath.length; index++) {
|
|
const label = menuPath[index];
|
|
const item = currentMenu.items.find(menuItem => menuItem.label === label || menuItem.label.includes(label));
|
|
|
|
if (!item) {
|
|
// Debug: log available menu items
|
|
const availableLabels = currentMenu.items.map(menuItem => menuItem.label).join(', ');
|
|
throw new Error(`Menu item "${label}" not found. Available items: ${availableLabels}`);
|
|
}
|
|
|
|
if (index === menuPath.length - 1) {
|
|
// This is the final item to click
|
|
targetItem = item;
|
|
} else {
|
|
// Navigate to submenu
|
|
if (!item.submenu) {
|
|
throw new Error(`Menu item "${label}" does not have a submenu`);
|
|
}
|
|
currentMenu = item.submenu;
|
|
}
|
|
}
|
|
|
|
// Click the final menu item
|
|
if (targetItem && targetItem.click) {
|
|
(targetItem.click as () => void)();
|
|
} else {
|
|
throw new Error(`Cannot click menu item "${menuPath[menuPath.length - 1]}"`);
|
|
}
|
|
}, menuItems);
|
|
});
|