In web/src/app.jsx, joinChannel sends the JOIN, adds the channel's tab if it is not there yet, and then makes tab number tabsRef.current.length the active one. That is the new tab's index only when the tab list has not changed in the meantime. Since the server queues the user's own JOIN event to every client of the session, the sending web client included, that event can arrive and add the tab before the JOIN request returns. tabsRef.current.length is then one past the last tab. The same happens when the user joins a channel whose tab is already open.
The active tab then points at no tab. The view falls back to the Server tab, and sendMessage returns at if (!tab) return; after clearing the input line, so everything the user types is silently dropped until they click a tab. Found while fixing #185; read from the code on 76ef8ff.
Fix: after a join from the web client, make the channel's own tab active, found by its name in the tab list, whichever arrives first, the JOIN event or the request's response. Change nothing else in the web client.
Definition of done
After /join #chan from the web client, the #chan tab is active and what the user types next is sent to #chan, whether the JOIN event or the request's response arrives first.
Joining a channel whose tab is already open makes that tab active.
The PR says how each item was checked, since the web client has no test setup.
One reviewed PR against next.
Model: opus-5-5
In `web/src/app.jsx`, `joinChannel` sends the `JOIN`, adds the channel's tab if it is not there yet, and then makes tab number `tabsRef.current.length` the active one. That is the new tab's index only when the tab list has not changed in the meantime. Since the server queues the user's own `JOIN` event to every client of the session, the sending web client included, that event can arrive and add the tab before the `JOIN` request returns. `tabsRef.current.length` is then one past the last tab. The same happens when the user joins a channel whose tab is already open.
The active tab then points at no tab. The view falls back to the Server tab, and `sendMessage` returns at `if (!tab) return;` after clearing the input line, so everything the user types is silently dropped until they click a tab. Found while fixing https://git.eeqj.de/sneak/neoirc/issues/185; read from the code on `76ef8ff`.
Fix: after a join from the web client, make the channel's own tab active, found by its name in the tab list, whichever arrives first, the `JOIN` event or the request's response. Change nothing else in the web client.
## Definition of done
1. After `/join #chan` from the web client, the `#chan` tab is active and what the user types next is sent to `#chan`, whether the `JOIN` event or the request's response arrives first.
2. Joining a channel whose tab is already open makes that tab active.
3. The PR says how each item was checked, since the web client has no test setup.
4. One reviewed PR against `next`.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In
web/src/app.jsx,joinChannelsends theJOIN, adds the channel's tab if it is not there yet, and then makes tab numbertabsRef.current.lengththe active one. That is the new tab's index only when the tab list has not changed in the meantime. Since the server queues the user's ownJOINevent to every client of the session, the sending web client included, that event can arrive and add the tab before theJOINrequest returns.tabsRef.current.lengthis then one past the last tab. The same happens when the user joins a channel whose tab is already open.The active tab then points at no tab. The view falls back to the Server tab, and
sendMessagereturns atif (!tab) return;after clearing the input line, so everything the user types is silently dropped until they click a tab. Found while fixing #185; read from the code on76ef8ff.Fix: after a join from the web client, make the channel's own tab active, found by its name in the tab list, whichever arrives first, the
JOINevent or the request's response. Change nothing else in the web client.Definition of done
/join #chanfrom the web client, the#chantab is active and what the user types next is sent to#chan, whether theJOINevent or the request's response arrives first.next.Model: opus-5-5
Fix is in #196, awaiting review.
Model: opus-5-5