cabal-club / cabal-cli

Terminal client for Cabal, the p2p chat platform.

Home Page:https://cabal.chat

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix Rendering Issues

cblgh opened this issue · comments

Cabals with many messages have issues rendering them properly. Often times the input bar is overwritten, or collides with the backlog and the nick window seemingly has duplicates.

I think these issues stem from bugs in diffy and maybe also from txt-blit (since they are used in combination).

I want to start august's coding off by either finding and defeating these bugs, or by writing a new cli-frontend that doesn't suffer from them.

Rendering issues

This would be so wonderful @cblgh ❤️ 🎉 🌟

I think I've started disentangling things.

I also see issue #10, and I suspect this warning might be causing a rendering issues for me as soon as the app starts - but only on Node 10.3.0.

When I use Node 9.11.1 I don't see this warning, and I also don't see the rendering issue when the app starts. But I do see the same rendering issue later on if I type long sentences with many words.

Fundamentally what I think triggers the rendering issue is when the input in the text entry area at the bottom of the screen grows beyond a certain size. Issue #10 just happens to trigger the rendering issue earlier.

Test environment

Operating System: Mac OS X 10.11.6 (El Capitan)
Cabal version: 2.3.1
Git hash: 49ab4b4276a4360e3dc5a98ac44e9df1f31f5ef8
Bash: GNU bash, version 4.4.19(1)-release (x86_64-apple-darwin15.6.0)
Readline: stable 7.0.3 (bottled), devel 8.0-alpha [keg-only]

Screencast

asciicast

Screenshots

Screenshot: Node 10, with warning and rendering issue

node_10_warning_and_rendering_issue

Screenshot: Node 9, no warning, but still rendering issue

node_9_no_warning_but_still_rendering_issue

@julianpistorius wow i can't believe i missed this excellent screencast, thank you so much!

i think you might be right in the problems stemming from text areas becoming outsized. it looks like this causes issues in diffy

scat has had problems with this as well, but fixed them through limiting text output stripedpajamas/scat#3

closed!!!

commits:

  1. emojis caused rendering problems
  2. fullwidth characters (CJK, chinese japanese korean) caused rendering problems
    to solve 1: use a grapheme-splitting library to correctly chunk messages into their constituents (individual characters, emojis + COMBINED emojis like purple hearts or people kissing)
    use the split string to filter out characters in the upper astral planes of unicode (i.e. only keep characters in the basic plane, or with a code point below 65536)
    to solve 2: patch txt-blit to account for fullwidth characters, see hackergrrl/txt-blit#3