Commit Graph

45 Commits

Author SHA1 Message Date
jolavillette
6b988dffa8 webui v143: the channel list never refreshed, and three different periods
The scope predicate of the channel list background task was entirely commented
out, so it returned undefined: setBackgroundTask stopped after the first
interval and the list was loaded once, never refreshed while the page stayed
open. It now tests the route like the boards one does.

The three group lists polled at three different periods: forums every 5 s,
boards every 30 s, channels never. Each poll fetches the whole summaries list,
and on a phone it costs a fresh TCP handshake on a server that answers one
request at a time. All three now share the boards period, named per page.
2026-08-16 13:06:50 +02:00
jolavillette
543a65f210 webui v142: stop three request storms that only hurt on a phone
Every JSON API answer carries `Connection: close` and the server runs its
service on a single thread, so each request costs a full TCP handshake and they
are answered one at a time. Over loopback a round trip is 0.1 ms and none of
this shows; over WiFi or 4G it is 20 to 80 ms and the three patterns below turn
into seconds of blank screen.

Chat room list: one getChatLobbyInfo per subscribed room, and nothing was
painted until the last answer arrived -- then only did the public room list get
asked for. Paint each room as it lands and start the public list immediately.

Forum post bodies: loadPostContent() is called from the view, and the body stays
null for the whole round trip, so every redraw fired the same getForumContent
again -- and each of the other posts' answers causes a redraw. An open thread
multiplied one request per post into one per post per redraw. Guarded by an
in-flight set, kept on failure so an unavailable post is asked for once per
visit rather than forever.

Chat history preload: two getMessages per known identity, hundreds of them at
once, filling the browser's six sockets and the single service thread while the
user waits for something else. Run four at a time. The duplicated response
handling of the two branches is now one function.
2026-08-16 13:05:57 +02:00
jolavillette
b62095aaf3 forums: measure the composer limit in bytes, and build the body once
Three defects in the new thread composer.

The 199 000 limit of a GXS message is a *byte* count, but the composer compares
it against String.length, which counts UTF-16 units: an accented letter is two
bytes for one unit, an emoji four bytes for two. With an emoji picker one click
away in that very toolbar, the counter can report room left on a message the
core will refuse. It now measures UTF-8 through TextEncoder, and says bytes
rather than characters.

postBody() was called five times per render -- twice for the class, twice for
the counter text, once for the disabled state -- and it re-escapes the message
and re-joins every inline image, each of which is up to 175 KB of base64. That
ran on every global redraw, which the statusbar triggers continuously, while the
user is typing. It is now built once per pass.

pollFileHash() re-arms itself every 500 ms for up to a minute. Closing the
composer left it running: it kept polling and redrawing a component that is no
longer mounted. onremove now stops it.
2026-08-13 13:50:09 +02:00
defnax
a070df6ff2 Improved the Forum thread/reply composer: 2026-08-13 13:27:36 +02:00
defnax
21716677d8 Fixed the subscribed Forum page layout
- Added a default Forum thumbnail to the forum details card.
- Added a default Board thumbnail for boards without an uploaded image.
- Added a default Channel thumbnail when no image is set.
2026-08-13 12:03:23 +02:00
jolavillette
03616fc38b webui v133: never put a userMap entry straight into a view
Opening a forum threw, and every redraw after it threw again:

    TypeError: Cannot read properties of undefined (reading 'view')
        at initComponent
    NotFoundError: Failed to execute 'removeChild' on 'Node'

userList.userMap holds {name, isContact} objects (rswebui.js:300 and :317),
not strings. userList.username() is the accessor that unwraps them:

    const name = typeof entry === 'object' ? entry.name : entry;

but several views read the map directly and handed the raw object to mithril:

    fauthor = rs.userList.userMap[forumDetails.author];   // forum_view.js
    ...
    m('p', m('b', 'Admin: '), fauthor)

Vnode.normalize returns anything that is `typeof === 'object'` untouched, and
createNode sends every non-string tag to createComponent, so the object was
treated as a component and initComponent dereferenced `vnode.tag.view` on
undefined. Once a redraw throws inside createNodes the vdom no longer matches
the DOM, which is where the removeChild storm comes from: the statusbar, the
identity bulk fetch and the forum load all redraw, and all of them fail.

It only bites when the author is already in the identity cache, which is why it
looks intermittent: the render that breaks is the one triggered by fetchBulk's
redraw, when the entry flips from missing to object.

Same direct read, same crash, in the channel view (header author, and the
comment author cell) and in the board view. The identity selectors called
.toLocaleString() on the entry, which does not throw but prints
"[object Object]" as the option label.

All of them now go through username(), which returns the name when it is known
and the raw id otherwise, and which queues the missing ids for the next bulk
fetch on the way.
2026-08-13 11:24:16 +02:00
defnax
fbf2d1c859 Improved forum create 2026-08-12 20:43:39 +02:00
defnax
6299503bb5 Fixed the forum post clipping.
Cause: the thread view created a second full-height .widget inside the page’s existing .widget. The nested height and overflow rules caused long posts to extend into a clipped area.
Changes:
- Removed the nested full-height widget
The main Forums widget is now the single vertical scroll area
- Added safe wrapping for long text
- Added horizontal scrolling for wide code blocks and tables
- Constrained images, videos, and embeds to the available width
2026-08-12 18:39:56 +02:00
jolavillette
2186feea58 Merge master into improvements_v2
Brings the branch up to date with master so #121 can be merged again.

Eight files needed a decision. The branch predates 41111cb ("restore WebUI
styles in SCSS sources"), which recovered into the SCSS a number of rules
that until then existed only in the compiled styles.css, so most conflicts
are that recovery meeting the changes made here. Where both sides describe
the same element the branch's version is kept; where master's rule is a
positioning context the branch has no equivalent for, master's is kept:

  * _chat.scss - master's attach-modal, emoji-picker, rightbar context menu
    and create-lobby-button rules are kept alongside the compact-message
    styles added here. Taking either side whole would have dropped about
    450 lines. .chat-own-profile-card, .chat-hub-rightbar and
    .chat-hub-rightbar .user keep `position: relative`, because
    .chat-create-lobby-btn and .rightbar-context-menu are still declared
    `position: absolute` further down and would otherwise escape to the
    initial containing block. For .user-tooltip the branch's `position:
    fixed` rework wins, and master's `.chat-hub-rightbar .user-tooltip
    { left: -275px }` offset is dropped since it would fight a fixed
    element.
  * _people.scss - master's restored .friends-list-container context menu
    is kept; the pane rules it also restored are shadowed by the branch's
    own !important versions and were dropped as dead code.
  * boards_util.js - the revived updateContent() and the in-flight dedup in
    updateDisplayBoards() are kept. Master's side of the first two hunks
    was comment reformatting only.
  * board_view.js - the rewrite here is kept whole. Master's only change
    since the fork point was `let reader` -> `const reader`, in code the
    rewrite replaced.
  * chat.js - the modals moved out one nesting level here; that structure
    is kept.
  * chat_state.js - `require('people/people_util')` is not restored. It is
    unused, which is why 35c5c17 removed it.
  * build.sh - master's version. The change here concatenated raw .scss
    onto the generated CSS; see the following commits.
  * styles.css - regenerated, see the following commits.
2026-08-08 17:10:48 +02:00
Sumit Kumar Soni
35c5c17309 build: modernize WebUI build and lint tooling 2026-08-02 20:46:00 +05:30
defnax
04d42dc38f Added comments viewer & composer for boards
Added Navbar for webui on phones
for Boards and Channels:
* Validate API responses before processing.
* Keep rendering/navigation functional if a response is incomplete.
* Log a clear warning instead of throwing an uncaught error.
* Use independent sorted arrays, avoiding mutation of the master list.
2026-07-28 23:58:26 +02:00
defnax
6fa597ea15 Improved for phone the webui pages
Added Board posts display
Added for Network to list last Chats
2026-07-26 20:50:14 +02:00
jolavillette
07c098ad96 webui v131: address PR review (fix shadowing, dedup utils, userMap→username, gxs_id fix, error handling, sessionStorage) 2026-04-01 05:04:21 +02:00
jolavillette
0c7705c392 forums now usable for reading 2026-03-24 06:31:09 +01:00
jolavillette
5438bba025 implement distant chat 2026-02-19 10:51:57 +01:00
jolavillette
15b0d169fe V1: makes chat usable, fetch history, add logout and reload buttons, add version number 2026-02-16 21:14:20 +01:00
zelfroster
344d9f2113 fix: forum needs bug fix, fixed basic ui 2023-06-19 23:57:35 +05:30
zelfroster
2af133dfe7 refactor: migrate entire css code to scss 2023-04-05 01:06:38 +05:30
Sukhamjot Singh
0b54e44da3 fixed issues 2022-09-13 02:55:01 +05:30
Sukhamjot Singh
12aecc7d72 Added comments 2022-09-06 15:58:14 +05:30
Sukhamjot Singh
10f9274c9f eslint fix for merge 2022-08-31 14:29:25 +05:30
Sukhamjot Singh
0533dedc58 edit thread working 2022-08-29 16:13:38 +05:30
Sukhamjot Singh
91b3c128df myfiles(incomplete) 2022-08-24 18:13:21 +05:30
Sukhamjot Singh
4df0f3803c Edit thread(qt ok) 2022-08-08 00:00:44 +05:30
Sukhamjot Singh
d81e835459 create channel(without thumnail) 2022-08-02 19:11:45 +05:30
Sukhamjot Singh
a6ea4c09c3 Create forums 2022-08-02 16:26:51 +05:30
Sukhamjot Singh
b6f43246a0 Read function complete. 2022-08-01 18:43:52 +05:30
Sukhamjot Singh
a42c67c4e1 read parent (Incomplete) 2022-07-31 15:16:55 +05:30
Sukhamjot Singh
c1e0e24f8a added reply and create multiple identity 2022-07-29 19:31:36 +05:30
Sukhamjot Singh
e0f8ece046 fixed threads issues, double click for toggle. 2022-07-28 00:56:34 +05:30
Sukhamjot Singh
7914ec6fcb added reply. 2022-07-26 18:00:47 +05:30
Sukhamjot Singh
8b7ee68bc7 Add thread 2022-07-25 15:46:48 +05:30
Sukhamjot Singh
4f93f7024b review fixed 2022-07-21 21:39:39 +05:30
Sukhamjot Singh
28585b14db prettier and eslint 2022-07-17 18:26:40 +05:30
Sukhamjot Singh
75926c41ac working forum threads 2022-07-17 01:18:09 +05:30
Sukhamjot Singh
ba89e00ecf added heading forum 2022-07-13 22:27:00 +05:30
Sukhamjot Singh
89d3a7285a Developed forums idea 2022-07-12 15:41:04 +05:30
Sukhamjot Singh
b2fbdcc6c1 comment section working 2022-07-09 01:38:37 +05:30
Sukhamjot Singh
d80ff0733e removed comments and check. 2022-06-16 16:12:42 +05:30
Sukhamjot Singh
cddca62662 Comment changes, added posts. 2022-06-13 23:04:14 +05:30
Sukhamjot Singh
2d01eca511 forums subscribe fix 2022-06-09 12:07:15 +05:30
Sukhamjot Singh
b6281457bb Subscribe channel working. 2022-06-03 17:41:25 +05:30
Sukhamjot Singh
fbb8178a65 Displayed all forums and description. 2022-05-30 16:53:32 +05:30
Sukhamjot Singh
f88dc80a80 called api, few editings 2022-05-25 15:15:21 +05:30
Sukhamjot-Singh
8fb58cfa2e added forums 2022-05-24 16:52:28 +05:30