this post was submitted on 27 May 2024
11 points (92.3% liked)

Perchance - Create a Random Text Generator

449 readers
11 users here now

⚄︎ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 1 year ago
MODERATORS
 

For me , whenever I load datasets into the Fusion Generator I have to be mindful on how many items I load into the generator upon start.

If I load too much data , or do something crazy with the HTML , then there is a risk some users ( like those who browse perchance on older phones ) will not be able to access the generator page at all.

They will get a browser error message, and will not be able to access the generator at all to report the problem. They will be locked out forever , effectively.

So my suggestion is to have some kind of default "Oops something went wrong" page when loading generators on a perchance page.

The generator owner can customize the text written on the page. Maybe the image as well.

Importantly , they should be able to direct the user to somewhere (like a discord page) where they can report the problem.

TLDR : If the generator fails to load , show a link to a "Bug Report" page

top 4 comments
sorted by: hot top controversial new old
[–] VioneT@lemmy.world 3 points 5 months ago (1 children)

You can probably do something like this;

<script>
  let checkForCurrentErrors = setInterval(() => {
   if(__currentPerchanceErrorCount > 0) {
     clearInterval(checkForCurrentErrors)
     errorPage.style.display = 'block';
   }
  }, 10)
</script>
<div id="errorPage" style="position: absolute; z-index: 999; display: none; width: 100dvw; height: 100dvh; background: blue;">
  Testing Error Page <br>
  Please Reload the Page
</div>

It is an interval that checks if there was a perchance error happened. You could also probably have a timeout in which if the page doesn't load for more than 30 seconds, then it would show the error page.

However, these solutions only happen when the page has already been working, meaning, if they just opened up the page, it would still take the Perchance server to send the data first before it loads (where the loading issues might happen), in which case, it needs a server-side code to fire to report that the generator isn't loading.

Depending on the error you want to handle, there might be solutions that we can code and not need the server to provide it for us.

[–] perchance@lemmy.world 4 points 5 months ago

Heads up that __currentPerchanceErrorCount, and all other global variables that begin with __ are "private" (engine-internal) variables, meaning that I may change their name at any time, causing generators to break that were using them. As I mentioned to Bluepower, if you find a variable in the console, you should first check if it's officially documented (likely on perchance.org/advanced-tutorial ) before using it, and if it's not, then it should be assumed to be private.

[–] perchance@lemmy.world 2 points 5 months ago

One approach that might work here is to load your feedback button as the very first thing on the page - i.e. before any of the code that could have errors. That way there's always a feedback button hovering in the corner of the page. Or you could have a "loading screen" that sits in front of all your content, and has a feedback button in the middle, and that loading screen is deleted/hidden once you've detected that the page has successfully loaded.

[–] edwardthefma99@lemmy.world 1 points 5 months ago

Needs to say a looks like you rolled a snake eye's check your code and try again the perchance logo is a dice cube