Skip to content

weidai11/userscripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LessWrong Userscripts Workspace

High-performance Tampermonkey userscripts for LessWrong and EA Forum.

🚀 Key Project: LW Power Reader

A fast, context-first reader for LessWrong and the EA Forum, designed to make high-volume reading and thread navigation feel effortless.

  • Chronological Reader Core: Shows comments in strict time order with date-based pagination, so you can read without gaps.
  • Deep Thread Context: Loads missing parents and replies so deep comments still make sense.
  • Post + Comment Power Actions: Inline controls to expand/load post bodies, load all comments, jump between posts, and navigate thread roots.
  • Sticky Header Navigation: Keeps post controls and key metadata visible while scrolling long threads.
  • Keyboard-First Workflow: Hotkeys for post/comment actions, including fallback from hovered comments to parent post actions.
  • AI Integration: Send posts or comment threads to Google AI Studio (g / Shift+G) or Arena.ai Max (m / Shift+M) from both /reader and native LW/EAF post pages, with customizable prompt prefix for AI Studio (synced via reader sync when enabled); results are viewed directly in the opened provider tab.
  • Rich Voting & Reactions: Karma voting on posts/comments, LW comment-only agreement axis, EAF agree/disagree reaction chips (including posts), reaction picker, and inline quote reactions with highlighted quoted text.
  • Forum HTML Compatibility: Treats LW/EAF API HTML (htmlBody, tag preview HTML, htmlBio) as server-sanitized content and renders it directly.
  • Smart Prioritization: Sorts by "most important unread content first" using tree-karma sorting and can apply fully read thread hiding.
  • Personalization: Author preference controls, read tracking, and saved layout/settings in browser storage.
  • Site-wide Entry Point: Accessible from any forum page via an injected "POWER Reader" header link.

Glossary (Power Reader Terms)

  • Trace to root ([t]): Load missing parents and jump to the top-level comment in the thread.
  • Load replies ([r]): Fetch descendants for a comment, even if they are not in the current feed batch.
  • Fully read thread hiding: If a post and all relevant comments are read, the thread is filtered from the current view.
  • Tree-karma sorting: Prioritizes a post/thread by the highest-karma unread item inside it.
  • Implicit read cutoff: Items older than your session start time can be treated as already read.

📥 Installation

  1. Install a userscript manager like Tampermonkey.
  2. Click here to install: Install LW Power Reader

🏗 VCS & Workflow

This repository uses Jujutsu. Use jj for all version control operations.

# Common jj commands
jj status
jj bookmark set main
jj git push

Development Workflow

  1. Install: npm install
  2. Start Dev Server: npm run dev:power-reader (PowerReader) or npm run dev:playground.
  3. Install Loader: Visit http://localhost:5173/ and install the Tampermonkey loader script.
  4. Visit Site: Go to any forum page (e.g. LessWrong). Use the "POWER Reader" link in the header or visit /reader directly.
  5. Edit & Reload: Changes to src/ trigger automatic reloads via HMR.

🛠 Tech Stack

  • Vite + TypeScript + vite-plugin-monkey.
  • GraphQL: Type-safe queries with graphql-codegen (runs automatically on dev/build).
  • Playwright: Robust E2E testing suite (100% mocked by default; see npx playwright test --list for current count).

📜 Documentation & Guides

  • AGENTS.md: AI-friendly guide to architecture, commands, and conventions.
  • TESTING.md: Workflows for running and debugging the test suite.
  • SPEC.md: Detailed feature requirements and UI specifications.
  • GRAPHQL_API.md: Guide to the LessWrong and EA Forum API.
  • NOTES.md: Technical "gotchas" and environment-specific solutions.

User Archive Status

User Archive is live and usable in Power Reader at: https://www.lesswrong.com/archive?username=[username]

For architecture notes and longer-term direction, see ARCH_USER_ARCHIVE.md.

Shipping Today

  • Adaptive cursor ingestion with retry-friendly sync behavior.
  • Offline-first IndexedDB cache plus incremental watermark-based updates.
  • Card, index, and thread modes (thread-full and thread-placeholder).
  • No bottom-of-list "Load More" controls in archive result feeds; rendering uses the active render cap and rerenders.
  • Structured archive search with:
    • Plain terms and quoted phrases.
    • Regex literals (/pattern/flags).
    • Field operators: author:, replyto:, type:, score:, date:, scope:.
  • Search scope across authored-only or authored+context (scope:all) with authored-preferred dedup.
  • URL state sync for query/sort/scope, including canonicalized in-query scope:.
  • Large dataset guard dialog for archives over 10,000 items.

Archive Search Quick Reference

  • alignment - plain term
  • "multi agent" - exact phrase
  • /coordination\\s+failure/i - regex literal
  • author:"wei dai" type:comment
  • score:>20 date:2025-01-01..2025-01-31
  • scope:all replyto:"eliezer"

Next Focus Areas

  • Broader structured-search conformance fixtures and edge-case coverage.
  • Analytics and archive exploration views.
  • Export/snapshot workflows.

🔗 References

CHANGELOG.md | Old Power Reader Docs | Old Source

Firestore Sync Ops

  • Firestore rules: ./firestore.rules
  • Firestore indexes: ./firestore.indexes.json
  • Firebase config: ./firebase.json
  • Deploy rules + indexes:
    • firebase deploy --only firestore:rules,firestore:indexes --project <your-project-id>
  • Emulator integration test:
    • Start emulator: firebase emulators:start --only firestore --project demo-pr-sync
    • Run checks: npm run test:sync-emulator

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages