Skip to content

Community demo: a members app built from OCS systems, and ocs__tabs--fit for its phone tabs - #2090

Closed
svaka2000 wants to merge 7 commits into
Open-Coding-Society:mainfrom
svaka2000:combined/community-demo
Closed

svaka2000 wants to merge 7 commits into
Open-Coding-Society:mainfrom
svaka2000:combined/community-demo

Conversation

@svaka2000

Copy link
Copy Markdown
Contributor

This puts #2085 and #2086 into one PR, since I had a lot of PRs open: the Community demo at /community/demo/, a members app for a made-up organization, and ocs__tabs--fit, the tabs class it uses to keep its main tabs on one row on a phone. I closed #2085 and #2086. I merged each branch in with git merge --no-ff instead of squashing, so the commits are the same ones those PRs had and each PR has its own merge commit. It doesn't need any other PR or a Spring or Flask change, so it can merge anytime.

From #2085: ocs__tabs--fit keeps a page's main tabs on one row on a phone

  • It's a new modifier for the tabs in the ocs__ grammar (the site's shared classes). On a phone, four tabs with icons don't fit on one row, so they wrap onto two. With --fit they share one row, each with its icon above its words, like the tab bar in a phone app.
  • It only changes tabs at 768px and narrower ($breakpoint-mobile). Wider screens keep the usual tabs.
  • It's opt-in, so the tab bars already on the site don't change. You add it to the same element as ocs__tabs: class="ocs__tabs ocs__tabs--fit".
  • Each tab's icon goes straight inside its ocs__tabs-btn, not in a <span>, since the preset themes recolor span text.
  • Five tabs fit too. A label of a few words wraps inside its own tab, so labels should be short, like a phone app's. The selected tab keeps its underline, and keyboard focus still shows.
  • It uses the grammar's spacing variables and sets no colors, so it follows the theme.
  • It adds the class to the grammar README's Tabs section, with an example to copy.
  • I checked it at 390 and 360 px wide in Chrome and in WebKit (the engine Safari uses), in the Community demo's colors and the Sepia, Light and Midnight themes.

Four tabs on a 390px-wide phone without --fit:

Four tabs on a 390px phone without ocs__tabs--fit, wrapping onto two rows

The same tabs with --fit:

The same four tabs with ocs__tabs--fit, on one row with each icon above its words

From #2086: the Community demo, a members app built from OCS systems

I made this demo for the messaging request you sent me on Nov 10. It's one new system, Community, put together from Messages, Courses' calendar, the microblog's polls and the theme engine. The organization, its people, its messages and its rules are all made up. It's "Demo Org", an investment group whose limited partners (LPs) put money into one deal at a time, called a series. Its people are LPs (the members), moderators and staff, and the rules are my picks to show what the systems can check. It runs on fake data in the browser, so nothing you post is saved or sent anywhere, and a reload starts it over.

  • The page has no Sass of its own. Its markup uses only the ocs__ grammar, and the chats keep Messages' styles. The main tabs use ocs__tabs--fit from Add ocs__tabs--fit to the tabs grammar, so a page's main tabs fit one row on a phone #2085, so they stay on one row on a phone.
  • The group chats and direct messages are Messages' own chat pane (createThread) on a fake backend that answers the calls the chat pane makes to Spring, with the same names and shapes. So sending, editing, deleting, replies, pins and Add to calendar work like they do in /dm. Add to calendar puts the event on the demo's own calendar.
  • Updates are posts from staff to all members or to one series. Members read them in Messages' message list and can't post there. The Reply in your group button posts your reply in your series' group chat with the update quoted, not to everyone.
  • An event in an update shows on the Calendar tab, which is Courses' week view. Polls are the microblog's surveys, and the choices are the picker cards Profile uses for personas (ocs__hub-card).
  • A member can report a message and send direct messages to staff and moderators, but not to each other. A moderator gets a Review tab and can hide the message, mute the person for 24 hours or 7 days, or remove them from the group. Staff can do all of that, write updates that another staff member has to approve, and download a CSV of every message, edit and moderator action, for one person or everyone, between two dates.
  • The rules about who can do what are checked in one class, DemoStore, not in the page, including who can follow a group's live chat. That's where a real server would check them.
  • Demo controls at the top switch who you're viewing as and the look (the demo's colors or the site's themes). The colors go through the theme engine's preview, so they only show on this page and a student's own theme doesn't change.
  • The words are in data/texts.yml and the demo organization is in data/demo.yml. The rules are classes with static methods, and the store, backend and views are classes you make with new.
  • It's big because it's a whole system, but everything is in its own folder except one line each in _projects/.makeprojects, AGENTS.md and AGENTS_MD_DOCUMENTATION.md. It's registered without :dev, so make dev leaves it out. Once merged the page is live, but nothing links to it.

An LP's Updates tab at 1440px:

Demo Org's Updates tab at 1440px wide, viewing as Demo LP 1

A series chat on a 390px phone, with a reply that quotes an update:

The Demo Series 1 chat on a phone, with a reply quoting a staff update

The moderator's Review tab on a phone:

The moderator's Review tab on a phone, with a report and the hide, mute and remove buttons

A second staff member approving an update:

Demo Staff 2 approving an update Demo Staff 1 wrote, with the phone notification it would send

Other notes:

How to try it:

  1. Check out combined/community-demo from svaka2000/Pages-JJ and run make.
  2. Open http://localhost:4500/community/demo/. You start as Demo LP 1. Hover over an update and click its reply arrow (Reply in your group). On the Groups tab, send a message in Demo Series 1, then click Report a message (next to the group's name) and pick Demo LP 9's message about a side deal.
  3. In Demo controls, switch to Demo Moderator, open Review, and click Hide and mute 24 hours. Switch to Demo LP 9 and open Groups: their Demo Series 1 chat is read-only, with a note saying until when.
  4. Switch to Demo Staff 1 and send an update for approval. Switch to Demo Staff 2 and approve it in Review. Under Export records, pick Demo LP 9 and download the CSV.
  5. Switch back to Demo LP 1 and open DevTools' phone view, about 390px wide. The four main tabs share one row. If you take ocs__tabs--fit off their ocs__tabs element in DevTools, they wrap onto two rows.

A members app for an organization, put together from OCS systems. This commit holds its words, a made-up demo organization's setup, the static rule classes (roles, the DM rule, channels, moderation, records, plain calendar weeks, the brand), and DemoStore and DemoBackend, which answer Messages' createMessagesApi calls in Spring's shapes and make every check a server would make.
The page at /community/demo/ hands the other systems' modules to CommunityApp: Messages' thread pane for group chats and direct messages, its message log for updates, Courses' week view for the calendar, the microblog's surveys for polls, and the theme engine for the organization's colors. Downloads go through Messages' saveBlob.
Open-Coding-Society#2087 rewrites the week calendar line that the Community line sat right
above, so the two conflicted in AGENTS.md and AGENTS_MD_DOCUMENTATION.md.
Between Grades and the UI Builder, the line merges cleanly with it.
@svaka2000

Copy link
Copy Markdown
Contributor Author

Closing this for now. I'll show you the demo when we talk about the messaging project, and reopen it if you want it on the site.

@svaka2000 svaka2000 closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant