Merge branch 'pickle-com:main' into main

This commit is contained in:
Surya 2025-07-07 23:06:45 +05:30 committed by GitHub
commit ccf19d5d1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 19127 additions and 28 deletions

34
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Build & Verify
on:
push:
branches: [ "main" ] # Runs on every push to main branch
jobs:
build:
# Currently runs on macOS only, can add windows-latest later
runs-on: macos-latest
steps:
- name: 🚚 Checkout code
uses: actions/checkout@v4
- name: ⚙️ Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20.x' # Node.js version compatible with project
cache: 'npm' # npm dependency caching for speed improvement
- name: 📦 Install root dependencies
run: npm install
- name: 🌐 Install and build web (Renderer) part
# Move to pickleglass_web directory and run commands
working-directory: ./pickleglass_web
run: |
npm install
npm run build
- name: 🖥️ Build Electron app
# Run Electron build script from root directory
run: npm run build

1
.gitignore vendored
View File

@ -102,7 +102,6 @@ pickleglass_web/venv/
node_modules/
npm-debug.log
yarn-error.log
package-lock.json
# Database
data/*.db

View File

@ -43,7 +43,6 @@ win:
arch: x64
- target: portable
arch: x64
publisherName: Pickle Team
requestedExecutionLevel: asInvoker
# NSIS installer configuration for Windows

12077
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{
"name": "pickle-glass",
"productName": "Glass",
"version": "0.2.0",
"version": "0.2.1",
"description": "Cl*ely for Free",
"main": "src/index.js",
"scripts": {

6976
pickleglass_web/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -857,12 +857,7 @@ export class AskView extends LitElement {
ipcRenderer.on('window-blur', this.handleWindowBlur);
ipcRenderer.on('window-did-show', () => {
if (!this.currentResponse && !this.isLoading && !this.isStreaming) {
setTimeout(() => {
const textInput = this.shadowRoot?.getElementById('textInput');
if (textInput) {
textInput.focus();
}
}, 100);
this.focusTextInput();
}
});
@ -1291,6 +1286,19 @@ export class AskView extends LitElement {
if (changedProperties.has('showTextInput') || changedProperties.has('isLoading')) {
this.adjustWindowHeightThrottled();
}
if (changedProperties.has('showTextInput') && this.showTextInput) {
this.focusTextInput();
}
}
focusTextInput(){
requestAnimationFrame(() => {
const textInput = this.shadowRoot?.getElementById('textInput');
if (textInput){
textInput.focus();
}
});
}
firstUpdated() {

View File

@ -165,27 +165,33 @@ app.whenReady().then(async () => {
// Initialize core services
initializeFirebase();
databaseInitializer.initialize()
.then(() => {
console.log('>>> [index.js] Database initialized successfully');
// Clean up zombie sessions from previous runs first
sessionRepository.endAllActiveSessions();
try {
await databaseInitializer.initialize();
console.log('>>> [index.js] Database initialized successfully');
// Clean up zombie sessions from previous runs first
sessionRepository.endAllActiveSessions();
authService.initialize();
listenService.setupIpcHandlers();
askService.initialize();
settingsService.initialize();
setupGeneralIpcHandlers();
})
.catch(err => {
console.error('>>> [index.js] Database initialization failed - some features may not work', err);
});
authService.initialize();
listenService.setupIpcHandlers();
askService.initialize();
settingsService.initialize();
setupGeneralIpcHandlers();
WEB_PORT = await startWebStack();
console.log('Web front-end listening on', WEB_PORT);
createWindows();
// Start web server and create windows ONLY after all initializations are successful
WEB_PORT = await startWebStack();
console.log('Web front-end listening on', WEB_PORT);
createWindows();
} catch (err) {
console.error('>>> [index.js] Database initialization failed - some features may not work', err);
// Optionally, show an error dialog to the user
dialog.showErrorBox(
'Application Error',
'A critical error occurred during startup. Some features might be disabled. Please restart the application.'
);
}
initAutoUpdater();