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
This commit is contained in:
lin onetwo 2025-11-08 15:04:34 +08:00 committed by GitHub
parent 7f5e1aa0cc
commit ed198d375b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
70 changed files with 4802 additions and 833 deletions

View file

@ -265,18 +265,19 @@ Given('I ensure test ai settings exists', function() {
}
});
Given('I add test ai settings', function() {
// Version without datatable for simple cases
Given('I add test ai settings', async function(this: ApplicationWorld) {
let existing = {} as ISettingFile;
if (fs.existsSync(settingsPath)) {
existing = fs.readJsonSync(settingsPath) as ISettingFile;
} else {
// ensure settings directory exists so writeJsonSync won't fail
fs.ensureDirSync(path.dirname(settingsPath));
}
const modelsArray = providerConfig.models;
const modelName = modelsArray[0]?.name;
const embeddingModelName = modelsArray[1]?.name;
const speechModelName = modelsArray[2]?.name;
const newAi: AIGlobalSettings = {
providers: [providerConfig],
defaultConfig: {
@ -289,7 +290,72 @@ Given('I add test ai settings', function() {
modelParameters: desiredModelParameters,
},
};
fs.writeJsonSync(settingsPath, { ...existing, aiSettings: newAi } as ISettingFile, { spaces: 2 });
const newPreferences = existing.preferences || {};
fs.writeJsonSync(settingsPath, { ...existing, aiSettings: newAi, preferences: newPreferences } as ISettingFile, { spaces: 2 });
});
// Version with datatable for advanced configuration
Given('I add test ai settings:', async function(this: ApplicationWorld, dataTable: DataTable) {
let existing = {} as ISettingFile;
if (fs.existsSync(settingsPath)) {
existing = fs.readJsonSync(settingsPath) as ISettingFile;
} else {
fs.ensureDirSync(path.dirname(settingsPath));
}
const modelsArray = providerConfig.models;
const modelName = modelsArray[0]?.name;
const embeddingModelName = modelsArray[1]?.name;
const speechModelName = modelsArray[2]?.name;
// Parse options from data table
let freeModel: string | undefined;
let aiGenerateBackupTitle: boolean | undefined;
let aiGenerateBackupTitleTimeout: number | undefined;
if (dataTable && typeof dataTable.raw === 'function') {
const rows = dataTable.raw();
// Process all rows as key-value pairs (no header row)
for (let index = 0; index < rows.length; index++) {
const row = rows[index];
const key = (row[0] ?? '').trim();
const value = (row[1] ?? '').trim();
if (key === 'freeModel') {
// If value is 'true', enable freeModel using the same model as main model
if (value === 'true') {
freeModel = modelName;
}
} else if (key === 'aiGenerateBackupTitle') {
aiGenerateBackupTitle = value === 'true';
} else if (key === 'aiGenerateBackupTitleTimeout') {
aiGenerateBackupTitleTimeout = Number.parseInt(value, 10);
}
}
}
const newAi: AIGlobalSettings = {
providers: [providerConfig],
defaultConfig: {
api: {
provider: providerConfig.provider,
model: modelName,
embeddingModel: embeddingModelName,
speechModel: speechModelName,
...(freeModel ? { freeModel } : {}),
},
modelParameters: desiredModelParameters,
},
};
const newPreferences = {
...(existing.preferences || {}),
...(aiGenerateBackupTitle !== undefined ? { aiGenerateBackupTitle } : {}),
...(aiGenerateBackupTitleTimeout !== undefined ? { aiGenerateBackupTitleTimeout } : {}),
};
fs.writeJsonSync(settingsPath, { ...existing, aiSettings: newAi, preferences: newPreferences } as ISettingFile, { spaces: 2 });
});
async function clearAISettings() {