Skip to content

Commit

Permalink
fix openai not working bug
Browse files Browse the repository at this point in the history
  • Loading branch information
swyxio committed May 26, 2023
1 parent da37b1f commit c864056
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ Outputs go to `/out/make`. Run `smol-menubar.exe` to fire up the app. Note that

![image](images/minimized.jpg)

## why
## debugging

have the devtools up all the time by uncommenting this line

```js
window.webContents.openDevTools();
```

## why use/make this?

Google [dropped its waitlist for Bard recently](https://www.theverge.com/2023/5/10/23718066/google-bard-ai-features-waitlist-dark-mode-visual-search-io), so now there is some reason to try it out.

Expand All @@ -85,6 +93,8 @@ People have bad first impressions on Bard, but in May 2023 it has been receiving

these folks aren't neutral, but its clear of course that Bard will be better for some things than others, and we might as well lower the barrier for trying them out.

then anthropic dropped 100k context, and at that point i was convinced i need to be A/B testing all 3 to get the benefits/get an intuition of what they each are best at.

## help needed

- i need a new set of icons for the images
Expand Down
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<form id="form" class="">
<textarea rows="4" id="prompt" name="prompt"
placeholder="Enter a superprompt here (Cmd/Ctrl+Enter to Submit or Cmd+1/2/3/A to resize windows)"></textarea>
<button id="btn" type="submit">submit</button>
<button id="btn" type="submit">Cmd/Ctrl+Enter to Submit</button>
</form>
<script>
const Store = require('electron-store');
Expand Down Expand Up @@ -68,7 +68,7 @@
element.value = text;
element.dispatchEvent(inputEvent);
}
var inputElement = document.querySelector('textarea[placeholder="Send a message."]');
var inputElement = document.querySelector('textarea[placeholder*="Send a message"]');
simulateUserInput(inputElement, "${sanitizedInput}");
`)
webviewCLAUDE.executeJavaScript(`
Expand Down Expand Up @@ -100,11 +100,11 @@
}
inputElement.dispatchEvent(event);
inputElement.value = "${sanitizedInput}"
var btn = document.querySelector("button[aria-label='Send message']");
var btn = document.querySelector("button[aria-label*='Send message']");
btn.setAttribute("aria-disabled", "false"); // doesnt work alone
btn.click()`)
webviewOAI.executeJavaScript(`
var btn = document.querySelector("textarea[placeholder='Send a message.']+button");
var btn = document.querySelector("textarea[placeholder*='Send a message']+button");
btn.disabled = false;
btn.click()`)
webviewCLAUDE.executeJavaScript(`
Expand Down
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,12 @@ app.on("ready", () => {
}
});

Menu.setApplicationMenu(menu);
Menu.setApplicationMenu(menu, { autoHideMenuBar: false });

// open devtools
// window.webContents.openDevTools();
// open devtools if in dev mode
if (process.env.NODE_ENV === "development") {
window.webContents.openDevTools();
}

console.log("Menubar app is ready.");
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "smol menubar app for Bard, ChatGPT, Claude",
"main": "index.js",
"scripts": {
"start": "electron-forge start",
"start": "NODE_ENV=development electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"build": "npm run make",
Expand Down

0 comments on commit c864056

Please sign in to comment.