Rename project from "Cheating Daddy" to "Mastermind" across all files, update version to 0.6.0, and implement migration functionality for users with existing configurations. Enhance onboarding experience with migration options and update relevant documentation.
Build and Release / build (x64, ubuntu-latest, linux) (push) Has been skipped
Build and Release / build (arm64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, windows-latest, win32) (push) Has been cancelled
Build and Release / release (push) Has been cancelled
Build and Release / build (x64, ubuntu-latest, linux) (push) Has been skipped
Build and Release / build (arm64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, macos-latest, darwin) (push) Has been cancelled
Build and Release / build (x64, windows-latest, win32) (push) Has been cancelled
Build and Release / release (push) Has been cancelled
This commit is contained in:
@@ -314,8 +314,8 @@ export class AppHeader extends LitElement {
|
||||
|
||||
async _checkForUpdates() {
|
||||
try {
|
||||
const currentVersion = await cheatingDaddy.getVersion();
|
||||
const response = await fetch('https://raw.githubusercontent.com/sohzm/cheating-daddy/refs/heads/master/package.json');
|
||||
const currentVersion = await mastermind.getVersion();
|
||||
const response = await fetch('https://raw.githubusercontent.com/ShiftyX1/Mastermind/refs/heads/master/package.json');
|
||||
if (!response.ok) return;
|
||||
|
||||
const remotePackage = await response.json();
|
||||
@@ -344,7 +344,7 @@ export class AppHeader extends LitElement {
|
||||
|
||||
async _openUpdatePage() {
|
||||
const { ipcRenderer } = require('electron');
|
||||
await ipcRenderer.invoke('open-external', 'https://cheatingdaddy.com');
|
||||
await ipcRenderer.invoke('open-external', 'https://github.com/ShiftyX1/Mastermind');
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
@@ -396,15 +396,15 @@ export class AppHeader extends LitElement {
|
||||
|
||||
getViewTitle() {
|
||||
const titles = {
|
||||
onboarding: 'Welcome to Cheating Daddy',
|
||||
main: 'Cheating Daddy',
|
||||
onboarding: 'Welcome to Mastermind',
|
||||
main: 'Mastermind',
|
||||
customize: 'Customize',
|
||||
help: 'Help & Shortcuts',
|
||||
history: 'Conversation History',
|
||||
advanced: 'Advanced Tools',
|
||||
assistant: 'Cheating Daddy',
|
||||
assistant: 'Mastermind',
|
||||
};
|
||||
return titles[this.currentView] || 'Cheating Daddy';
|
||||
return titles[this.currentView] || 'Mastermind';
|
||||
}
|
||||
|
||||
getElapsedTime() {
|
||||
@@ -539,7 +539,7 @@ export class AppHeader extends LitElement {
|
||||
${this.currentView === 'assistant'
|
||||
? html`
|
||||
<button @click=${this.onHideToggleClick} class="button">
|
||||
Hide <span class="key" style="pointer-events: none;">${cheatingDaddy.isMacOS ? 'Cmd' : 'Ctrl'}</span
|
||||
Hide <span class="key" style="pointer-events: none;">${mastermind.isMacOS ? 'Cmd' : 'Ctrl'}</span
|
||||
> <span class="key">\</span>
|
||||
</button>
|
||||
<button @click=${this.onCloseClick} class="icon-button window-close">
|
||||
|
||||
@@ -8,7 +8,7 @@ import { AssistantView } from '../views/AssistantView.js';
|
||||
import { OnboardingView } from '../views/OnboardingView.js';
|
||||
import { ScreenPickerDialog } from '../views/ScreenPickerDialog.js';
|
||||
|
||||
export class CheatingDaddyApp extends LitElement {
|
||||
export class MastermindApp extends LitElement {
|
||||
static styles = css`
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
@@ -154,9 +154,9 @@ export class CheatingDaddyApp extends LitElement {
|
||||
async _loadFromStorage() {
|
||||
try {
|
||||
const [config, prefs, openaiSdkCreds] = await Promise.all([
|
||||
cheatingDaddy.storage.getConfig(),
|
||||
cheatingDaddy.storage.getPreferences(),
|
||||
cheatingDaddy.storage.getOpenAISDKCredentials(),
|
||||
mastermind.storage.getConfig(),
|
||||
mastermind.storage.getPreferences(),
|
||||
mastermind.storage.getOpenAISDKCredentials(),
|
||||
]);
|
||||
|
||||
// Check onboarding status
|
||||
@@ -325,7 +325,7 @@ export class CheatingDaddyApp extends LitElement {
|
||||
if (this.currentView === 'customize' || this.currentView === 'help' || this.currentView === 'history') {
|
||||
this.currentView = 'main';
|
||||
} else if (this.currentView === 'assistant') {
|
||||
cheatingDaddy.stopCapture();
|
||||
mastermind.stopCapture();
|
||||
|
||||
// Close the session
|
||||
if (window.require) {
|
||||
@@ -354,7 +354,7 @@ export class CheatingDaddyApp extends LitElement {
|
||||
// Main view event handlers
|
||||
async handleStart() {
|
||||
// check if api key is empty do nothing
|
||||
const apiKey = await cheatingDaddy.storage.getApiKey();
|
||||
const apiKey = await mastermind.storage.getApiKey();
|
||||
if (!apiKey || apiKey === '') {
|
||||
// Trigger the red blink animation on the API key input
|
||||
const mainView = this.shadowRoot.querySelector('main-view');
|
||||
@@ -364,9 +364,9 @@ export class CheatingDaddyApp extends LitElement {
|
||||
return;
|
||||
}
|
||||
|
||||
await cheatingDaddy.initializeGemini(this.selectedProfile, this.selectedLanguage);
|
||||
await mastermind.initializeGemini(this.selectedProfile, this.selectedLanguage);
|
||||
// Pass the screenshot interval as string (including 'manual' option)
|
||||
cheatingDaddy.startCapture(this.selectedScreenshotInterval, this.selectedImageQuality);
|
||||
mastermind.startCapture(this.selectedScreenshotInterval, this.selectedImageQuality);
|
||||
this.responses = [];
|
||||
this.currentResponseIndex = -1;
|
||||
this.startTime = Date.now();
|
||||
@@ -383,22 +383,22 @@ export class CheatingDaddyApp extends LitElement {
|
||||
// Customize view event handlers
|
||||
async handleProfileChange(profile) {
|
||||
this.selectedProfile = profile;
|
||||
await cheatingDaddy.storage.updatePreference('selectedProfile', profile);
|
||||
await mastermind.storage.updatePreference('selectedProfile', profile);
|
||||
}
|
||||
|
||||
async handleLanguageChange(language) {
|
||||
this.selectedLanguage = language;
|
||||
await cheatingDaddy.storage.updatePreference('selectedLanguage', language);
|
||||
await mastermind.storage.updatePreference('selectedLanguage', language);
|
||||
}
|
||||
|
||||
async handleScreenshotIntervalChange(interval) {
|
||||
this.selectedScreenshotInterval = interval;
|
||||
await cheatingDaddy.storage.updatePreference('selectedScreenshotInterval', interval);
|
||||
await mastermind.storage.updatePreference('selectedScreenshotInterval', interval);
|
||||
}
|
||||
|
||||
async handleImageQualityChange(quality) {
|
||||
this.selectedImageQuality = quality;
|
||||
await cheatingDaddy.storage.updatePreference('selectedImageQuality', quality);
|
||||
await mastermind.storage.updatePreference('selectedImageQuality', quality);
|
||||
}
|
||||
|
||||
handleBackClick() {
|
||||
@@ -416,7 +416,7 @@ export class CheatingDaddyApp extends LitElement {
|
||||
|
||||
// Assistant view event handlers
|
||||
async handleSendText(message) {
|
||||
const result = await window.cheatingDaddy.sendTextMessage(message);
|
||||
const result = await window.mastermind.sendTextMessage(message);
|
||||
|
||||
if (!result.success) {
|
||||
console.error('Failed to send message:', result.error);
|
||||
@@ -582,7 +582,7 @@ export class CheatingDaddyApp extends LitElement {
|
||||
|
||||
async handleLayoutModeChange(layoutMode) {
|
||||
this.layoutMode = layoutMode;
|
||||
await cheatingDaddy.storage.updateConfig('layout', layoutMode);
|
||||
await mastermind.storage.updateConfig('layout', layoutMode);
|
||||
this.updateLayoutMode();
|
||||
|
||||
// Notify main process about layout change for window resizing
|
||||
@@ -637,4 +637,4 @@ export class CheatingDaddyApp extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define('cheating-daddy-app', CheatingDaddyApp);
|
||||
customElements.define('mastermind-app', MastermindApp);
|
||||
@@ -1,5 +1,5 @@
|
||||
// Main app components
|
||||
export { CheatingDaddyApp } from './app/CheatingDaddyApp.js';
|
||||
export { MastermindApp } from './app/MastermindApp.js';
|
||||
export { AppHeader } from './app/AppHeader.js';
|
||||
|
||||
// View components
|
||||
|
||||
@@ -645,18 +645,18 @@ export class AssistantView extends LitElement {
|
||||
}
|
||||
|
||||
async loadLimits() {
|
||||
if (window.cheatingDaddy?.storage?.getTodayLimits) {
|
||||
const limits = await window.cheatingDaddy.storage.getTodayLimits();
|
||||
if (window.mastermind?.storage?.getTodayLimits) {
|
||||
const limits = await window.mastermind.storage.getTodayLimits();
|
||||
this.flashCount = limits.flash?.count || 0;
|
||||
this.flashLiteCount = limits.flashLite?.count || 0;
|
||||
}
|
||||
}
|
||||
|
||||
async loadPushToTalkKeybind() {
|
||||
if (window.cheatingDaddy?.storage?.getKeybinds) {
|
||||
const isMac = window.cheatingDaddy?.isMacOS || navigator.platform.includes('Mac');
|
||||
if (window.mastermind?.storage?.getKeybinds) {
|
||||
const isMac = window.mastermind?.isMacOS || navigator.platform.includes('Mac');
|
||||
const defaultKeybind = isMac ? 'Ctrl+Space' : 'Ctrl+Space';
|
||||
const keybinds = await window.cheatingDaddy.storage.getKeybinds();
|
||||
const keybinds = await window.mastermind.storage.getKeybinds();
|
||||
this.pushToTalkKeybind = keybinds?.pushToTalk || defaultKeybind;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ export class CustomizeView extends LitElement {
|
||||
}
|
||||
|
||||
getThemes() {
|
||||
return cheatingDaddy.theme.getAll();
|
||||
return mastermind.theme.getAll();
|
||||
}
|
||||
|
||||
setActiveSection(section) {
|
||||
@@ -787,11 +787,11 @@ export class CustomizeView extends LitElement {
|
||||
async _loadFromStorage() {
|
||||
try {
|
||||
const [prefs, keybinds, credentials, openaiCreds, openaiSdkCreds] = await Promise.all([
|
||||
cheatingDaddy.storage.getPreferences(),
|
||||
cheatingDaddy.storage.getKeybinds(),
|
||||
cheatingDaddy.storage.getCredentials(),
|
||||
cheatingDaddy.storage.getOpenAICredentials(),
|
||||
cheatingDaddy.storage.getOpenAISDKCredentials(),
|
||||
mastermind.storage.getPreferences(),
|
||||
mastermind.storage.getKeybinds(),
|
||||
mastermind.storage.getCredentials(),
|
||||
mastermind.storage.getOpenAICredentials(),
|
||||
mastermind.storage.getOpenAISDKCredentials(),
|
||||
]);
|
||||
|
||||
this.googleSearchEnabled = prefs.googleSearchEnabled ?? true;
|
||||
@@ -944,18 +944,18 @@ export class CustomizeView extends LitElement {
|
||||
|
||||
async handleCustomPromptInput(e) {
|
||||
this.customPrompt = e.target.value;
|
||||
await cheatingDaddy.storage.updatePreference('customPrompt', e.target.value);
|
||||
await mastermind.storage.updatePreference('customPrompt', e.target.value);
|
||||
}
|
||||
|
||||
async handleAudioModeSelect(e) {
|
||||
this.audioMode = e.target.value;
|
||||
await cheatingDaddy.storage.updatePreference('audioMode', e.target.value);
|
||||
await mastermind.storage.updatePreference('audioMode', e.target.value);
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
async handleAudioInputModeChange(e) {
|
||||
this.audioInputMode = e.target.value;
|
||||
await cheatingDaddy.storage.updatePreference('audioInputMode', e.target.value);
|
||||
await mastermind.storage.updatePreference('audioInputMode', e.target.value);
|
||||
this.notifyPushToTalkSettings();
|
||||
this.requestUpdate();
|
||||
}
|
||||
@@ -977,13 +977,13 @@ export class CustomizeView extends LitElement {
|
||||
|
||||
async handleThemeChange(e) {
|
||||
this.theme = e.target.value;
|
||||
await cheatingDaddy.theme.save(this.theme);
|
||||
await mastermind.theme.save(this.theme);
|
||||
this.updateBackgroundAppearance();
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
getDefaultKeybinds() {
|
||||
const isMac = cheatingDaddy.isMacOS || navigator.platform.includes('Mac');
|
||||
const isMac = mastermind.isMacOS || navigator.platform.includes('Mac');
|
||||
return {
|
||||
moveUp: isMac ? 'Alt+Up' : 'Ctrl+Up',
|
||||
moveDown: isMac ? 'Alt+Down' : 'Ctrl+Down',
|
||||
@@ -1001,7 +1001,7 @@ export class CustomizeView extends LitElement {
|
||||
}
|
||||
|
||||
async saveKeybinds() {
|
||||
await cheatingDaddy.storage.setKeybinds(this.keybinds);
|
||||
await mastermind.storage.setKeybinds(this.keybinds);
|
||||
// Send to main process to update global shortcuts
|
||||
if (window.require) {
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
@@ -1017,7 +1017,7 @@ export class CustomizeView extends LitElement {
|
||||
|
||||
async resetKeybinds() {
|
||||
this.keybinds = this.getDefaultKeybinds();
|
||||
await cheatingDaddy.storage.setKeybinds(null);
|
||||
await mastermind.storage.setKeybinds(null);
|
||||
this.requestUpdate();
|
||||
if (window.require) {
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
@@ -1167,7 +1167,7 @@ export class CustomizeView extends LitElement {
|
||||
|
||||
async handleGoogleSearchChange(e) {
|
||||
this.googleSearchEnabled = e.target.checked;
|
||||
await cheatingDaddy.storage.updatePreference('googleSearchEnabled', this.googleSearchEnabled);
|
||||
await mastermind.storage.updatePreference('googleSearchEnabled', this.googleSearchEnabled);
|
||||
|
||||
// Notify main process if available
|
||||
if (window.require) {
|
||||
@@ -1184,32 +1184,32 @@ export class CustomizeView extends LitElement {
|
||||
|
||||
async handleAIProviderChange(e) {
|
||||
this.aiProvider = e.target.value;
|
||||
await cheatingDaddy.storage.updatePreference('aiProvider', e.target.value);
|
||||
await mastermind.storage.updatePreference('aiProvider', e.target.value);
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
async handleGeminiApiKeyInput(e) {
|
||||
this.geminiApiKey = e.target.value;
|
||||
await cheatingDaddy.storage.setApiKey(e.target.value);
|
||||
await mastermind.storage.setApiKey(e.target.value);
|
||||
}
|
||||
|
||||
async handleOpenAIApiKeyInput(e) {
|
||||
this.openaiApiKey = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAICredentials({
|
||||
await mastermind.storage.setOpenAICredentials({
|
||||
apiKey: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
async handleOpenAIBaseUrlInput(e) {
|
||||
this.openaiBaseUrl = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAICredentials({
|
||||
await mastermind.storage.setOpenAICredentials({
|
||||
baseUrl: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
async handleOpenAIModelInput(e) {
|
||||
this.openaiModel = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAICredentials({
|
||||
await mastermind.storage.setOpenAICredentials({
|
||||
model: e.target.value,
|
||||
});
|
||||
}
|
||||
@@ -1217,35 +1217,35 @@ export class CustomizeView extends LitElement {
|
||||
// OpenAI SDK handlers
|
||||
async handleOpenAISdkApiKeyInput(e) {
|
||||
this.openaiSdkApiKey = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAISDKCredentials({
|
||||
await mastermind.storage.setOpenAISDKCredentials({
|
||||
apiKey: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
async handleOpenAISdkBaseUrlInput(e) {
|
||||
this.openaiSdkBaseUrl = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAISDKCredentials({
|
||||
await mastermind.storage.setOpenAISDKCredentials({
|
||||
baseUrl: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
async handleOpenAISdkModelInput(e) {
|
||||
this.openaiSdkModel = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAISDKCredentials({
|
||||
await mastermind.storage.setOpenAISDKCredentials({
|
||||
model: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
async handleOpenAISdkVisionModelInput(e) {
|
||||
this.openaiSdkVisionModel = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAISDKCredentials({
|
||||
await mastermind.storage.setOpenAISDKCredentials({
|
||||
visionModel: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
async handleOpenAISdkWhisperModelInput(e) {
|
||||
this.openaiSdkWhisperModel = e.target.value;
|
||||
await cheatingDaddy.storage.setOpenAISDKCredentials({
|
||||
await mastermind.storage.setOpenAISDKCredentials({
|
||||
whisperModel: e.target.value,
|
||||
});
|
||||
}
|
||||
@@ -1259,7 +1259,7 @@ export class CustomizeView extends LitElement {
|
||||
this.requestUpdate();
|
||||
|
||||
try {
|
||||
await cheatingDaddy.storage.clearAll();
|
||||
await mastermind.storage.clearAll();
|
||||
|
||||
this.clearStatusMessage = 'Successfully cleared all local data';
|
||||
this.clearStatusType = 'success';
|
||||
@@ -1288,15 +1288,15 @@ export class CustomizeView extends LitElement {
|
||||
|
||||
async handleBackgroundTransparencyChange(e) {
|
||||
this.backgroundTransparency = parseFloat(e.target.value);
|
||||
await cheatingDaddy.storage.updatePreference('backgroundTransparency', this.backgroundTransparency);
|
||||
await mastermind.storage.updatePreference('backgroundTransparency', this.backgroundTransparency);
|
||||
this.updateBackgroundAppearance();
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
updateBackgroundAppearance() {
|
||||
// Use theme's background color
|
||||
const colors = cheatingDaddy.theme.get(this.theme);
|
||||
cheatingDaddy.theme.applyBackgrounds(colors.background, this.backgroundTransparency);
|
||||
const colors = mastermind.theme.get(this.theme);
|
||||
mastermind.theme.applyBackgrounds(colors.background, this.backgroundTransparency);
|
||||
}
|
||||
|
||||
// Keep old function name for backwards compatibility
|
||||
@@ -1306,7 +1306,7 @@ export class CustomizeView extends LitElement {
|
||||
|
||||
async handleFontSizeChange(e) {
|
||||
this.fontSize = parseInt(e.target.value, 10);
|
||||
await cheatingDaddy.storage.updatePreference('fontSize', this.fontSize);
|
||||
await mastermind.storage.updatePreference('fontSize', this.fontSize);
|
||||
this.updateFontSize();
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ export class HelpView extends LitElement {
|
||||
|
||||
async _loadKeybinds() {
|
||||
try {
|
||||
const keybinds = await cheatingDaddy.storage.getKeybinds();
|
||||
const keybinds = await mastermind.storage.getKeybinds();
|
||||
if (keybinds) {
|
||||
this.keybinds = { ...this.getDefaultKeybinds(), ...keybinds };
|
||||
this.requestUpdate();
|
||||
@@ -260,7 +260,7 @@ export class HelpView extends LitElement {
|
||||
}
|
||||
|
||||
getDefaultKeybinds() {
|
||||
const isMac = cheatingDaddy.isMacOS || navigator.platform.includes('Mac');
|
||||
const isMac = mastermind.isMacOS || navigator.platform.includes('Mac');
|
||||
return {
|
||||
moveUp: isMac ? 'Alt+Up' : 'Ctrl+Up',
|
||||
moveDown: isMac ? 'Alt+Down' : 'Ctrl+Down',
|
||||
@@ -285,8 +285,8 @@ export class HelpView extends LitElement {
|
||||
}
|
||||
|
||||
render() {
|
||||
const isMacOS = cheatingDaddy.isMacOS || false;
|
||||
const isLinux = cheatingDaddy.isLinux || false;
|
||||
const isMacOS = mastermind.isMacOS || false;
|
||||
const isLinux = mastermind.isLinux || false;
|
||||
|
||||
return html`
|
||||
<div class="help-container">
|
||||
@@ -295,7 +295,7 @@ export class HelpView extends LitElement {
|
||||
<span>Community & Support</span>
|
||||
</div>
|
||||
<div class="community-links">
|
||||
<!-- <div class="community-link" @click=${() => this.handleExternalLinkClick('https://cheatingdaddy.com')}>
|
||||
<!-- <div class="community-link" @click=${() => this.handleExternalLinkClick('https://github.com/ShiftyX1/Mastermind')}>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
@@ -442,7 +442,7 @@ export class HelpView extends LitElement {
|
||||
<span>How to Use</span>
|
||||
</div>
|
||||
<div class="usage-steps">
|
||||
<div class="usage-step"><strong>Start a Session:</strong> Enter your Gemini API key and click "Start Session"</div>
|
||||
<div class="usage-step"><strong>Start a Session:</strong> Enter your AI Provider API key and click "Start Session"</div>
|
||||
<div class="usage-step"><strong>Customize:</strong> Choose your profile and language in the settings</div>
|
||||
<div class="usage-step">
|
||||
<strong>Position Window:</strong> Use keyboard shortcuts to move the window to your desired location
|
||||
|
||||
@@ -380,7 +380,7 @@ export class HistoryView extends LitElement {
|
||||
async loadSessions() {
|
||||
try {
|
||||
this.loading = true;
|
||||
this.sessions = await cheatingDaddy.storage.getAllSessions();
|
||||
this.sessions = await mastermind.storage.getAllSessions();
|
||||
} catch (error) {
|
||||
console.error('Error loading conversation sessions:', error);
|
||||
this.sessions = [];
|
||||
@@ -392,7 +392,7 @@ export class HistoryView extends LitElement {
|
||||
|
||||
async loadSelectedSession(sessionId) {
|
||||
try {
|
||||
const session = await cheatingDaddy.storage.getSession(sessionId);
|
||||
const session = await mastermind.storage.getSession(sessionId);
|
||||
if (session) {
|
||||
this.selectedSession = session;
|
||||
this.requestUpdate();
|
||||
|
||||
@@ -150,7 +150,7 @@ export class MainView extends LitElement {
|
||||
}
|
||||
|
||||
async _loadApiKey() {
|
||||
this.apiKey = await cheatingDaddy.storage.getApiKey();
|
||||
this.apiKey = await mastermind.storage.getApiKey();
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ export class MainView extends LitElement {
|
||||
|
||||
async handleInput(e) {
|
||||
this.apiKey = e.target.value;
|
||||
await cheatingDaddy.storage.setApiKey(e.target.value);
|
||||
await mastermind.storage.setApiKey(e.target.value);
|
||||
// Clear error state when user starts typing
|
||||
if (this.showApiKeyError) {
|
||||
this.showApiKeyError = false;
|
||||
@@ -226,7 +226,7 @@ export class MainView extends LitElement {
|
||||
<div class="input-group">
|
||||
<input
|
||||
type="password"
|
||||
placeholder="Enter your Gemini API Key"
|
||||
placeholder="Enter your AI Provider API Key"
|
||||
.value=${this.apiKey}
|
||||
@input=${this.handleInput}
|
||||
class="${this.showApiKeyError ? 'api-key-error' : ''}"
|
||||
@@ -235,10 +235,10 @@ export class MainView extends LitElement {
|
||||
${this.getStartButtonText()}
|
||||
</button>
|
||||
</div>
|
||||
<p class="description">
|
||||
<!-- <p class="description">
|
||||
dont have an api key?
|
||||
<span @click=${this.handleAPIKeyHelpClick} class="link">get one here</span>
|
||||
</p>
|
||||
</p> -->
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,6 +157,49 @@ export class OnboardingView extends LitElement {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.migration-buttons {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.migration-button {
|
||||
flex: 1;
|
||||
padding: 12px 24px;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.migration-button.primary {
|
||||
background: rgba(59, 130, 246, 0.8);
|
||||
color: #ffffff;
|
||||
border-color: rgba(59, 130, 246, 0.9);
|
||||
}
|
||||
|
||||
.migration-button.primary:hover {
|
||||
background: rgba(59, 130, 246, 0.9);
|
||||
border-color: rgba(59, 130, 246, 1);
|
||||
}
|
||||
|
||||
.migration-button.secondary {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: #e5e5e5;
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.migration-button.secondary:hover {
|
||||
background: rgba(255, 255, 255, 0.12);
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.migration-button:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
.navigation {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
@@ -239,6 +282,7 @@ export class OnboardingView extends LitElement {
|
||||
static properties = {
|
||||
currentSlide: { type: Number },
|
||||
contextText: { type: String },
|
||||
hasOldConfig: { type: Boolean },
|
||||
onComplete: { type: Function },
|
||||
onClose: { type: Function },
|
||||
};
|
||||
@@ -247,6 +291,7 @@ export class OnboardingView extends LitElement {
|
||||
super();
|
||||
this.currentSlide = 0;
|
||||
this.contextText = '';
|
||||
this.hasOldConfig = false;
|
||||
this.onComplete = () => {};
|
||||
this.onClose = () => {};
|
||||
this.canvas = null;
|
||||
@@ -297,7 +342,16 @@ export class OnboardingView extends LitElement {
|
||||
[30, 40, 35], // Muted green
|
||||
[5, 15, 10], // Almost black
|
||||
],
|
||||
// Slide 5 - Complete (Dark warm gray)
|
||||
// Slide 5 - Migration (Dark teal-gray)
|
||||
[
|
||||
[20, 30, 30], // Dark teal-gray
|
||||
[15, 25, 25], // Darker teal-gray
|
||||
[25, 35, 35], // Slightly teal
|
||||
[10, 20, 20], // Very dark teal
|
||||
[30, 40, 40], // Muted teal
|
||||
[5, 15, 15], // Almost black
|
||||
],
|
||||
// Slide 6 - Complete (Dark warm gray)
|
||||
[
|
||||
[30, 25, 20], // Dark warm gray
|
||||
[25, 20, 15], // Darker warm
|
||||
@@ -309,13 +363,25 @@ export class OnboardingView extends LitElement {
|
||||
];
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
async firstUpdated() {
|
||||
this.canvas = this.shadowRoot.querySelector('.gradient-canvas');
|
||||
this.ctx = this.canvas.getContext('2d');
|
||||
this.resizeCanvas();
|
||||
this.startGradientAnimation();
|
||||
|
||||
window.addEventListener('resize', () => this.resizeCanvas());
|
||||
|
||||
// Check if old config exists
|
||||
if (window.mastermind && window.mastermind.storage) {
|
||||
try {
|
||||
this.hasOldConfig = await window.mastermind.storage.hasOldConfig();
|
||||
console.log('Has old config:', this.hasOldConfig);
|
||||
this.requestUpdate(); // Force re-render with new hasOldConfig value
|
||||
} catch (error) {
|
||||
console.error('Error checking old config:', error);
|
||||
this.hasOldConfig = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
@@ -414,7 +480,7 @@ export class OnboardingView extends LitElement {
|
||||
}
|
||||
|
||||
nextSlide() {
|
||||
if (this.currentSlide < 4) {
|
||||
if (this.currentSlide < 5) {
|
||||
this.startColorTransition(this.currentSlide + 1);
|
||||
} else {
|
||||
this.completeOnboarding();
|
||||
@@ -462,11 +528,23 @@ export class OnboardingView extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
async handleMigrate() {
|
||||
const success = await window.mastermind.storage.migrateFromOldConfig();
|
||||
if (success) {
|
||||
console.log('Migration completed successfully');
|
||||
}
|
||||
this.nextSlide();
|
||||
}
|
||||
|
||||
async handleSkipMigration() {
|
||||
this.nextSlide();
|
||||
}
|
||||
|
||||
async completeOnboarding() {
|
||||
if (this.contextText.trim()) {
|
||||
await cheatingDaddy.storage.updatePreference('customPrompt', this.contextText.trim());
|
||||
await mastermind.storage.updatePreference('customPrompt', this.contextText.trim());
|
||||
}
|
||||
await cheatingDaddy.storage.updateConfig('onboarded', true);
|
||||
await mastermind.storage.updateConfig('onboarded', true);
|
||||
this.onComplete();
|
||||
}
|
||||
|
||||
@@ -474,9 +552,9 @@ export class OnboardingView extends LitElement {
|
||||
const slides = [
|
||||
{
|
||||
icon: 'assets/onboarding/welcome.svg',
|
||||
title: 'Welcome to Cheating Daddy',
|
||||
title: 'Welcome to Mastermind',
|
||||
content:
|
||||
'Your AI assistant that listens and watches, then provides intelligent suggestions automatically during interviews and meetings.',
|
||||
'Your AI assistant that listens and watches, then provides intelligent suggestions automatically during interviews, meetings, and presentations.',
|
||||
},
|
||||
{
|
||||
icon: 'assets/onboarding/security.svg',
|
||||
@@ -495,10 +573,18 @@ export class OnboardingView extends LitElement {
|
||||
content: '',
|
||||
showFeatures: true,
|
||||
},
|
||||
{
|
||||
icon: 'assets/onboarding/context.svg',
|
||||
title: 'Migrate Settings?',
|
||||
content: this.hasOldConfig
|
||||
? 'Mastermind is a fork of Cheating Daddy. We detected existing Cheating Daddy settings on your system. Would you like to automatically migrate your settings, API keys, and history?'
|
||||
: 'Mastermind is a fork of Cheating Daddy. No previous settings were detected.',
|
||||
showMigration: this.hasOldConfig,
|
||||
},
|
||||
{
|
||||
icon: 'assets/onboarding/ready.svg',
|
||||
title: 'Ready to Go',
|
||||
content: 'Add your Gemini API key in settings and start getting AI-powered assistance in real-time.',
|
||||
content: 'Choose your AI Provider and start getting AI-powered assistance in real-time.',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -552,6 +638,18 @@ export class OnboardingView extends LitElement {
|
||||
</div>
|
||||
`
|
||||
: ''}
|
||||
${slide.showMigration
|
||||
? html`
|
||||
<div class="migration-buttons">
|
||||
<button class="migration-button primary" @click=${this.handleMigrate}>
|
||||
Migrate Settings
|
||||
</button>
|
||||
<button class="migration-button secondary" @click=${this.handleSkipMigration}>
|
||||
Start Fresh
|
||||
</button>
|
||||
</div>
|
||||
`
|
||||
: ''}
|
||||
</div>
|
||||
|
||||
<div class="navigation">
|
||||
@@ -562,7 +660,7 @@ export class OnboardingView extends LitElement {
|
||||
</button>
|
||||
|
||||
<div class="progress-dots">
|
||||
${[0, 1, 2, 3, 4].map(
|
||||
${[0, 1, 2, 3, 4, 5].map(
|
||||
index => html`
|
||||
<div
|
||||
class="dot ${index === this.currentSlide ? 'active' : ''}"
|
||||
@@ -577,7 +675,7 @@ export class OnboardingView extends LitElement {
|
||||
</div>
|
||||
|
||||
<button class="nav-button" @click=${this.nextSlide}>
|
||||
${this.currentSlide === 4
|
||||
${this.currentSlide === 5
|
||||
? 'Get Started'
|
||||
: html`
|
||||
<svg width="16px" height="16px" stroke-width="2" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
Reference in New Issue
Block a user