Skip to content

Latest commit

 

History

History
207 lines (152 loc) · 6.52 KB

File metadata and controls

207 lines (152 loc) · 6.52 KB

Writing Suggestions System

Overview

The Writing Suggestions System helps users overcome the blank page problem by providing curated title suggestions with corresponding placeholder text. This feature is designed to inspire users and provide starting points for their writing.

Features

  • 250 Diverse Suggestions: Carefully curated list of page titles across multiple categories
  • Custom Placeholders: Each suggestion has tailored placeholder text to guide writing
  • Collapsible Banner: Unobtrusive collapsed state that expands on demand
  • Horizontal Scrolling: Three-row carousel layout for efficient browsing
  • Pagination: Load suggestions in batches of 50 for performance
  • One-Click Title Filling: Instantly populates title and placeholder text

Architecture

Components

WritingSuggestionsBanner

Location: app/components/writing/WritingSuggestionsBanner.tsx

Main component that handles the suggestion interface:

  • Collapsible banner with expand/collapse functionality
  • Horizontal scrolling carousel with navigation arrows
  • Batch loading with "Load 50 more" button
  • Three-row layout for optimal space usage

Data Source

Location: app/data/writingSuggestions.ts

Contains the complete dataset of suggestions:

  • 250 curated title suggestions
  • Corresponding placeholder text for each suggestion
  • Helper functions for batch loading
  • Type definitions for suggestion objects

Integration

Page Integration

Location: app/new/page.tsx

The banner is integrated into the page creation flow:

  • Positioned below content editor and above date/location fields
  • Only shown when in editing mode
  • Handles suggestion selection and form population

Data Structure

WritingSuggestion Interface

interface WritingSuggestion {
  title: string;        // The suggested page title
  placeholder: string;  // Custom placeholder text for the editor
}

Example Suggestions

{ title: "Coffee Shops", placeholder: "Write about your favorite coffee shops..." }
{ title: "Travel Destinations", placeholder: "Write about places you want to visit..." }
{ title: "Life Lessons", placeholder: "Document important lessons you've learned..." }

Categories

The 250 suggestions are organized across diverse categories:

Food & Dining (10 suggestions)

  • Coffee Shops, Pizza Places, Breakfast Spots, Food Trucks, etc.

Travel & Places (10 suggestions)

  • Travel Destinations, Hidden Gems, National Parks, City Guides, etc.

Entertainment & Media (10 suggestions)

  • Movies, TV Shows, Books, Podcasts, Music Albums, etc.

Lifestyle & Personal (10 suggestions)

  • Daily Routines, Productivity Tips, Life Lessons, Goals, etc.

Hobbies & Interests (10 suggestions)

  • Photography, Gardening, Crafts, Sports, Fitness, etc.

Technology & Tools (10 suggestions)

  • Apps, Websites, Software, Gadgets, Online Tools, etc.

Shopping & Products (10 suggestions)

  • Products, Brands, Shopping Lists, Gift Ideas, etc.

Learning & Education (10 suggestions)

  • Skills, Courses, Languages, Tutorials, Study Tips, etc.

Health & Wellness (10 suggestions)

  • Healthy Recipes, Workout Routines, Mental Health, etc.

Work & Career (10 suggestions)

  • Career Advice, Job Search, Networking, Skills Development, etc.

Home & Living (10 suggestions)

  • Home Organization, Interior Design, Cleaning Tips, etc.

Relationships & Social (10 suggestions)

  • Friendship, Family, Communication, Social Events, etc.

Creative & Artistic (10 suggestions)

  • Art Projects, Writing, Music, Drawing, Painting, etc.

Nature & Environment (10 suggestions)

  • Wildlife, Weather, Seasons, Outdoor Activities, etc.

Transportation & Vehicles (10 suggestions)

  • Cars, Public Transportation, Bicycles, Walking, etc.

Finance & Money (10 suggestions)

  • Budgeting, Saving Tips, Investments, Financial Goals, etc.

Seasonal & Holidays (10 suggestions)

  • Holiday Traditions, Seasonal Activities, Gift Giving, etc.

Random & Miscellaneous (10 suggestions)

  • Life Hacks, Random Thoughts, Observations, Questions, etc.

Collections & Lists (10 suggestions)

  • Bucket List, Wish List, Favorites, Recommendations, etc.

User Experience

Collapsed State

  • Shows "Not sure what to write about?" with chevron down icon
  • Styled as dashed border card to indicate interactivity
  • Hover effect provides visual feedback

Expanded State

  • Changes title to "Here are some ideas..."
  • Shows X button for collapsing
  • Displays three rows of suggestion pills
  • Horizontal scrolling with navigation arrows
  • "Load 50 more" button when reaching end of current batch

Suggestion Selection

  • Clicking any suggestion pill:
    1. Fills the page title field
    2. Updates the content editor placeholder text
    3. Automatically collapses the banner
    4. Clears any existing title validation errors

Performance Considerations

Batch Loading

  • Initial load: First 50 suggestions
  • Subsequent loads: 50 suggestions per batch
  • Total available: 250 suggestions
  • Prevents UI lag with large datasets

Scroll Optimization

  • Hidden scrollbars for clean appearance
  • Smooth scrolling behavior
  • Arrow navigation for accessibility
  • Responsive to container resize

Accessibility

Keyboard Navigation

  • All buttons are keyboard accessible
  • Proper focus management
  • Screen reader friendly labels

Visual Design

  • High contrast button styling
  • Clear visual hierarchy
  • Responsive layout for mobile devices

Future Enhancements

Potential Improvements

  1. Personalization: Learn from user's previous page topics
  2. Search: Allow users to search within suggestions
  3. Categories: Filter suggestions by category
  4. Custom Suggestions: Allow users to add their own suggestions
  5. Analytics: Track which suggestions are most popular
  6. Seasonal: Rotate suggestions based on time of year

Technical Considerations

  • Consider moving suggestions to database for dynamic updates
  • Add suggestion analytics and usage tracking
  • Implement suggestion rating system
  • Add localization support for different languages

Maintenance

Adding New Suggestions

  1. Edit app/data/writingSuggestions.ts
  2. Add new suggestion objects with title and placeholder
  3. Ensure suggestions are appropriate and diverse
  4. Update total count in documentation

Modifying Categories

  • Maintain balance across categories
  • Ensure suggestions appeal to broad audience
  • Keep titles concise (1-3 words typically)
  • Make placeholders specific and inspiring

Last Updated: August 16, 2025
Version: 1.0
Status: Production Ready