Skip to content

Lor delete pass#53

Closed
BuckyMcYolo wants to merge 8 commits into
mainfrom
lor-delete-pass
Closed

Lor delete pass#53
BuckyMcYolo wants to merge 8 commits into
mainfrom
lor-delete-pass

Conversation

@BuckyMcYolo
Copy link
Copy Markdown
Owner

@BuckyMcYolo BuckyMcYolo commented May 29, 2026

PR Summary: Lor Delete Pass

Overview

This is a large-scale feature deletion and rebranding pass that transforms the "Townhall" product into "Lor" (an institutional-memory chat offering called "Merlin"). The PR systematically removes social features (allies, friend requests, user blocks, privacy settings) and replaces them with a workspace-scoped DM model. It includes comprehensive documentation, design specifications, and landing page rebranding.

Key Changes

Product & Strategy

  • PIVOT.md (338 lines): Complete rebrand specification locking the Lor/Merlin product direction, defining public-by-default conversations, workspace primitives, and retiring medieval Townhall vocabulary
  • Skills: Added three AI design specifications (.agents/skills/design-taste-frontend/SKILL.md, gpt-taste/SKILL.md, high-end-visual-design/SKILL.md) with proper symlinks and skills-lock manifest

API & Backend Deletion

Removed endpoints/handlers:

  • /v1/allies/* (send/list/accept/decline ally requests, list allies, remove ally) — entire module deleted with no remaining references
  • /v1/blocks/* (block/unblock user, list blocked users) — entire module deleted
  • /v1/privacy-settings/* (get/update privacy settings) — entire module deleted

Authorization & DM Logic:

  • DM creation now requires workspace-scoping: all target users must share at least one guildId with the requester (replaces prior ally/block/privacy checks)
  • Removed block-based DM visibility filtering and ally-only access gates
  • getUserProfile no longer returns allyStatus, allyRequestId, or blockStatus

Database Schema:

  • Deleted: ally_requests.ts, user_privacy_settings.ts modules
  • Updated: userBlockRelations removed; userRelations no longer includes blockedUsers, blockedByUsers, privacySettings relations (verified no remaining references)
  • Preserved: Core schema (users, channels, guilds, guild-members, messages, etc.) intact

Realtime (Socket.IO):

  • Removed presence privacy filtering (no "allies_only" / "no_one" enforcement)
  • Removed DM block-based message/typing suppression
  • Presence updates and typing now flow without privacy/block checks
  • Deleted isDMBlockedForUser service entirely

Web Frontend Deletion

Removed components:

  • AlliesPage — entire allies management UI (667 lines)
  • PrivacySafetySettings — privacy settings dialog tab
  • allies-page.tsx, privacy-safety-settings.tsx files

Simplified components:

  • NewDMDialog refactored to stub: now shows instructional message "Open a member's profile to start a direct message with them" instead of search/ally selection UI
  • DMPanel simplified: removed "Allies" button and navigation elements
  • UserProfileCard stripped: removed ally-request/block/unblock buttons; "Send DM" remains as only non-profile-owner action
  • Message list: Updated empty states with ScrollText icon and "send a raven to begin" messaging

Hooks & API:

  • Deleted: useBlockedUsers, useBlockedUserIds, usePrivacySettings, useUpdatePrivacySettings hooks
  • Removed type definitions: ListAlliesResponse, Ally, ListAllyRequestsResponse, AllyRequest, ListBlockedUsersResponse, BlockedUser
  • Routes cleaned: removed blockedUserIds prop from DM and channel routes

Design & Branding

Landing page (Townhall → Lor):

  • Replaced static marketing layout with editorial, motion-driven "Lor" pitch (hero → lore passage → Merlin vignette → journey chapters → summons CTA → footer)
  • Updated metadata (lor.chat), OpenGraph, and favicon to Lor branding
  • Added new components: Grain (overlay), Reveal (scroll-reveal), Waitlist (email signup) — all properly functional
  • Removed: CopyTerminal, ThemeToggle, PreviewPage components; /preview route removed

Chat UI icons & typography:

  • Channel icon: HashScroll (for text channels, applied consistently across sidebar and message list)
  • Added Lora serif font (LoraVF.woff2) with --font-serif CSS variable
  • Color palette: Added Merlin (purple) and gold tokens; updated all design system colors (oklch values) for Lor brand in both light and dark modes

Chat composer & UX:

  • Added TipTap code block highlighting (CodeBlockLowlight, CodeBlockView, lowlight library) with language selector
  • Message composer: Slash commands enabled (was previously commented out)
  • Bubble menu refactored: removed code-block language configurator, added inline formatting bubble (bold/italic/inline code/strike)
  • Button: Added active:scale-[0.97] press feedback for tactile response

Dependencies & Configuration

  • Added: @tiptap/extension-code-block-lowlight, lowlight (code syntax highlighting)
  • Added: CustomSelectItem component with optional tooltip support in @repo/ui
  • Added npm script: dev:www in root package.json
  • Waitlist endpoint present: POST /waitlist properly wired in API with schema, handlers, routes, and mounted in app.ts

Testing & Coverage

  • Auth guard tests updated: removed assertions for deleted endpoints; retained /v1/dms and /v1/notification-settings
  • Tests remain at minimum coverage level; no new test assertions for workspace-scoping DM logic or new components

Code Quality Observations

Clean removals: All deleted modules have zero remaining references; imports are properly cleaned up
Consistent schema updates: Relations are correctly trimmed without dangling references
Symlink structure: Design skills symlinks verified as correct
No broken imports: Verified no imports of removed files across codebase
API completeness: Waitlist endpoint exists and is mounted

⚠️ Gaps & Concerns:

  • NewDMDialog UX: Simplified to stub with instruction to "open member profile" — users cannot create DMs via dedicated dialog; this is a workaround rather than full feature
  • Database migrations: Not visible in diff; actual schema changes (dropping columns/tables) require migrations, which are not included in this PR diff
  • Test coverage: No new tests for workspace-scoping authorization, new landing page components, or design token changes
  • DM authorization edge cases: Error handling/messages for scenarios (no shared workspace, empty target list) not explicitly tested or documented

Confidence Score: 3/5

The PR is mostly solid with some notable gaps:

  • Code cleanup is excellent and systematic
  • Architectural decision (workspace-scoping) is sound
  • No broken imports or dangling references
  • All removed components/hooks properly deleted
  • Design assets and landing page work well

However, the removal of DM creation dialog UI (even as a workaround with instructions) and the absence of visible database migrations are meaningful gaps. The NewDMDialog stub is functional but represents incomplete UX that depends on users discovering profile-based DM creation. Database migrations must exist elsewhere or need to be created for production.

Can merge with caveats: The PR is not breaking, but should be followed by:

  1. Database migration verification/execution
  2. User testing of new DM creation flow (profile-based only)
  3. Test additions for workspace-scoping logic
  4. Potential future full DM dialog implementation if profile-based approach proves insufficient

Review Change Stack

Remove allies, blocks, and privacy-settings surfaces — Discord-style
community features that don't apply to Lor's B2B model where workspace
membership IS the relationship.

DB: deleted ally-requests + user-privacy-settings schemas. user-blocks
table kept for now (UI/enforcement gone).

API: deleted /v1/{allies,blocks,privacy-settings}. DM creation no longer
gates on ally/block/privacy. User profile no longer returns
ally/block status fields.

Realtime: removed presence privacy filtering and DM block enforcement
from message:send and typing:start.

Web: deleted allies page + privacy-safety settings UI. Stripped
ally/block actions from profile card. new-dm-dialog and dms/index
reduced to placeholders pending sidebar IA rebuild.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR executes the Lor product pivot by removing allies/blocks/privacy-settings features across API/realtime/database/web tiers, refactoring DM authorization to workspace-membership validation, enhancing the message composer with code-block syntax highlighting, redesigning the landing page with Lor branding, and updating the design system with a purple-and-gold color palette and serif typography.

Changes

Pivot Documentation & AI Skill Specifications

Layer / File(s) Summary
Pivot specification and skill documents
PIVOT.md, .agents/skills/*, .claude/skills/*, skills-lock.json
PIVOT.md documents the Townhall → Lor product pivot, locked vocabulary (channels, workspaces), public-by-default conversations, and migration priorities. Three AI skill guides define design-generation rules (design-taste-frontend for React/Next baseline, gpt-taste for AIDA page structure, high-end-visual-design for premium UI). Symlinks in .claude/skills/ reference the canonical skill definitions.

Social Features Removal (Allies, Blocks, Privacy Settings)

Layer / File(s) Summary
Database schema removal
packages/db/src/schemas/*
Deleted ally_request and userPrivacySettings table schemas, removed userBlockRelations from user_blocks, and removed barrel exports for the deleted schemas.
API routes, handlers, and schemas removal
apps/api/src/app.ts, apps/api/src/routes/v1/allies/*, apps/api/src/routes/v1/blocks/*, apps/api/src/routes/v1/privacy-settings/*
Completely removed /v1/allies, /v1/blocks, and /v1/privacy-settings route modules (handlers, routes, schemas); updated app.ts to unmount these routers and register only channels/guilds/invites/notification-settings.
Web client social components removal
apps/web/src/components/allies/*, apps/web/src/components/settings/privacy-safety-settings.tsx, apps/web/src/hooks/use-*.ts, apps/web/src/lib/api-types.ts
Deleted AlliesPage, PrivacySafetySettings components and corresponding React Query hooks (useBlockedUsers, useBlockedUserIds, usePrivacySettings, useUpdatePrivacySettings); removed allies/blocks type definitions from API types.
Realtime server block and privacy enforcement removal
apps/realtime/src/index.ts, apps/realtime/src/services/blocks.ts
Removed isDMBlockedForUser service and all privacy-based filtering logic from presence broadcasting, snapshots, typing suppression, and message sending; presence is now unfiltered server-side.
User profile endpoint and component simplification
apps/api/src/routes/v1/users/*, apps/web/src/components/ui/user-profile-card.tsx
GET /v1/users/:userId response removed allyStatus, allyRequestId, blockStatus fields; web UserProfileCard removed ally/block action buttons and mutations, showing only a single "Send DM" button.

DM Authorization Model Refactor

Layer / File(s) Summary
DM workspace-based authorization
apps/api/src/routes/v1/dms/*
Refactored createDM handler to fetch requester's workspace memberships (guildMember records) and reject DM creation if requester has no workspace or any target user does not share a workspace; removed previous block/privacy/ally eligibility checks.

Message Composer Code-Block Syntax Highlighting

Layer / File(s) Summary
Code block view component with language selector
apps/web/src/components/chat/composer/code-block-view.tsx, apps/web/package.json
Added CodeBlockView TipTap node view component with language selector dropdown, language configuration constants, and alias mapping; added @tiptap/extension-code-block-lowlight and lowlight dependencies.
Message input editor lowlight and slash-command setup
apps/web/src/components/chat/composer/message-input.tsx
Integrated lowlight instance, configured CodeBlockLowlight extension with CodeBlockView renderer, enabled slash-command suggestion and extension (previously disabled), and replaced code-block-language bubble menu with inline text-formatting bubble menu.

UI Component Icon & Layout Updates

Layer / File(s) Summary
Text channel icon replacements (Hash → Scroll)
apps/web/src/components/chat/header.tsx, apps/web/src/components/chat/message-list.tsx, apps/web/src/components/sidebar/channel-panel/*
Replaced Hash icon with Scroll across chat header, message-list empty state, sidebar channel-list, and channel-creation dialog; updated lucide-react imports consistently.
DM panel and new-DM dialog simplification
apps/web/src/components/sidebar/dm-panel/*
Removed "Allies" button and navigation logic from DMPanel; simplified NewDMDialog to render only title/description without ally search/selection/creation UI.
Custom select item with tooltip support
packages/ui/src/components/custom-select-item.tsx
Added CustomSelectItem component for rendering select options with optional fixed-position tooltips, used by create-channel dialog to show contextual help.
Settings dialog privacy & safety removal
apps/web/src/components/settings/settings-dialog.tsx
Removed "Privacy & Safety" navigation entry and PrivacySafetySettings render branch; updated lucide imports.
DMs index route placeholder
apps/web/src/routes/_authenticated/dms/index.tsx
Changed DMs index from rendering AlliesPage to displaying an inline DMsIndex placeholder ("Select a conversation to get started").

Landing Page & Download Page Redesign (Lor Branding)

Layer / File(s) Summary
New www components for Lor experience
apps/www/app/components/grain.tsx, apps/www/app/components/reveal.tsx, apps/www/app/components/waitlist.tsx
Added Grain full-viewport noise overlay, Reveal scroll-triggered animation component, and Waitlist email-capture form for new Lor branding; removed ThemeToggle and CopyTerminal.
Root layout and metadata update
apps/www/app/layout.tsx, apps/www/lib/api-client.ts
Updated layout.tsx metadata to use https://lor.chat, added dark ThemeProvider and Grain component; created apiClient export for www waitlist API calls.
Home page complete redesign
apps/www/app/page.tsx
Rewrote from Townhall feature-grid layout to Lor editorial flow: Hero (with Waitlist CTA), Lore (prose), Merlin (typography vignette + Q&A), Journey (3-chapter narrative), Summons (final Waitlist CTA), and simplified footer using Reveal and Waitlist components.
Download page rebrand to Lor
apps/www/app/download/page.tsx, apps/www/README.md
Updated download page metadata, release URLs, platform links, and branding from Townhall to Lor/app.lor.chat; removed www README.md content and preview page.

Design System & Branding Updates

Layer / File(s) Summary
Color palette and theme token updates
packages/ui/src/styles/globals.css
Replaced global CSS custom properties in :root and .dark with new Lor purple-based oklch() palette; added Tailwind theme tokens for --color-merlin, --color-gold, --color-success; updated all surface/brand/utility/semantic/chart/sidebar color mappings.
Serif font addition (Lora)
apps/web/src/styles/fonts.css
Added @font-face for Lora font and introduced --font-serif CSS custom property for serif typography.
Button active state visual feedback
packages/ui/src/components/button.tsx
Added active:scale-[0.97] Tailwind class for subtle press-down feedback.

Supporting Configuration & Package Updates

Layer / File(s) Summary
Package dependency and script updates
apps/web/package.json, package.json
Added @tiptap/extension-code-block-lowlight and lowlight to web dependencies; added dev:www npm script to root.
Auth guard test cleanup
apps/api/src/__tests__/auth-guard.test.ts
Removed test assertions for removed /v1/allies, /v1/blocks, /v1/privacy-settings endpoints; coverage updated to /v1/dms and /v1/notification-settings.

🎯 4 (Complex) | ⏱️ ~60 minutes

🐰 A rabbit hops through the codebase with glee,
Allies and blocks are now history!
Lor rises up with workspace might,
Code blocks shine with syntax light,
The brand reborn in purple gold,
A institutional tale to be told!

Possibly Related PRs

  • BuckyMcYolo/townhall#22: Directly connected at the allies API layer; this PR removes the v1 allies router that was previously added.
  • BuckyMcYolo/townhall#24: Overlaps in blocking-related code paths; this PR removes user blocking system and enforcement that was introduced there.
  • BuckyMcYolo/townhall#17: Related to settings UI; this PR removes "Privacy & Safety" section that was added in that PR.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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