Skip to content
This repository was archived by the owner on Apr 27, 2024. It is now read-only.

Commit beb04f3

Browse files
committed
Bugfix, documentation, and guidelines (0.2.3)
**Bugfix**: - Fixed the issue of the settings panel overlapping the gear button on mobile - Fixed the issue where the imported memory strings didn't get the appropriate "Remove" buttons
1 parent bcb1f87 commit beb04f3

File tree

14 files changed

+139
-45
lines changed

14 files changed

+139
-45
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# C.ai addons Contributing Guide
2+
3+
## Table of Contents
4+
- [Introduction](#introduction)
5+
- [Getting Started](#getting-started)
6+
- [Making Changes](#making-changes)
7+
- [Testing](#testing)
8+
- [Submitting Changes](#submitting-changes)
9+
10+
## Introduction
11+
12+
Thank you for your interest in contributing to the C.ai addons project! This document will guide you through the process of contributing to the project.
13+
14+
## Getting Started
15+
16+
To get started, you will need to fork the repository. You can do this by clicking on the "Fork" button in the top right corner of the repository page.
17+
18+
19+
## Making Changes
20+
21+
After forking the repository, you can make changes to the code. You can do this by editing the files in the repository. After you are done making changes, you can commit them to your forked repository. After that, you can create a pull request (compare across forks) to the main repository.
22+
23+
## Testing
24+
25+
Before submitting a pull request, you should test your changes. You can do this by loading the unpacked extension in your browser. To do this, you need to load the unpacked extension in your browser. If the extension works as expected, you can submit your changes.
26+
27+
## Submitting Changes
28+
29+
After testing your changes, you can submit them by creating a pull request. To do this, you need to go to the main repository page, and click on the "New pull request" button. After that, you need to click on the "compare across forks" link. Then, you need to select your forked repository, and create the pull request. After that, you need to wait for the pull request to be reviewed. If the pull request is accepted, your changes will be merged into the main repository.

README.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,88 @@
11
# c.ai-addons
2-
Character AI Memory Managed
2+
Additional Tools for Character.ai
3+
4+
## Installation
5+
1. Download the latest release from the [releases page](https://github.com/LyubomirT/c.ai-addons/releases).
6+
2. Extract the archive.
7+
3. Open your preferred web browser and navigate to the extension manager.
8+
4. Enable developer mode (if not already enabled or if needed).
9+
5. Click on "Load unpacked" and select the extracted folder.
10+
11+
# Usage
12+
13+
## Settings
14+
15+
In the bottom left corner of the webpage (it's a bottom toolbar on mobile), there is a button, with a gear icon. Clicking on it will open the extension settings.
16+
17+
![Settings Button](resources/markdown/settings.png)
18+
19+
## Memory Manager
20+
21+
The memory manager is a tool that allows you to manually create "Memory Strings", that prevent the chatbot from forgetting things when
22+
inserted into your message. This is useful for things like names, locations, etc. that you want to be remembered throughout the conversation.
23+
24+
The Memory Manager requires the "Enable Memory Manager" option to be enabled in the extension settings.
25+
26+
**Preview**
27+
28+
![Memory Manager Preview](resources/markdown/mmanager.png)
29+
30+
### Creating a Memory String
31+
32+
A memory string consists of "AI memories" and "User facts". To add a new AI memory, click on the "Add memory" button in the "Character Memory" section. To add a new user fact, click on the "Add fact" button in the "User Memory" section. You can preview your memory string in the box above:
33+
34+
![Memory String Preview](resources/markdown/preview.png)
35+
36+
There are also other Memory String controls, like the ones shown below:
37+
38+
![Memory String Controls](resources/markdown/mcontrols.png)
39+
40+
### Inserting a Memory String
41+
42+
Below the Memory String controls, there is a button, saying "Insert Memory String". Clicking on it will insert the memory string into the message box. NOTE that it's recommended to hit Shift+Enter while focusing on the messagebox after inserting it, because otherwise it might break the message.
43+
44+
If you don't want to use the button, simply copy-paste the memory string from the previewer into the message box.
45+
46+
### Importing an Existing Memory String
47+
48+
If you already have a memory string, you can import it by clicking on the "Import Memory String" button. This will open a prompt, where you can paste your memory string. After pasting it, click on "Confirm" and it will be imported, if it matches the standard memory string format.
49+
50+
### Automatically Generating a Memory String with AI
51+
52+
If you don't want to manually create a memory string, you can use the "Generate Automatically" button. This will automatically generate a memory string based on the current chat state. The process can sometimes be a bit slow, and it's not 100% accurate.
53+
54+
You can also switch between the "Fast" and "Normal" models. Fast can save you some time, but it's not as accurate as the normal model, while the normal model is more accurate, but slower.
55+
56+
### Opening or Closing the Memory Manager
57+
58+
In the top right corner of the webpage, there is a button, with an arrow. Clicking on it will open the memory manager, and clicking on it again will close it.
59+
60+
![Memory Manager Button](resources/markdown/oc.png)
61+
62+
## Legacy Chats
63+
64+
In a recent update, Character.AI changed the way you chat, as well as removing a few neat features. This addon brings back the old chat, as well as the features that were removed.
65+
66+
### Enabling Legacy Chats
67+
68+
First of all, you need to enable the "Enable Legacy Chats" option in the extension settings. After that, you need to refresh the page, and then you need to click the "Spin" button in the toolbar, while being on a chatting page.
69+
70+
![Spin Button](resources/markdown/spin.png)
71+
72+
## Non-Rounded Avatars
73+
74+
This addon removes the rounded corners from the avatars. It can be enabled by enabling the "Disable Rounded Avatars" option in the extension settings.
75+
76+
## Hiding / Showing the Toolbar (Mobile)
77+
78+
The toolbar covers a lot of space in the bottom part of the screen on mobile devices. You can easily hide it by clicking the three-dot button in the top right corner of the page. This will hide the toolbar, and you can show it again by clicking the same button.
79+
80+
![Toolbar Button](resources/markdown/ocstuff.png)
81+
82+
# Contributing
83+
84+
Contributions are welcome! If you want to contribute, you can either open an issue, or create a pull request. If you want to create a pull request, please make sure to follow the [contribution guidelines](CONTRIBUTING.md).
85+
86+
# License
87+
88+
This project is licensed under the [GNU General Public License v3.0](LICENSE).

background.js

Whitespace-only changes.

content.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,20 +256,20 @@ function initMemoryManager() {
256256
"character-memory-select"
257257
);
258258
var userMemorySelect = document.getElementById("user-memory-select");
259-
259+
260260
// Clear existing memory options
261261
characterMemorySelect.innerHTML =
262262
'<option value="" disabled selected>--Select a memory--</option>';
263263
userMemorySelect.innerHTML =
264264
'<option value="" disabled selected>--Select a memory--</option>';
265-
265+
266266
// Split memoryString by newlines
267267
var memoryLines = memoryString.split("\n");
268-
268+
269269
memoryLines.forEach(function (memoryLine) {
270270
// Trim whitespace and check for AI memories or User Facts keywords
271271
var cleanedLine = memoryLine.trim();
272-
272+
273273
if (cleanedLine.startsWith("[ AI memories:")) {
274274
var memories = cleanedLine.match(/"([^"]*)"/g);
275275
if (memories) {
@@ -279,6 +279,7 @@ function initMemoryManager() {
279279
newOption.value = cleanedMemory;
280280
newOption.textContent = cleanedMemory;
281281
characterMemorySelect.appendChild(newOption);
282+
characterMemorySelect.selectedIndex = 1;
282283
});
283284
}
284285
} else if (cleanedLine.startsWith("[ User Facts:")) {
@@ -290,13 +291,28 @@ function initMemoryManager() {
290291
newOption.value = cleanedMemory;
291292
newOption.textContent = cleanedMemory;
292293
userMemorySelect.appendChild(newOption);
294+
userMemorySelect.selectedIndex = 1;
293295
});
294296
}
295297
}
296298
});
297-
299+
300+
// Show remove button if there are more than one options
301+
if(characterMemorySelect.options.length > 1){
302+
document.getElementById(
303+
"remove-character-memory-button"
304+
).style.display = "inline-block";
305+
}
306+
307+
if(userMemorySelect.options.length > 1){
308+
document.getElementById(
309+
"remove-user-memory-button"
310+
).style.display = "inline-block";
311+
}
312+
298313
updateMemoryString(); // Update the displayed memory string
299314
}
315+
300316

301317
// create a function to insert the memory string to the user input textarea
302318
function insertMemoryString() {
@@ -1206,7 +1222,7 @@ var settingsPanel = document.createElement("div");
12061222
settingsPanel.id = "addon-settings-panel";
12071223
settingsPanel.style.display = "none";
12081224
settingsPanel.style.position = "absolute";
1209-
settingsPanel.style.bottom = "50px";
1225+
settingsPanel.style.bottom = screenWidth <= 960 ? "75px" : "50px";
12101226
settingsPanel.style.left = "10px";
12111227
settingsPanel.style.width = "300px";
12121228
settingsPanel.style.backgroundColor = "#fff";

index.html

Lines changed: 0 additions & 15 deletions
This file was deleted.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "C.AI Addons",
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"description": "A browser extension that adds some features to character.ai",
66
"icons": {
77
"16": "icon16.png",

resources/markdown/mcontrols.png

21.5 KB
Loading

resources/markdown/mmanager.png

85.2 KB
Loading

resources/markdown/oc.png

99.7 KB
Loading

resources/markdown/ocstuff.png

7.48 KB
Loading

resources/markdown/preview.png

15.5 KB
Loading

resources/markdown/settings.png

13.8 KB
Loading

resources/markdown/spin.png

12.7 KB
Loading

settings.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)