Repository navigation
Messages and calls: class groups, mentors, reactions, capstone team chat and video calls (combines #2070, #2078, #2080-#2082, #2084, #2088) - #2091
Open
svaka2000 wants to merge 34 commits into
Conversation
- /calls/?group=, ?dm= and ?course= open that place's call through Spring's /api/calls (spring#287): a lobby with your camera, then a cell per person, a toolbar, and the group's chat and people beside it. - Built from the OCS grammar only (ocs__grid--col2 or --card, ocs__embed--video, ocs__avatar, ocs__status-pill, ocs__viewer, ocs__split--aside-end), with every word in data/calls.yml. - The safety rules show on the page: a mentor waits in the lobby until a teacher is in, and someone paused sees why. - A teacher can pause, resume or remove someone, and end the call for everyone, each after a confirm. - Messages gets a Call link in a group's or DM's header, and a line while a call is on there, shown only after Spring confirms it. - Off by default: calls: enabled: false in _config.yml, and a spring: false site shows none of it.
- The lobby's Mic and Camera wait while a join is on its way, and a Join waits for every device the lobby is still asking for, so each one is either sent or stopped. - While someone waits for a teacher, Join and the toggles stay usable, and pressing Join keeps a single watch on the room. - The lobby's status line sits above the preview, where it is seen, and its no-devices line goes once a camera or microphone works. - While you're paused, everyone else shows as initials instead of frozen video. - A teacher's Manage stays open while people talk and come and go, and keyboard focus stays on it when the people list redraws: the list redraws only when what it shows changes. - The sound button can be pressed again after a failed try. - A device that doesn't come back after a pause is reported. - A body that can't be read is a CallsApiError too. - The fake LiveKit stops a paused person's tracks, as livekit-client does. - The docs show the calls switch as `enabled: true` under `calls:`. Written on one line, `calls: enabled: true` isn't valid YAML. - CallsApi drops its method for Spring's live-calls list, which nothing on the page used.
A project post names its team's group in Messages with capstone_project.team_group and places capstone-team-chat.html where the chat goes. The page shows that group's chat (Messages' mountGroupChat) with a link to the group in Messages: to its members, to a mentor in the group once it has at least 2 members who aren't mentors, and to teachers and admins. Anyone else gets a note saying the chat is for the team. Everyone looks for the group in their own groups first, and only a teacher who isn't a member searches by name, so a mentor's browser never calls a route Spring refuses mentors. Without team_group, or on a Flask-only site, nothing renders. The words are in data/team_chat.yml.
The post names our team's group in Messages, OCS Comm and Cap, as capstone_project.team_group and places the team chat below the infograph. Inside the comms-infograph wrapper, infograph.scss would restyle the chat (every class ending in -title is 2.75rem there).
The Shared panel note says Spring's push text still has raw markers, so a DM pin pushes the marker. That stays true until Open-Coding-Society/spring#293 merges, so the note names it, in AGENTS.md and AGENTS_MD_DOCUMENTATION.md alike.
A React button comes first in a message's action bar and opens a menu of the six reactions (the composer's PopupMenu, ocs__menu). setReactions draws a message's chips after what it shows and before the action bar; picking your own reaction, or clicking your chip, takes it back. While a change is saving, that message's reaction controls wait. A message without an id, a deleted one and a pin note take none, and deleting a message or clearing the log closes its menu. The new words are in the UI Builder's text.chat.
Once a conversation's history is drawn, the thread asks Spring for its reactions and draws each message's chips, and asks again after the socket reconnects, so reactions left or taken back while offline show. A reactions frame redraws one message's chips, and a message a frame or your own change redrew since the load began keeps that newer state. Picking a reaction sends PUT, picking yours again sends DELETE, and a failure says "Could not save your reaction. Try again." A read-only pane, or a host whose API has no reaction calls, asks for none.
… the log's foot As a column of six named items it was taller than a phone's log has room for beside a message, so its first items were cut off. Now it is one row of the six emoji, with each name kept as its button's name but not drawn. Where there still isn't room under the action bar, it opens above.
The Messages README gets a Reactions section, the reaction routes and frames under Endpoints, and reactions.js in its file list. AGENTS.md and AGENTS_MD_DOCUMENTATION.md get the same Messages bullet: how reactions look and load, that Spring keeps them (Open-Coding-Society/spring#302), and that the reaction keys change together with Spring's Reaction enum.
…and Open-Coding-Society#2078 change The calls page (Open-Coding-Society#2070) adds its frame case after the error case, and the push-note PR (Open-Coding-Society#2078) edits the Shared panel bullet in both AGENTS files. The reactions frame case now follows the delete case, and the reactions bullet follows the GitHub cards bullet, so this merges cleanly with either in any order.
The rows' fade kept itself in effect after it ended (fill mode both), which made each row its own layer, and the action bar is its own layer while it fades in. Either way the next message covered the open menu and took its clicks, even on that message's Delete. The fade now fills only backwards, and a row with focus in it (an open menu always has it) sits above the rows after it. The menu's emoji stand upright in Chrome, and your own reactions wear the grammar's hover tint.
A chip that had focus keeps it when its row is redrawn, and after a reaction saves, focus that fell off the page goes back to that chip or the React button. A click elsewhere closes a menu without taking focus back to its button, which also scrolled the log up to it. The reaction menu is a horizontal menu (Left and Right step through it) and marks yours as checked items, and the chip row is left out of the log's live announcements.
One set of messages changed since a load began was shared by every load, so a catch-up for a chat you had left reset it and the open chat's older answer could undo a newer frame. Each change now counts, and a load or your own PUT's answer that started before a message's last change leaves that message as it is; a load for a chat that's no longer open asks for nothing. Read-only panes ignore reaction frames, and a saved reaction clears only its own failure notice.
Spring lists a group to its mentor only once they're in it and it has 2 members who aren't mentors. So the page never got a team that was too small, the team-too-small note could never show, and a mentor whose own groups left the team out was told "A member can add you" even when they were already in the group. A mentor who doesn't see the chat now gets one note naming both steps, and the page no longer counts members itself.
Under the team chat, everyone in it sees who mentors the team. A member who isn't a mentor, or a teacher, can search for verified mentors (people search, narrowed to ROLE_MENTOR accounts not in the group yet) and add or remove them through the group's members routes. A mentor sees the list only. When Spring refuses a change, the panel shows the page's words for Spring's reason. Names are always set as text.
"Add at least 2 team members" was wrong for a group that already had one. It now says the group needs at least 2 members who aren't mentors before it can have a mentor, and that teammates are added in Messages.
A class group's members come from the classes on each student's Profile, and
spring#309 lets only teachers and admins change them through POST and DELETE
/api/groups/{id}/members/{personId}. Members now shows Add and Remove on a class
group only to them (canChangeMembers). Everyone else sees the list, without the
Action column. With the search hidden, createDialog focuses the close button, so
focus stays in the dialog. isClassGroup now trims the name before comparing, as
Spring's ClassGroupMembershipService does.
Allowances.for(me) mirrors Spring's rules for the page. Spring's MentorRules keep an account with ROLE_MENTOR and no teacher or admin role to its team's groups, so that account gets no New chat, no Find or make, and no Remove or add search in Members. Its empty Direct messages list says direct messages are off, the empty thread pane says to pick a group, and Leave says a member can add them back. Allowances also holds those words and shows or hides the buttons. The page passes its answers to the shared modules, which never check the mentor role; a test fails if one does. New chat leaves out people Spring won't let anyone message, since Spring refuses any direct message that includes one of them. A refusal now carries Spring's reason with its status, uploads too. A send, a New chat start or a member change that Spring refuses for a mentor rule says why instead of asking to try again. Members marks the members Spring says are mentors, and a dialog whose fields are all hidden focuses Close.
…keeps its status The page passed createThread two texts objects, and the later one (the commands placeholder) replaced Allowances' words, so a mentor's empty thread pane still offered New chat and Find a group. They're one object now, and a test fails if a second appears. A failed response whose body can't be read now keeps its status, with no reason, instead of rejecting with the read error.
Spring refuses "message the owner" with mentor_no_direct_messages when the page's owner or the visitor is a mentor. The block showed its generic "Couldn't start a message. Try again." for that, so the visitor kept trying. It now says a mentor would be in the message.
… check reads every module "Add at least 2 people who aren't mentors" was wrong for a group that already had one. It now says a group needs at least 2 members who aren't mentors before it can have a mentor. The test that keeps the mentor role out of shared code read 5 of the 42 modules. It now reads every one but allowances.js.
…roup rule Open-Coding-Society#2088 hides Members' Action column on a class group for anyone who isn't a teacher or admin, so the dialog now toggles the column's header, and the tests give it one. A student no longer gets Add in a class group, so the class-group refusal test opens the dialog as a teacher.
…ay pushes keep raw markers until the Spring fix
…chers and admins get Add and Remove in a class group
…only what Spring lets it do
…e with an emoji # Conflicts: # _projects/systems/messages/tests/thread.test.mjs
…nd removes its mentors
…ideo calls, and a Call link in Messages
…is branch test_calls_page.rb checks that /dm with calls off is byte for byte what it was before calls' hook. It pinned upstream main 5b811b0, but main has changed dm.md since then (the Shared button), and so do the Messages PRs merged here before calls. It now pins this branch's merge of Open-Coding-Society#2081, the commit just before calls was merged in.
This was referenced Nov 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I had seven open PRs for Messages, the capstone team chat and calls, so I put them into one. It's about 86 files, but each old PR's commits are merged in as they were, one merge commit each, so you can still look at them one at a time. The only new changes are one test conflict and two small fixes, under "How I combined them".
What it needs from Spring:
_config.ymluntil then, and like you said on Calls: a page for group and DM video calls, and a Call link in Messages #2070, they wait until Spring is deployed.Class groups in Members (was #2088)
What a mentor gets in Messages (was #2082)
Reactions (was #2084)
Team chat on a capstone page (was #2080)
capstone_project.team_groupand adds{% include projects/capstone/capstone-team-chat.html %}. It's on for our Communication Systems page.The team's mentors (was #2081)
Video calls (was #2070)
/calls/has a call for each group, DM and class: a lobby, everyone's camera, the chat and a People list. A group or DM in/dmgets a Call link./calls/only says so, and the calls code adds nothing to/dm. A test checks that.Push note in the AGENTS docs (was #2078)
[[pin:…]]marker in the message. The AGENTS docs say a DM's push notification shows that raw marker until spring#314 merges.How I combined them:
git merge --no-ff, in this order: Messages: the AGENTS docs say pushes keep raw markers until spring#293 #2078, Messages: only teachers and admins get Add and Remove in a class group #2088, Messages: offer each account only what Spring lets it do #2082, Messages: react to a message with an emoji #2084, Capstone: a team chat on the team's page #2080, Capstone: the team adds and removes its mentors #2081, Calls: a page for group and DM video calls, and a Call link in Messages #2070. All seven heads are in its history._projects/systems/messages/tests/thread.test.mjs, where Messages: offer each account only what Spring lets it do #2082 and Messages: react to a message with an emoji #2084 both add tests at the end. I kept both.test_calls_page.rbcompared/dmwith a copy from an old main, from before the Shared button, so it now compares with this branch's/dmjust before calls. And Messages: the AGENTS docs say pushes keep raw markers until spring#293 #2078's sentence now names spring#314 instead of spring#293./dm, the Communication Systems page and/calls/at laptop and phone widths in Chrome and WebKit, with calls off and on, using fake Spring answers.How to try it:
/dm, react to a message and reload: it stays. Open Members on your class group: there's no Add or Remove./capstone/communication-system/as one of them: the team chat and the Mentors list are there.calls.enabled=trueand theLIVEKIT_lines in Spring's.env, run LiveKit, turn calls on in_config.yml, then open a group in/dmand click Call.