diff --git a/README.md b/README.md index 8397aec..e2842ff 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,6 @@ We have a list of [help wanted](https://github.com/pickle-com/glass/issues?q=is% | Status | Issue | Description | |--------|--------------------------------|---------------------------------------------------| -| π§ WIP | Code Refactoring | Refactoring the entire codebase for better maintainability. | | π§ WIP | Windows Build | Make Glass buildable & runnable in Windows | | π§ WIP | Local LLM Support | Supporting Local LLM to power AI answers | | π§ WIP | AEC Improvement | Transcription is not working occasionally | @@ -128,6 +127,10 @@ We have a list of [help wanted](https://github.com/pickle-com/glass/issues?q=is% ### Changelog - Jul 5: Now support Gemini, Intel Mac supported +- Jul 6: Full code refactoring has done. +- Jul 7: Now support Claude, LLM/STT model selection +- Jul 8: Now support Windows(beta), Improved AEC by Rust(to seperate mic/system audio), shortcut editing(beta) + ## About Pickle diff --git a/src/app/MainHeader.js b/src/app/MainHeader.js index 5212fae..7c92f7c 100644 --- a/src/app/MainHeader.js +++ b/src/app/MainHeader.js @@ -3,11 +3,12 @@ import { html, css, LitElement } from '../assets/lit-core-2.7.4.min.js'; export class MainHeader extends LitElement { static properties = { isSessionActive: { type: Boolean, state: true }, + shortcuts: { type: Object, state: true }, }; static styles = css` :host { - display: block; + display: flex; transform: translate3d(0, 0, 0); backface-visibility: hidden; transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.2s ease-out; @@ -99,7 +100,7 @@ export class MainHeader extends LitElement { } .header { - width: 100%; + width: max-content; height: 47px; padding: 2px 10px 2px 13px; background: transparent; @@ -212,16 +213,6 @@ export class MainHeader extends LitElement { } .action-button, - .settings-button { - background: transparent; - color: white; - border: none; - cursor: pointer; - display: flex; - align-items: center; - gap: 6px; - } - .action-text { padding-bottom: 1px; justify-content: center; @@ -275,9 +266,16 @@ export class MainHeader extends LitElement { .settings-button { padding: 5px; border-radius: 50%; + background: transparent; transition: background 0.15s ease; + color: white; + border: none; + cursor: pointer; + display: flex; + align-items: center; + gap: 6px; } - + .settings-button:hover { background: rgba(255, 255, 255, 0.1); } @@ -286,6 +284,7 @@ export class MainHeader extends LitElement { display: flex; align-items: center; justify-content: center; + padding: 3px; } .settings-icon svg { @@ -346,6 +345,7 @@ export class MainHeader extends LitElement { constructor() { super(); + this.shortcuts = {}; this.dragState = null; this.wasJustDragged = false; this.isVisible = true; @@ -501,6 +501,11 @@ export class MainHeader extends LitElement { this.isSessionActive = isActive; }; ipcRenderer.on('session-state-changed', this._sessionStateListener); + this._shortcutListener = (event, keybinds) => { + console.log('[MainHeader] Received updated shortcuts:', keybinds); + this.shortcuts = keybinds; + }; + ipcRenderer.on('shortcuts-updated', this._shortcutListener); } } @@ -518,6 +523,9 @@ export class MainHeader extends LitElement { if (this._sessionStateListener) { ipcRenderer.removeListener('session-state-changed', this._sessionStateListener); } + if (this._shortcutListener) { + ipcRenderer.removeListener('shortcuts-updated', this._shortcutListener); + } } } @@ -567,6 +575,29 @@ export class MainHeader extends LitElement { } + renderShortcut(accelerator) { + if (!accelerator) return html``; + + const keyMap = { + 'Cmd': 'β', 'Command': 'β', + 'Ctrl': 'β', 'Control': 'β', + 'Alt': 'β₯', 'Option': 'β₯', + 'Shift': 'β§', + 'Enter': 'β΅', + 'Backspace': 'β«', + 'Delete': 'β¦', + 'Tab': 'β₯', + 'Escape': 'β', + 'Up': 'β', 'Down': 'β', 'Left': 'β', 'Right': 'β', + '\\': html``, + }; + + const keys = accelerator.split('+'); + return html`${keys.map(key => html` +