[dev] New feature: Collaborate with others on your generator (realtime/live shared editing)
perchance @ perchance @lemmy.world Posts 25Comments 440Joined 2 yr. ago
Thank you! Done. I really appreciate the work you did to find those quick fixes 🙏
Hi, I might be misunderstanding, but the custom code below seems to work for me (after sending each message, the button's number increases). Can you please send me a character link or some custom code which replicates this issue?
js
let count = 0; oc.thread.on("MessageAdded", function() { count++; oc.thread.shortcutButtons = [{autoSend:false, insertionType:"replace", message:"/ai test", name: "test " + count, clearAfterSend:true}]; });
The issue is before many try and error
Can you let me know any details about the issue you had? It may have been that the server's rate limits were too strict. I've just edited them to give a bit more leeway, so hopefully that's solved your issue.
If there’s multiple dev, they should keep using the link for a long period without nuke the gen?
Luckily it's not possible to 'nuke' the gen with this feature (even if there remain some early issues with the collab server), since you can always just open the 'backups' list and download any older version of your gen. That said, it's certainly possible that there are 'annoying' bugs where you e.g. temporarily get out of sync with other devs in your collab due to stuff like the aforementioned rate-limiting. And again, please do let me know (and give as much info as possible) if you come across any issues like this.
Hmm can you please share the URL? When visiting the URL did you see a 404? I suspect it was just a temporary cloudflare issue or something. It definitely wasn't deleted by the upload moderation unless something has gone catastrophically wrong, since the moderation rejects files during upload. So if it was working several hours ago, then it can't have been due to the upload moderation.
Okay I just made it so if you add background:transparent
to the containerStyle
option, then that propagates into the iframe and makes the background transparent. Let me know if that doesn't work, or if you think it should work in a different way. I've tested only in Chrome linux:
https://perchance.org/comments-plugin-transparent-background-example#edit
RE Perchance as a Lorebook - I think this could be used instead?
https://perchance.org/api/downloadGenerator?generatorName=noun&listsOnly=true
listsOnly=true
was only documented on perchance.org/advanced-tutorial but I've just added a note about it to perchance.org/download-button-plugin to help make people more aware of this.
Attaching function properties to an $output function, those functions cannot be found when imported.
Can you share an example? I just tested and it seems to work for me:
Hmm, it's hard to say whether this should be expected behavior. I think messing with the innerHTML/innerText/textContent of a 'templated' HTML node is currently undefined/unspecified behavior unless someone has strong opinions that they can defend here.
Are there use cases that you can point to, which point to a desirable behavior here? Or anything that points to clearly-wrong behavior?
In any case, I've added it to https://perchance.org/known-bugs as something to think about
Hmm, I thought this was an easy fix, but I just reverted the changes because there are some potential complications and back-compat issues. I think we may have to treat all HTML text as if it were "Perchance item text" for now - at least until an overhaul/V2.
The crux of the complication is that in Perchance, text can be affected other text around it - like {a}
, so my original solution of "just handle bracket escaping, and not \t, \n, etc." has some subtle edge cases where behavior is different than what you might expect.
So then I thought, okay, I'll just do this for text nodes that don't contain any square/curly blocks. I.e. just remove the backslashes from escaped curly/square brackets, and don't process stuff like \t
. But then we have potentially counter-intuitive discontinuity in behavior. I.e. you take away a square block from some text in the HTML, and you get a bunch of other thing changing (e.g. newlines in a pre element) as a result.
So I think this needs some more thought... I've added to perchance.org/known-bugs for now - if you have any thoughts please let me know. Thanks!
Thanks! I think this is solved now - please let me know if there are any more issues.
Thank you! I received a bunch of feedback messages/reports, but no one gave the clue that it only happens if you've got a long existing story in the editor, and then you're loading another one. With that clue I was able to reproduce it and fix it, so it should be working now. Please let me know if not, or if you have any other issues with the new editor.
Assuming we're talking about perchance.org/ai-character-chat here, it sounds like you're looking for the "message text only" export option? You can choose it from the drop down menu when you export an individual thread.
Thanks! Useful info. Please ping me here when you do submit the feedback, and let me know what you said in your message so I can find it and check the debug info. With the error line numbers from the feedback submission I think I should be able to solve this.
And if there are any errors/problems you can replicate right now, then please do - e.g. if you can try importing on of your recent files that doesn't work and then submit feedback, that would be useful.
Oh hmm. Can you let me know your browser (including version) and device/OS? You can just copy the info from here: https://perchance.org/get-browser-info
And you're using perchance.org/ai-chat right? And when you click the little 'play' button in the chat logs area and it generates the text, then you click the 'retry' button and instead of regenerating just the text that it generated, it regenerates the whole paragraph?
Also, I've just made a code change that might have fixed it, so if you could check one more time that'd be great.
Hi, sorry about this. Can you please try this:
Click the 'export data' button that pops up after several seconds. And then once the export has saved to your downloads folder (it may take several minutes), follow these steps:
- You'll notice that a 'delete all data' button appears below the export button after the export is complete, but don't click that yet.
- Instead, to test that the exported file can be imported successfully, try opening an incognito/private/guest mode browser window (shortcut is Ctrl+Shift+N in Chrome), and visit https://perchance.org/ai-character-chat and import the file from your downloads folder using the 'import' button in the left side bar.
- If it works, then ideally backup the file from your downloads folder to Google Drive or Dropbox or something, just to be 100% sure that you don't lose it, because the next step is to go back to the page where you exported it and click that 'delete all data' button that appeared underneath the export button.
- Now reload the page and you'll have a blank slate, and then you can import the file from your downloads folder using the import button, just like you did in the private browsing window.
The way the export process works is by skipping the 'corrupt' character that's causing the underlying issue - it actually just replaces it with one of your other characters, and then changes its name to 'CORRUPT'. So you'll probably lose at least one of your characters, but you'll still likely have all their chats, so you just need to re-write their name/description/etc.
Hopefully that works, but if not, then please let me know at which point it failed, and any error messages you saw.
(I'm fairly sure this is an IndexedDB issue [possibly specific to ChromeOS], by the way, so I'm not sure if it's possible for me to fix the underlying cause, except by waiting for the ChromeOS/Chromium team to fix it.)
No need to unzip it or anything. You might have imported it into a window that still has the old version of the app. I.e. hasn't been refreshed since I updated the code. Can you try refreshing and then import again?
(Also, can you let me know if you find any characters or threads that are named 'CORRUPT'?)
Thanks for the extra details, and thanks for bearing with me here while we debug this.
I've just updated the chat page so you can now export the database with the button that pops up after several seconds when the page fails to load. And then once you've done that (remember it may take 5 minutes):
- It'll save the export file to your device's download folder
- You'll notice that a 'delete all data' button appears below the export button, but don't click that yet.
- Instead, to test that the exported file can be imported successfully, try opening an incognito/private/guest mode browser window, and visit https://perchance.org/ai-character-chat and import that file from your downloads folder using the 'import' button in the left side bar.
- If it works, then ideally backup the file from your downloads folder to google drive or dropbox or something, just to ensure 100% that you don't lose it, because the next step is to go back to the page where you exported it and click that 'delete all data' button that appeared underneath the export button.
- Now reload the page, and import the file from your downloads folder using the import button, just like you did in the private browsing window.
The way the export process works is by skipping the 'corrupt' character that's causing the underlying issue - it actually just replaces it with one of your other characters, and then changes its name to 'CORRUPT'. So you'll probably lose at least one of your characters, but you'll still likely have all their chats, so you just need to re-write their name/description/etc.
Hopefully that works, but if not, then please let me know at which point it failed, and any error messages you saw.
Pinging @MojotheCat@lemmy.world since you mentioned you were experiencing the same issue after a ChromeOS crash. Also pinging @VioneT@lemmy.world and @wthit56@lemmy.world just in case you know of anyone on Discord/Reddit that had a similar issue. I'm fairly sure this is an IndexedDB issue (possibly specific to ChromeOS), by the way, so I'm not sure if it's possible to fix the underlying cause, except by waiting for the ChromeOS/Chromium team to fix it.
Okay, that's promising.
I've just updated the chat page so you can now export the database with the button that pops up after several seconds when the page fails to load. And then once you've done that (remember it may take 5 minutes):
- It'll save the export file to your device's download folder
- You'll notice that a 'delete all data' button appears below the export button, but don't click that yet.
- Instead, to test that the exported file can be imported successfully, try opening an incognito/private/guest mode browser window, and visit https://perchance.org/ai-character-chat and import that file from your downloads folder using the 'import' button in the left side bar.
- If it works, then ideally backup the file from your downloads folder to google drive or dropbox or something, just to ensure 100% that you don't lose it, because the next step is to go back to the page where you exported it and click that 'delete all data' button that appeared underneath the export button.
- Now reload the page, and import the file from your downloads folder using the import button, just like you did in the private browsing window.
The way the export process works is by skipping the 'corrupt' character that's causing the underlying issue - it actually just replaces it with one of your other characters, and then changes its name to 'CORRUPT'. So you'll probably lose at least one of your characters, but you'll still likely have all their chats, so you just need to re-write their name/description/etc.
Hopefully that works, but if not, then please let me know at which point it failed, and any error messages you saw.
Hmm, can you try this:
- If you currently have the console open, close it with the "x" in the top-right.
- Then right-clicking in the middle of the page, and selecting "Inspect" in the menu that appears.
- It'll open up the console thing, but it'll be on the "Elements" tab.
- Click the "Console" tab and scroll to the bottom, and type/paste this exact text:
await db.characters.get(999999999)
- Then press enter, and let me know if you see "undefined" immediately appear underneath it.
- If you do see
undefined
appear, then try pasting it again but change the number to 5 - i.e.await db.characters.get(5)
- If you see
undefined
again, try a few different numbers like 10, 20, 50 - we're basically trying to guess the IDs of the characters you had to see if we can get data for them individually. - If you don't see anything appear under the original
await db.characters.get(999999999)
then please let me know. This complicates matters, and we'll need to go "deeper" into Chrome to (hopefully) solve this.
Hmm this definitely shouldn't be the case. Anyone with the collab link should be able to save/apply the edits. Can you try again, and if you're able to reproduce it, can you let me know the steps to take to replicate?
If someone with the collab link saves it, it should just save it as if they were the gen owner (i.e. not make a new copy).