vrg-archive/src/thread-browser.md
hiina c5e7bf307a implement the thing
seems to work pretty okay.
2025-04-11 17:13:08 -06:00

3.7 KiB

title toc sql
Thread Browser false
posts
./data/vrgarchive.parquet

Thread Browser

Browser posts in old threads in a somewhat faithful format. It takes a bit to load and this framework is bad about indicating loading progress, so wait around if you don't see anything.

There are no thumbnails or full images (yet).

select
first(thread_num) as thread_num,
any_value(thread_title) as thread_title,
first(epoch_ms(timestamp * 1000)) as thread_time,
count(*) as num_comments
from posts
group by thread_num;
const search = view(
  Inputs.search(threads,
    {label: "filter threads: ",
      placeholder: "filter",
      filter: (query) => (c) => c.thread_title.toLowerCase().includes(query.toLowerCase())}));

Click the radio button on the left of each column to select a thread to display.

const thread = view(Inputs.table(search, {
  format: {
    "thread_time": (v) => new Date(v).toLocaleString()
  },
  value: threads[0], multiple: false, width: {thread_title: 300, thread_time: 200}}));
import {Post} from "./components/post.js";

let rows = thread == null ? []: await sql`select * from posts where thread_num = ${thread.thread_num}`;

const posts = [...rows];

let b4k_url = `https://arch.b4k.dev/vg/post/${thread.thread_num}/`;

${posts.length} posts.

${html<a href=${b4k_url} target="_blank">View on b4k archive (for threads after ~#613)</a>}.

display(posts.map(p => <Post postData={p} />))