Commit graph

36 commits

Author SHA1 Message Date
Badri Sunderarajan 15bfc1599b
Lighten rendering function in conversation list
Instead of running the entire toArray of the chatboxes object, we
only render the information we need (id, title, last message text)
which will (hopefully) make for a less resource-hungry function
2024-03-23 13:04:25 +05:30
Badri Sunderarajan f76bb30987 Scroll through entire element before moving to next
This is primarily so that we can read the entire chat message that
comes in, not just the beginning part that fits on the screen. The
implementation is still a bit jumpy and needs some work, but at
least you can now use it to have a functional conversation.

Addresses #3 but maybe needs more work.
2022-09-27 21:56:22 +05:30
Badri Sunderarajan aa0f1c5641 Fix checkbox styling
The original kaios-native-ui was using a fancy mask-image property,
which was unfortunately a bit *too* fancy for KaiOS to handle.
Instead, we've fallen back to good ol' conditions and a number of
new SVGs for the selected version of the checkbox. The drawback is,
of course, that selected checkboxes will perforce be white (which
can be easily overridden to black if so desired, but not so easily
to any other colour: Inkscape is your friend though).
2022-09-27 19:17:32 +05:30
Badri Sunderarajan c8c5d3178c Fix styling for selected elements
KaiOS 2 doesn't support :focus-within, so we're replacing it with
a (resurrected) wee bit of JavaScript.

Closes #8
2022-09-27 19:15:16 +05:30
Badri Sunderarajan 356911ed52 Update Inkscape export info for white icon
Should've done this earlier but :P
2022-09-27 18:09:54 +05:30
Badri Sunderarajan 1dbe3183c0 Add splash screen
This gives us something prettier than a blank page while the app
is loading (although, of course, it could also prove a bit more
cryptic to debug if something goes wrong).

Closes #5
2022-09-27 17:54:25 +05:30
Badri Sunderarajan 301b72b488 Use left softkey to send a message
Earlier, we were using the centre softkey but this is a bit too
easy to trigger by mistake. Now, we use the centre softkey for
the more mundane but arguably equally important "Enter"...which
doesn't actually work because we're using a single-line input and
not a multi-line textarea, but we'll get to that sometime. Or,
maybe the centre key can become something more funky such as...
an emoji selector?

Fixes #4
2022-09-27 17:32:43 +05:30
Badri Sunderarajan e5a9ea5905 Smarten chatbox styling
They now can take on any width (for example when the message is
shorter), and the font is larger for emoji-only messages
2022-09-17 22:28:23 +05:30
Badri Sunderarajan cf926cd5b6 Dynamicaly update/blank-out "Send" softkey
I perhaps spent an inordinate amount of time getting this to work
to my satisfaction :P
2022-09-17 22:16:37 +05:30
Badri Sunderarajan ca92f79d7a Use event bubbling intead of hacky workaround
I'm not going to describe what the hacky workaround was, but you
can see for yourself if you're so interested.
2022-09-17 22:15:58 +05:30
Badri Sunderarajan e7bed614c9 Persist login details
We should have done this long ago! Think of all the seconds that
would have been saved logging in and re-logging in while testing!
2022-09-17 22:14:43 +05:30
Badri Sunderarajan 9e72f32ac4 Move converse and a rollup plugin to devDependencies
They were in the main dependencies, which is not really necessary.
Come to think of it, *no* dependencies should be necessary once
the thing is compiled, but the template which this project is
based on kept `sirv` as a main dependency, so I'm keeping it there.
I guess you could argue that sirv is necessary for runtime if
you're going to be running this application on a desktop for some
reason and need someway to serve the app to you.
2022-09-17 21:02:19 +05:30
Badri Sunderarajan ce3f8254b1 Add missing helpers: unescapeHTML and escapeHTML
These helpers are there in the main ConverseJS utils but not in
the headless one; unfortunately they are used in some cases
(while parsing inline emoji) so not having them causes an error.
Ideally we'd patch ConverseJS to include this in the headless
version too, but for now as a quick-fix we're just defining
everything directly in our converse.js itself.
2022-09-17 20:51:43 +05:30
Badri Sunderarajan a5593a22ca Simplify autoscroll mechanism
This is the mechanism to automatically scroll to the bottom of
the page when a new message comes in. This is now done by
listening for a change on the "mesages" element and acting upon
that. It's still a bit hacky like the earlier one, but at least
the hack is all in one place.
2022-09-17 20:50:19 +05:30
Badri Sunderarajan d671932569 Implement conversation view!
This has a few hacks and is a bit buggy, but at least it's usable
and you can begin texting people now :D
2022-09-17 14:43:23 +05:30
Badri Sunderarajan db067d14fb Shorten "Connecting..." label to prevent overflow
It now says "Connect..." which is less grammatical but at least
you can see all of it
2022-09-17 14:42:25 +05:30
Badri Sunderarajan e9145a46b8 Add Messages route
Now you can see a list of all your messages (including chats and
groupchats)!
2022-09-16 19:04:35 +05:30
Badri Sunderarajan b74dbf5212 Add advanced settings (BOSH and WebSocket URL)
These settings are now present under a checkbox-toggle on the
login screen.
2022-09-16 19:04:00 +05:30
Badri Sunderarajan 8ce50c90cc Update softkey label while connecting 2022-09-16 19:00:19 +05:30
Badri Sunderarajan 1c6cdece7f Start using the message plugin
This is instead of using the stanza directly. To get this to work,
we had to import a couple of other util libraries just so that
they assign their respective utils to Converse's `u` object. This
is probably supposed to happen by itself when the respective
plugins are loaded, but for whatever reason it wasn't happening so
here we are.
2022-09-16 18:55:16 +05:30
Badri Sunderarajan d2f6414980 Remove extra _converse global assignment
We already defined window._converse earlier in the file. (In any
case, both these are temporary globals for debugging; once done
we ideally won't have a floating public _converse like that. Come
to think of it, we won't have a floating converse without the
underscore either!)
2022-09-16 18:52:39 +05:30
Badri Sunderarajan 85310d4d0e Add :focus-within styles for selected components 2022-09-16 18:52:09 +05:30
Badri Sunderarajan cdf5a396ca Don't activate right softkey when middle is pressed
We forgot to break the switch-case after the middle softkey's
callback, which meant the middle key was calling the right
softkey's action too, causing all sorts of confusion. (Maybe a
sign not to use switch-case? 😛)
2022-09-16 18:49:57 +05:30
Badri Sunderarajan 221f7119dc Disable element navigation with left/right arrows
They're needed to navigate through the text you're editing, so
having them jump out to the next input field (or whatever it is)
instead is very annoying
2022-09-16 18:49:17 +05:30
Badri Sunderarajan d7ea8ea03a Enable all the plugins!
The two main stumbling blocks were a tiny line in rollup's config
and the need to import the emoji utils to make the isOnlyEmojis
function available to parseMessage. Both with tiny code changes,
but it took a days' worth of hunting and debugging to get here!
For want of a nail...
2022-09-15 22:13:59 +05:30
Badri Sunderarajan d3fe1a780a Move converse setup to converse.js
We don't want it all crowded into the Login view, do we?
2022-09-14 21:03:33 +05:30
Badri Sunderarajan 3eb3af64e8 Update (or rather, create) icon 2022-09-14 19:04:49 +05:30
Badri Sunderarajan 1c91812afc Add basic running ConverseJS! 2022-09-14 18:34:00 +05:30
Badri Sunderarajan ddde533a77 Add login form/page 2022-09-14 18:32:52 +05:30
Badri Sunderarajan 677a9dbfd0 Allow <Text> elements to be selectable
To make them selectable, just set the tabindex!
2022-09-14 18:32:52 +05:30
Badri Sunderarajan a5459182db Remove debug line for navigation
We've got it all debugged now (we hope)
2022-09-14 18:32:52 +05:30
Badri Sunderarajan 254df00e72 Fix backward navigation
We were being a bit overenthusiastic about closing the app! :P
2022-09-14 18:32:52 +05:30
Badri Sunderarajan 707d4f3dd3 Setup navigation and add second screen (login) 2022-09-14 18:32:50 +05:30
Badri Sunderarajan c9da432023 Remove extraneous variable
It was from the example, but I think we have enough *real*
examples to choose from now ;)
2022-09-14 18:29:36 +05:30
Badri Sunderarajan 537cdf3c45 Set up home screen with KaiOS-native-UI 2022-09-14 18:29:32 +05:30
Badri Sunderarajan 9fbf10063f Initial commit, with basically nothing 2022-09-14 18:28:36 +05:30