Merge branch 'pickle-com:main' into main
This commit is contained in:
commit
ccf19d5d1e
34
.github/workflows/build.yml
vendored
Normal file
34
.github/workflows/build.yml
vendored
Normal 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
1
.gitignore
vendored
@ -102,7 +102,6 @@ pickleglass_web/venv/
|
|||||||
node_modules/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
yarn-error.log
|
yarn-error.log
|
||||||
package-lock.json
|
|
||||||
|
|
||||||
# Database
|
# Database
|
||||||
data/*.db
|
data/*.db
|
||||||
|
@ -43,7 +43,6 @@ win:
|
|||||||
arch: x64
|
arch: x64
|
||||||
- target: portable
|
- target: portable
|
||||||
arch: x64
|
arch: x64
|
||||||
publisherName: Pickle Team
|
|
||||||
requestedExecutionLevel: asInvoker
|
requestedExecutionLevel: asInvoker
|
||||||
|
|
||||||
# NSIS installer configuration for Windows
|
# NSIS installer configuration for Windows
|
||||||
|
12077
package-lock.json
generated
Normal file
12077
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "pickle-glass",
|
"name": "pickle-glass",
|
||||||
"productName": "Glass",
|
"productName": "Glass",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"description": "Cl*ely for Free",
|
"description": "Cl*ely for Free",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
6976
pickleglass_web/package-lock.json
generated
Normal file
6976
pickleglass_web/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -857,12 +857,7 @@ export class AskView extends LitElement {
|
|||||||
ipcRenderer.on('window-blur', this.handleWindowBlur);
|
ipcRenderer.on('window-blur', this.handleWindowBlur);
|
||||||
ipcRenderer.on('window-did-show', () => {
|
ipcRenderer.on('window-did-show', () => {
|
||||||
if (!this.currentResponse && !this.isLoading && !this.isStreaming) {
|
if (!this.currentResponse && !this.isLoading && !this.isStreaming) {
|
||||||
setTimeout(() => {
|
this.focusTextInput();
|
||||||
const textInput = this.shadowRoot?.getElementById('textInput');
|
|
||||||
if (textInput) {
|
|
||||||
textInput.focus();
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1291,6 +1286,19 @@ export class AskView extends LitElement {
|
|||||||
if (changedProperties.has('showTextInput') || changedProperties.has('isLoading')) {
|
if (changedProperties.has('showTextInput') || changedProperties.has('isLoading')) {
|
||||||
this.adjustWindowHeightThrottled();
|
this.adjustWindowHeightThrottled();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (changedProperties.has('showTextInput') && this.showTextInput) {
|
||||||
|
this.focusTextInput();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
focusTextInput(){
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
const textInput = this.shadowRoot?.getElementById('textInput');
|
||||||
|
if (textInput){
|
||||||
|
textInput.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
firstUpdated() {
|
firstUpdated() {
|
||||||
|
40
src/index.js
40
src/index.js
@ -165,27 +165,33 @@ app.whenReady().then(async () => {
|
|||||||
// Initialize core services
|
// Initialize core services
|
||||||
initializeFirebase();
|
initializeFirebase();
|
||||||
|
|
||||||
databaseInitializer.initialize()
|
try {
|
||||||
.then(() => {
|
await databaseInitializer.initialize();
|
||||||
console.log('>>> [index.js] Database initialized successfully');
|
console.log('>>> [index.js] Database initialized successfully');
|
||||||
|
|
||||||
// Clean up zombie sessions from previous runs first
|
// Clean up zombie sessions from previous runs first
|
||||||
sessionRepository.endAllActiveSessions();
|
sessionRepository.endAllActiveSessions();
|
||||||
|
|
||||||
authService.initialize();
|
authService.initialize();
|
||||||
listenService.setupIpcHandlers();
|
listenService.setupIpcHandlers();
|
||||||
askService.initialize();
|
askService.initialize();
|
||||||
settingsService.initialize();
|
settingsService.initialize();
|
||||||
setupGeneralIpcHandlers();
|
setupGeneralIpcHandlers();
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.error('>>> [index.js] Database initialization failed - some features may not work', err);
|
|
||||||
});
|
|
||||||
|
|
||||||
WEB_PORT = await startWebStack();
|
// Start web server and create windows ONLY after all initializations are successful
|
||||||
console.log('Web front-end listening on', WEB_PORT);
|
WEB_PORT = await startWebStack();
|
||||||
|
console.log('Web front-end listening on', WEB_PORT);
|
||||||
|
|
||||||
createWindows();
|
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();
|
initAutoUpdater();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user