Skip to content

Rewrite fixes: logo limit, learner community polish, mailing address in Marketing - #920

Merged
clbotdev merged 13 commits into
platform-based-rewritefrom
t3/rewrite-bug-fixes
Nov 27, 2026
Merged

clbotdev merged 13 commits into
platform-based-rewritefrom
t3/rewrite-bug-fixes

Conversation

@clbotdev

Copy link
Copy Markdown
Contributor

A batch of bug fixes and small improvements to the rewrite, one commit each.

Changes

  • Cap school logo uploads at 2 MB (e45e13c9). The logo picker allowed 50 MB and the API accepted staff uploads up to 1 GB. The contract now has SCHOOL_BRANDING_IMAGE_MAX_BYTES. The API refuses oversized or non-image school_branding uploads and logo picks from the library. The admin pickers pass the limit to the upload dialog and show clear messages.
  • CourseLit badge above the account menu (30fd5db7) in the learner sidebar.
  • Basic rich text for community posts (bac61b1e). The post, comment and reply editor uses a communityTextProfile: Heading 2 and 3, lists, quotes and the usual marks, with no Heading 1, code blocks, dividers, tables or inline images. Media goes in as attachments. Content outside the profile keeps the default profile while being edited, so nothing is dropped.
  • Post attachments in one horizontal scroll row (f39305d1), as on main. Files, GIFs and YouTube videos share one row of equal-height tiles in the composer, the post editor, posts, comments and the dashboard feed.
  • Theme cards without the radio dot (f31e1824). The dot was stacking under the colour swatches. The selected border already shows the choice. Tile gets an indicator option.
  • Mailing address setup moves to Marketing, as a postal address (6191a1d3, breaking):
    • The onboarding wizard's Email step is removed.
    • Broadcasts, Sequences, Templates and Settings show "Get ready to send email" until the school has an address. Settings → Mail delivery edits the same form afterwards.
    • The address is stored in parts through SendLit's postalAddress (feat: store the mailing address as structured postal address fields sendlit#218, released as sendlit@0.6.0 and @sendlit/email-blocks@0.8.0). SendLit formats the footer text, and CourseLit uses the same country list and formatter.
    • The preview is SendLit's own render of a marketing email.
    • The wizard's sender name field is dropped, because it was never saved.

Breaking

  • GET/PATCH /v1/school/mails/settings and their MCP tools use postalAddress only; plain-text mailingAddress is refused.
  • The onboarding step email no longer exists.
  • With SendLit 0.6.0 deployed, older CourseLit builds treat every school as having no mailing address. QA is in that state until this PR is deployed.

Testing

  • Automated: admin (236), storefront (134) and the affected API tests pass. The admin, API and storefront typecheck at the final commit and at the intermediate commits that were built from partially staged files. The docs checker passes.
  • Local end to end (SendLit built from Resolving yarn errors #218):
    • A send without an address is blocked.
    • The address saves in parts.
    • A test broadcast in Mailpit has the formatted address in its footer, matching the preview.
  • Not checked in a browser: the CourseLit screens. They were reviewed during development over Tailscale.

The logo picker let creators upload images up to the media dialog's 50 MB
default, and the API accepted staff uploads of up to 1 GB for any purpose.

- api-contract: SCHOOL_BRANDING_IMAGE_MAX_BYTES (2 MiB), importable from
  the browser via @courselit/api-contract/school-branding.
- api: school_branding upload authorizations must be images within the
  limit (unsupported_branding_type / file_too_large), and saving the
  website logo rejects library media that isn't an image or is too large
  (logo_not_image / logo_too_large).
- admin: the website settings and onboarding logo pickers pass the limit
  to the upload dialog, MediaField also blocks oversized library picks,
  and the refusals get clear messages.
The learner sidebar footer showed "Powered by CourseLit" under the account
menu. It now sits above it, so the account menu stays at the very bottom.
The community post, comment and reply editor offered every default block,
including Heading 1, code blocks, dividers, tables and inline images.

A shared communityTextProfile (@frontlit/text-editor defineProfile) now
allows paragraphs, headings 2 and 3, lists, quotes and the usual marks
only; images, videos and files go in as post attachments. Content that
holds nodes outside the profile (older posts, or posts made through the
API) keeps the default profile while being edited, so nothing is dropped.
Rendering is unchanged, since the renderer throws on nodes outside its
profile.
As on main, a post's files, GIFs and YouTube videos now sit in one row of
equal-height tiles that scrolls sideways, instead of stacked lists. The
shared LearnerPostAttachments component is used by the post composer
(which showed uploaded files only as name chips), the inline post editor,
posts and comments in a community, and the dashboard feed. The old
LearnerPostGifs and LearnerPostVideos lists are removed.
The theme cards passed flex-col to the shared Tile, which pushed its radio
indicator onto its own row under the colour swatches, where it read like
a colour. The cards no longer stack, and they hide the dot altogether
(new Tile indicator option): the selected card's border already shows the
choice, and the hidden native radio still serves keyboards and screen
readers. Other Tile cards keep the dot.
…ress

Few schools send marketing email through CourseLit, so the onboarding
wizard no longer has an Email step. Its "Get ready to send email" screen
now lives in Marketing: Broadcasts, Sequences, Templates and Settings show
it until the school has a mailing address, and Settings > Mail delivery
edits the same form afterwards.

- The address is stored as parts (line1, optional line2, city, region,
  postal code and an ISO country code) through SendLit's new
  postalAddress setting (sendlit 0.6.0, @sendlit/email-blocks 0.8.0).
  SendLit formats it into the footer text, and CourseLit uses the same
  country list and formatter from @sendlit/email-blocks/postal-address.
- The form lists every country and starts on the browser's one. Its
  preview is SendLit's own render of a marketing email, so the footer
  shows the address exactly as recipients will see it.
- The wizard's sender name field is dropped: it was never saved.
- Sending, the onboarding checklist and the editor banners check
  postalAddress. The MCP descriptions no longer mention a sender name or
  reply-to that don't exist.
- Docs: create-a-school and marketing-settings are updated.

BREAKING CHANGE: GET/PATCH /v1/school/mails/settings (and the matching MCP
tools) use postalAddress only; plain-text mailingAddress is refused. The
onboarding step "email" no longer exists.
The contract changes in 6191a1d (postalAddress mail settings, no "email"
onboarding step) left apps/api/openapi.json stale, failing check:drift.
The space dialog asked for a "Lucide icon name", which creators don't
know, and the storefront ignored the value anyway: every space showed the
same speech-bubbles icon.

- api-contract: SPACE_ICONS (@courselit/api-contract/space-icons), a
  curated list of icon names with plain labels; the API accepts only
  those (invalid_logo otherwise), defaulting to MessagesSquare.
- admin: the Icon field opens a popover grid of icons (native radios, so
  arrow keys move and Enter or a click confirms); the space list shows
  each space's icon. Adds a codelit Popover wrapper.
- storefront: the learner sidebar shows each space's chosen icon. Both
  apps map names to explicit icon imports typed against the shared list.
A community plan's included products are now a choice: All products (every
published product, including ones published later) or Selected products
(picked from a dropdown; an empty selection includes none).

- Access stays an eager learner_memberships row per product. Joining,
  approval and payment grant the plan's products. A background job
  (sync_plan_included_products on the platform job queue) gives a newly
  published product to all-products plan members, archived plans included,
  and reconciles current members when a plan's products change: missing
  products are granted, removed ones expire so progress returns on re-add.
- Rows the system adds or revokes on its own queue no SendLit events
  (upsertLearnerMembership / revokeLearnerMembership silent option); a
  learner's own action (join, approval, purchase) still does.
- The product-level includedWithCommunity flag and its sync are removed;
  a product may be published without its own plan when an active
  community plan includes it.
- Storefront sales pages offer the community plans that include the
  product; the admin plan dialog and list show All products or the
  selection; MCP marks updateCommunityPlan high-impact; docs updated.
- Tests cover 42 scenarios (plan-included-products.test.ts and the
  storefront, page-blocks and admin unit tests).

BREAKING CHANGE: plans gain includesAllProducts; products lose
includedWithCommunity (column and API field).
…lit into t3/rewrite-bug-fixes

# Conflicts:
#	apps/api/src/website.ts
The API lets a product with no plan of its own go live when an active
community plan includes it (all products, or by name), but the admin
checklist still asked for a payment plan and kept "Make course live"
disabled. The admin product detail now reports includedInCommunityPlan
and the checklist counts it as a way to join.
@clbotdev
clbotdev merged commit d1f1006 into platform-based-rewrite Nov 27, 2026
5 checks passed
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.

2 participants