diff --git a/plans/sotce-net-ask-feature.md b/plans/sotce-net-ask-feature.md deleted file mode 100644 index 7cfbaf17c..000000000 --- a/plans/sotce-net-ask-feature.md +++ /dev/null @@ -1,437 +0,0 @@ -# Sotce Net "Ask" Feature - Technical Plan - -## Overview -Add an "ask" button next to "chat" that allows visitors to submit questions. Questions create a new content type that can be answered via "pages" with a special design to show Q&A relationships. Two display modes: separate feeds or intermixed. - ---- - -## Current Architecture Summary - -### File Structure -- **Main file**: [system/netlify/functions/sotce-net.mjs](../system/netlify/functions/sotce-net.mjs) (~5500 lines) - - Single Netlify function with internal router - - Contains all HTML/CSS/JS inline as template literals - - Handles authentication, Stripe subscriptions, pages, chat, touches - -- **Constants**: [system/backend/sotce-net-constants.mjs](../system/backend/sotce-net-constants.mjs) - - Stripe keys, price/product IDs - -### Existing Data Models (MongoDB Collections) -| Collection | Purpose | Key Fields | -|------------|---------|------------| -| `sotce-pages` | Diary entries | `_id`, `user`, `words`, `when`, `state` (draft/published/crumpled) | -| `sotce-touches` | Page interactions | `user`, `page`, `when` | -| `chat-sotce` | Chat messages | `user`, `text`, `when` | -| `@handles` | User handles | `_id` (sub), `handle` | - -### Current UI Components -| Component | Location | Access Level | -|-----------|----------|--------------| -| Gate (login/signup) | splash screen | everyone | -| Cookie menu | top-right | logged-in | -| Chat button | top bar | subscribers + admins | -| Write a page | top bar | admins only | -| Page feed | binding | subscribers + admins | - -### Key Functions (Client-side) -- `gate(status, user, subscription)` — renders login/subscription UI -- `garden(subscription, user, showGate)` — renders the main subscriber view -- `userRequest(method, endpoint, body)` — authenticated API calls -- `veil()` / `unveil()` — loading states - -### Key Functions (Server-side) -- `subscribed(user)` — checks Stripe subscription status -- `authorize(headers, tenant)` — validates auth token -- `hasAdmin(user, tenant)` — checks admin privileges -- `handleFor(sub, tenant)` — gets user handle - ---- - -## New "Ask" Feature Design - -### 1. New Data Model: `sotce-asks` - -```javascript -{ - _id: ObjectId, - user: String, // Auth0 sub of asker - question: String, // The question text (max ~500 chars) - when: Date, // Submission timestamp - state: String, // "pending" | "answered" | "archived" - answeredBy: ObjectId, // Reference to sotce-pages._id (if answered) - answeredWhen: Date, // When the answer was published - visibility: String // "private" (default) | "public" (after answered) -} -``` - -### 2. Extended Page Model: `sotce-pages` - -Add optional fields for answer pages: -```javascript -{ - // ...existing fields... - answerTo: ObjectId, // Reference to sotce-asks._id (if this is an answer) - pageType: String // "diary" (default) | "answer" -} -``` - -### 3. New API Endpoints - -| Endpoint | Method | Auth | Purpose | -|----------|--------|------|---------| -| `/ask` | POST | subscriber | Submit a new question | -| `/asks` | GET | subscriber | List user's own questions | -| `/asks/pending` | GET | admin | List all unanswered questions | -| `/ask/:id` | DELETE | subscriber/admin | Remove own question | -| `/answer` | POST | admin | Create an answer page linked to a question | - -### 4. UI Components - -#### A. "Ask" Button (next to "Chat") -``` -┌────────────────────────────────────────┐ -│ [chat] [ask] 🍪 │ -└────────────────────────────────────────┘ -``` - -- Position: `#top-bar`, after `#chat-button` -- Style: Same as chat button -- Visibility: All subscribers (not just admins) - -#### B. Ask Form Modal -``` -┌─────────────────────────────────────────┐ -│ Ask @amelia │ -│ ┌───────────────────────────────────┐ │ -│ │ │ │ -│ │ [Your question here...] │ │ -│ │ │ │ -│ └───────────────────────────────────┘ │ -│ chars: 0/500 │ -│ │ -│ [cancel] [submit] │ -└─────────────────────────────────────────┘ -``` - -#### C. My Questions View (for askers) -``` -┌─────────────────────────────────────────┐ -│ My Questions [x] │ -├─────────────────────────────────────────┤ -│ ⏳ "What inspires you most?" │ -│ Asked Dec 15, 2025 │ -│ ───────────────────────────────────── │ -│ ✓ "How do you start your mornings?" │ -│ Asked Nov 20, 2025 │ -│ → Answered: View Page #42 │ -└─────────────────────────────────────────┘ -``` - -#### D. Pending Questions View (for admin) -- Shown in write-a-page flow or separate panel -- Can select a question to answer - -#### E. Answer Page Design (special styling) -``` -┌─────────────────────────────────────────┐ -│ │ -│ ❝ What inspires you most? ❞ │ -│ — @username │ -│ │ -│ ───────────────────────────────────── │ -│ │ -│ [Answer content here, styled as │ -│ a regular page but with Q context] │ -│ │ -│ ❦ 42 ❧ │ -└─────────────────────────────────────────┘ -``` - -### 5. Feed Display Options - -#### Option A: Intermixed Feed (default) -- Pages and answered questions appear chronologically -- Answer pages show question context at top - -#### Option B: Separate Feeds (toggle) -``` -[all pages] [Q&A only] [diary only] -``` - ---- - -## Implementation Phases - -### Phase 1: Backend Foundation -1. Create `sotce-asks` collection with indexes -2. Add `/ask` POST endpoint -3. Add `/asks` GET endpoint (user's questions) -4. Add `/asks/pending` GET endpoint (admin) - -### Phase 2: Ask UI -1. Add "ask" button to top bar -2. Create ask form modal (similar to editor styling) -3. Add "my questions" panel accessible from gate - -### Phase 3: Answer Flow -1. Modify `/write-a-page` to accept `answerTo` parameter -2. Add question selector in editor for admins -3. Create answer page special styling - -### Phase 4: Feed Integration -1. Modify page retrieval to include Q&A metadata -2. Add answer page rendering with question context -3. Optional: Add feed filter toggles - ---- - -## CSS Additions (to existing `
Stretched Paintings on Canvas & Linen
- +stretched paintings by Jeffrey Alan Scudder
+- A painting practice exploring stretched canvas and linen as substrate. - Each work exists as a physical object—a system unto itself. -
+