blazored / gitter Goto Github PK
View Code? Open in Web Editor NEWA Blazor Gitter Client
License: MIT License
A Blazor Gitter Client
License: MIT License
When signing in for the first time the app requires a token. Enter the token and then click sign and remember me. App hangs sits with the loading spinner going saying attempting login...
Refresh the page and the app logs straight in without issue.
I've not tested this on server-side only client-side.
This is a utility enhancement that allows for timeout on message monitoring and eventually for marking messages as read when the user is active.
AppState has a new RecordActivity() method that resets the timeout timer and new Events for when timeout happens and when the timeout time changes.
The timeout event is used in the RoomTitle component to display a paused message and in the RoomMessages component to pause the new messages monitor.
Best as I can see, we currently use the gulp (and npm) infrastructure for two reasons:
*) it does not compile TS to JS: the MSBuild toolchain does that instead.
This works, but it's kind of an ugly and brittle fit. We might want to move to things like BuildWebCompiler
.
I'm thinking of a facility to quickly tap/click on a user (or even with a /slash command) to include/exclude them from the messages list - just a quick filter, not a permanent one.
I'm not sure of the best UI for this though.
I like the idea of having a command like "/show chris,shawty,magoo" and it would only show messages from users with chris, shawty or magoo in their name, then "/all" would reset it.
When new messages arrive they should scroll into view if the view is currently at the very bottom.
There are stubs for some of the main APis we might need, but many still need adding.
If you haven't logged in before and you go directly to a room the app just displays loading spinners.
The app should detect this and redirect to the login screen.
Do we want to keep the custom version localisation class or swap over to the Blazored.Localisation library?
Allow pasting images like in the Gitter client
I've written this in a demo app, just need to turn it into a package.
It will allow you to paste an image, which it then uploads to a CDN, and we can then put the markup in the message box, so the user can write stuff to go with it.
Since the update to the CSS, the search has been unresponsive
We should allow results to display as they come in
We should allow the user to cancel the search at any point and keep the results
We should clear the search text when the Clear button is clicked.
We are going to need settings before long, so we should decide how to handle it.
I'm going to suggest we keep it simple, with one page that has a few tick boxes and entry fields for now as I don't want to get bogged down in admin :)
What I would like to have control over:
For now we can just use local storage.
Step 2 in the future we can provide download/upload of configuration (like a backup/restore)
Step 3 Wayyyyy in the future we can provide access to cloud storage so settings roam?
It would be good to have master being build on merges and PR requests being built before allowing merges.
Also do we want to think about deploying this somewhere?
Occasionally messages get duplicated.
In testing the API, I've found that /v1/rooms/:roomId/users
has the same weird query behavior as the regular gitter client — that is, some users simply cannot be found, for whatever reason. For example, querying danro
finds Dan Roth, but querying sql
doesn't find anyone.
So I don't think we should rely on that exclusively. (Is this considered a known bug on Gitter's end?)
But — we already get some of those users anyway, as part of GetChatMessages
.
So, what if we build a repository-esque class that builds a cache that fills as GetChatMessages
and GetChatRoomUsers
queries come in, and returns a union of those? That should make querying users slightly more reliable.
For now, this just uses an API key for the user auth.
It should log them in maybe?
We need an edit button
We should be able to quote a previous post (even/especially from the search)
I think Gitter just uses a ">" prefix to indicate a quote, so this should be easy enough.
I'd love to get this to the point where I can use it on my phone, but I'm not sure how we handle screen layouts with the current structure.
I'd like - but am not fixed on - a simple swipe left and right to reach different pages on mobile.
Mobile
[ Login ] <--> [ Rooms ] <--> [ Room ] <--> [ Search ]
Desktop
[ Login ] <--> [ Rooms ] [ Room ] [ Search ]
We should have a search that works.
I would personally like to be able to
Just need a replace on "/me" with the message sender's username and a bit of css styling
I don't generally use it, but tested it for #85.
I get:
System.InvalidOperationException: JavaScript interop calls cannot be issued at this time. This is because the component is being statically rendererd. When prerendering is enabled, JavaScript interop calls can only be performed during the OnAfterRenderAsync lifecycle method.
at Microsoft.AspNetCore.Components.Server.Circuits.RemoteJSRuntime.BeginInvokeJS(Int64 asyncHandle, String identifier, String argsJson)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](String identifier, CancellationToken cancellationToken, Object[] args)
at Microsoft.JSInterop.JSRuntime.InvokeWithDefaultCancellation[T](String identifier, Object[] args)
at Blazor.Gitter.Core.LocalisationHelper.BuildLocalCulture() in …/src/Blazor.Gitter.Core/Services/LocalisationHelper.cs:line 39
It appears changing @(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
to RenderMode.Server
fixes this. But maybe there was a purpose in prerendering?
When I did the initial styling is was a bit quick and dirty as I didn't want to hold up adding features for too long .
This issue covers the following outstanding items
The CSS is a mess because of stuff...
Needs sorting out so it is themeable and consistent.
Needs accessibility sorting out
Layout needs work
The room list is static - make it update regularly so the unread counts update.
Currently, all code sits in the same file. I think it would be better to separate out the logic and move it to a base class (code behind).
We need to be able to scroll up to get older messages, like Gitter does.
I'm wondering if we can plug a gap in Gitter and introduce some sly threading...
It wouldn't be nice, because the API doesn't support it, but I'm thinking that we could maybe stick a little tag in a message when you Reply or Quote it, that we can pick up on later to thread messages.
So, each message has an Id, like this: 5cc9bdc8375bac74703963e2
Maybe we could put "In reply to: 5cc9bdc8375bac74703963e2" at the bottom of the reply/quoted message.
Or a link that when you clicked it, we take you to that message and show a range of messages before/after it (I think there is an API for that)
I don't know - this may be a terrible idea - and obviously wouldn't work for anyone not using our app...
In order to get the Server Side version working again, we should look to centralise the SCSS - probably into the Core project as that's where components live and the SCSS is related to them.
It would be great on mobile if we could either view a traditional message list or, optionally, one message full page with actions to move previous/next (swipes or buttons).
I recently disabled the existing JS call because in use it was annoying - I can't remember what I didn't like, but it just didn't work well.
Maybe the first step would be to put the code back and test it out to see if it was just me !
Gitter/src/Blazor.Gitter.Core/Components/Shared/RoomMessages.razor.cs
Lines 176 to 197 in e78754f
Something like ctrl-return or shift-return would be great
Clicking the button [R] on a message will populate the @username in the Send Message box
Add a button to only show unread messages
Add feature to mark messages as read when the user is active and the message has been visible for X seconds
User is active - suggest we have something in AppState that records the time of last interaction and define a period of activity that lasts from that time for X seconds, after which the User is Inactive.
Messages are visible when the message item is in the viewable area of the screen and not visible when they scroll out of the visable area.
To be marked as read automatically, a message must be visible for a continuous period, not cumulative.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.