Intrusive game notifications

This is an odd comment, as a non-modal dialog in a web application is at its core just a div with appropriate z-index and some event listeners, which is possible since html4 back in the 90s: the functionality you describe is not dependent on promises. Javascript in the browser is still single threaded, so promises don’t make it asynchronous where it wasn’t before, though they do certainly make thinking about and writing/reading asynchronous code more pleasant and expressive.

6 Likes

It’s also an odd comment since we are using React, which has this kind of stuff at its heart, and taken care of for the programmer generally by the component lifecycle without having to faff around explicitly with Promises. And we demonstrably have persisting “notices” that can be dragged to another place (eg PM dialog boxes).

3 Likes

I stick by what I said, although it is possible that I didn’t explain things in sufficient detail. There are two development issues: asynchronous programming and non-modal notifications. The first makes it easier to fit timed notifications into an existing website, the second makes it easier not hide visible elements in the background of notifications. Taken together, they make modular development of notifications easier and less likely to interfere with existing HTML code.

Yes, React should make such programming easier. How did you know that? As an ordinary player here at OGS I have no idea how its software is constructed. I don’t see any subforum that describes the software and how it is built.

The entire front end of OGS is open source on GitHub. Apart from anoek, GaJ has the most contributions to this project.

1 Like

Thank you. I retired in 2000, so I never had occasion to develop using GitHub. How would I find the code for the expert game notifications?

By the way, why do game notifications appear twice?

1 Like

I mean they appear twice when you’re looking at your home page.

Especially when there’s multiple notifications, I X them knowing that I can come back and find them on the home page. It’s quite convenient imo.

Funnily enough, I am designing a notification system for my job today :wink:

7 Likes

Generally, the way to find the code of some feature is to open developer tools in the browser and activate the “select element” pointer (usually the most top left icon in developer tools).

Then point at the element that is operating the feature that you are interested in, and click.

This takes you to that element in the DOM browser in the developer tools.

Then look up the tree to find a meaningful class name, like

<div class="announcement">

Then search for that in the codebase. Usually class names are things like seek-graph-container or AnnouncementPreferences, which are easy to search for.

In the case of annoucement you’d probably need to search for className="announcement" (*) , so that the search is specific enough to find that it is instantiated here:

You can try using github’s search - type what you’re interested in the search bar. This is good for the first kind of element I mentioned, but hit-and-miss for more specific ones.

Rather easier/more reliable is to clone the repo and use your local tools to search.


(*): Noting that React converts className into class in the output because class is a js reserved word

7 Likes

lol @ this thread

1 Like

Why do you react this way? I think David was only trying to help.

1 Like

Because this is not David’s first thread.
He was tolerable when we thought he was just an older gentleman who didn’t really understand how computers work.
Now he’s claiming 4 decades of industry experience and frankly I legitimately don’t know how.

2 Likes

Maybe I’m mistaken to interfere with this, I’m a naive person and my judgement could easily be wrong, especially since I don’t know everything. However does it really matter how much experience they have in programming? I would say it’s more important to ask what are their intentions. To me it seems that they’re trying to report bugs / suggest some possible improvements.

1 Like

I agree that intentions are very important.

But so is actual conduct.

We come to “know” each other in the forums - in the sense of “we have prior experience of interacting with each other” (obviously we don’t “know each other” in the personal sense - for all you know, I’m a dog, but you do know what kinds of things this dog usually types :wink: ).

As Bhydden said, previous interactions with David have been aggravating for volunteers contributing to OGS, or even just people trying to help assist with perceived issues, for the reasons Byhdden gave.

In this particular thread, while the intention of a post “giving a hint how we might do better with OGS” might have been actually to help, the nature of the “hint” and the way in which it was delivered conveys a message of “I know so much more than you, and I am not even going to touch your nasty code because it will not be as good and modular as the code I write, and I have asserted that this feature I want should be easy, and I think it should be easy because I know about this (very dated) Javascript feature that should make it easy”.

This conduct comes over as arrogant and derogatory. If it were just one instance, we’d all be tolerant of a new person, I hope. But it isn’t just one instance.

So that’s the history, and the honest explanation for my own reactions, since you asked.

That said, I hope you can see that where there is genuine interest in helping with OGS - sensible questions rather than unhelpful assertions - then there is equally genuine assistance and answers in response.

7 Likes

I don’t know if this should be called “intrusive” but that’s a lot of games at the same time.

5 Likes

Agreed - I feel like there should be some sort of announcement etiquette, like

Don’t create 8 notifications, make one notification that links to a game schedule (in forums or a group)

7 Likes

Can be by design (who create/manage it, limitation for announcement quantities or number of characters, modification of how it appears, stay and be canceled).
A rotating system is very common on a huge majority of frontpages, but this is maybe not “cheap” to implement.
The ability to access again to the canceled announcements in a easy way may help to not hesitate to put them away, as i can read them later.

2 Likes