417 Commits
Author SHA1 Message Date
Tommaso Casaburi 1a33f7dc88 chore(agents): add a machine-wide Playwright browser resource budget
Playwright disables normal background throttling, so a hidden 5chan page keeps
doing P2P and rendering work after a check finishes. Agents verifying in
parallel across worktrees stacked whole browser engines on one machine.

Add scripts/pw-session.sh, a wrapper that permits one active Playwright browser
at a time and records who holds it:

- The lock is machine-wide, not per-repository, because the contended resource
  is RAM and CPU. Every worktree and checkout shares one slot.
- Acquisition is an atomic mkdir. Stale locks clear themselves: `open` reclaims
  any slot whose recorded browser is no longer `status: open` in
  `playwright-cli list --all`, so an interrupted workflow cannot strand the
  budget. When that list cannot be read the lock is left alone, so a broken CLI
  never silently disables the budget.
- `open` exits 75 when the slot is busy; `--wait[=SECONDS]` blocks instead.
- `close` always stops the browser, even when the lock was already lost, and
  never releases a slot held by a different session.
- `status` reports the holder and whether its browser is still alive.

Agent policy now runs browser engines and profiler batches sequentially, uses
Chrome/Blink during iteration and the full engine matrix only for final
verification, and never uses `close-all` or `kill-all` while other agents may
own sessions.

Covered by scripts/pw-session.test.js.
2026-08-01 19:21:01 +02:00
Tommaso CasaburiandGitHub da03239bb2 perf: reduce browsing rerenders and startup cost (#1189)
* chore(profiling): collect serializable react-scan reports

* perf(routing): rerender only when directory winner changes

* perf(zustand): remove shallow warning hot path

* perf(state): narrow directory lifecycle updates

* perf(home): avoid redundant stats render work

* perf(posts): isolate live loading subscriptions

* perf(chrome): skip unchanged shell rerenders

* fix(profiling): drop unsupported render metric

* perf(feeds): skip unchanged loading state renders

* perf(home): stop resolved stats collector renders

* chore(agent run): record rerender verification

* perf(home): defer stats requests until metadata resolves

* perf(startup): load protocol modules on demand

* chore(agent run): record acquisition and startup profiles
2026-07-30 00:29:12 +07:00
Tommaso Casaburi 27cc4767c6 fix(transfer): link trash transfer success to new post 2026-07-28 15:01:25 +07:00
Tommaso Casaburi 35a574362b feat(banners): add banner-6 2026-07-25 13:53:03 +07:00
Tommaso Casaburi 047bb1d5ab chore(skills): drop GitHub issue/project finalization from PR workflow skills
GitHub Projects are no longer used in this repo. Remove issue/project
finalization from review-and-merge-pr and the project-board step from
make-closed-issue in all three toolchain mirrors, record the surprise
in known-surprises.md, and regenerate llms files.
2026-07-23 18:59:30 +07:00
Tommaso Casaburi 192007d632 feat(footer): add Bitsocial attribution to site legal meta
Show a powered-by Bitsocial link with logo in the footer license line and add translations for the new copy.
2026-07-20 16:33:44 +07:00
Tommaso Casaburi 7ff9c19331 chore(ai workflow): add Ponytail simplicity pass 2026-07-10 15:30:55 +07:00
Tommaso Casaburi 5456ba2fb8 chore(codex agents): inherit parent model settings 2026-07-10 14:45:05 +07:00
Tommaso Casaburi ece58da78b chore(deps): drop @typescript/native-preview in favor of typescript 7 native tsc
TypeScript 7's own tsc is the Go-native compiler, so the separate tsgo
binary from the dev-preview package is redundant. yarn type-check now
runs tsc --noEmit. Bump tsconfig target to ES2018 and add types: [node]
to fix the pre-existing NodeJS namespace, global, and /s regex flag
errors that stable tsc reports but tsgo did not.
2026-07-09 15:17:35 +07:00
Tommaso Casaburi 9dfd638b71 fix(mod queue): restrict trash action to trash board 2026-07-04 23:48:43 +07:00
Tommaso Casaburi 2088c4b50d docs(agent playbooks): fix stale CI references and index committed skills
Corrects the react-doctor PR-check command and workflow filename, marks the
superseded hooks-tarball surprises now that bitsocial-react-hooks comes from
npm, rewrites hooks-setup.md around the real per-harness entry points and drops
its drifted inline script copies, points the Task Router translations row at
the translate skill, and adds a committed skills/subagents index so agents can
discover the tooling that already exists.
2026-07-03 13:58:38 +07:00
Tommaso CasaburiandGitHub b4a6f0a65a feat(mod queue): transfer posts across boards (#1182)
* feat(mod queue): transfer posts across boards

* fix(mod queue): polish transfer modal and reason

* fix(mod queue): recover abandoned transfer challenges

* fix(mod queue): address transfer review feedback

* fix(mod queue): hide transfer for unavailable posts

* fix(mod queue): prevent repeat transfer submit

* fix(mod queue): sync transfer state with queue actions

* fix(mod queue): omit transfer temp index

* fix(mod queue): harden transfer failure states

* fix(mod queue): keep hidden transfer lock

* fix(mod queue): release hidden transfer lock
2026-07-02 14:52:06 +07:00
Tommaso Casaburi 3c3236c0bd docs(product): document the no-emoji-affordances policy and rationale
Explain why emoji render as raw Unicode but get no picker, shortcode/emote system, or Twemoji styling: imageboard expressive norms (greentext, reaction images, kaomoji/ASCII art), emoji as an outsider marker, and structural-not-cosmetic differentiation from 4chan. Add the matching DESIGN.md guardrail and regenerate the LLM index.
2026-06-29 15:34:08 +07:00
Tommaso Casaburi 69ba4ace7a fix(post form): respect reply link rules 2026-06-29 09:55:55 +07:00
Tommaso CasaburiandGitHub 7258e21f6f fix(markdown): render code tags on code-enabled boards
Enable [code] tag parsing for both /g/ and /q/ rendering paths, show the post-form hint on code-enabled boards, and preserve whitespace in BBCode previews.
2026-06-28 23:37:59 +07:00
Tommaso Casaburi 6b2b85f51e fix(post-form): enforce required post link board rules
Validate link and media requirements from community/directory features in
post and reply forms, with shared helpers and translated alert messages.
2026-06-28 15:44:36 +07:00
Tommaso Casaburi f213d41296 fix(favicon): show dedicated icon on 404 pages
Add favicon-404.ico and switch tab favicon on not-found routes while
keeping static app pages and larger crawler icons unchanged.
2026-06-27 17:38:55 +07:00
Tommaso Casaburi 292d3e35a4 fix(footer): rename contact link to contributors 2026-06-27 16:27:58 +07:00
Tommaso CasaburiandGitHub c6d048ecd7 Review settings upgrades before applying defaults
Adds a review modal for settings upgrades, keeps the settings banner reviewable, and preserves explicit router settings during account import.
2026-06-26 17:14:31 +07:00
Tommaso Casaburi 802aa2a447 docs: conform DESIGN.md to design.md spec
Reorder sections to canonical Overview/Colors/Typography/Layout/
Elevation & Depth/Shapes/Components/Do's and Don'ts, drop heading
numbers and the H1 title, add Layout and Shapes sections, and add
version: alpha. Regenerate public/llms*.txt.
2026-06-26 16:25:50 +07:00
Tommaso CasaburiandGitHub 371de88e22 chore(architecture): finish refactor audit
Merge the architecture audit refactors and follow-up UX fixes: remove release notes from generated LLM context, keep author edit controls delete-only, stabilize board refresh rendering, and address review feedback for role loading, refresh holds, moderation actions, and P2P stats polling.
2026-06-23 18:48:47 +07:00
Tommaso Casaburi de06d5d4bc chore(release): v0.9.3 2026-06-17 23:13:33 +07:00
Tommaso Casaburi 1278cf42c0 fix(pubsub): restore browser pure p2p publishing 2026-06-17 23:09:39 +07:00
Tommaso Casaburi f7771d33dd chore(release): v0.9.3 2026-06-16 22:51:09 +07:00
Tommaso Casaburi 35776737f2 fix(release): align blotter and release copy with LaTeX in /sci/
Update v0.9.2 blotter message and release one-liner to describe LaTeX
in /sci/ instead of generic scientific math preview wording.
2026-06-14 16:21:57 +07:00
Tommaso CasaburiandGitHub 85b782e934 feat(electron): sign and notarize mac release builds (#1171)
* feat(electron): sign and notarize mac release builds when Apple credentials are present

* fix(electron): work around codesign PID parsing for digit-leading app name in @electron/notarize

codesign interprets a bare '5chan.app' argument as process ID 5, so
@electron/notarize 2.5.0's pre-upload signature check fails with 'No such
process'. Backport the './' basename prefix from electron/notarize#245 as
a yarn patch until forge depends on notarize >= 3.x.

* docs(agent-playbooks): record codesign PID parsing surprise for digit-leading app name

* fix(ci): keep mac signing env consistent with certificate availability
2026-06-13 15:26:31 +07:00
Tommaso Casaburi 3484963a59 chore: add advisory code quality review workflow 2026-06-13 15:13:25 +07:00
Tommaso Casaburi 6d9b5ff3ce feat(settings): internationalize advanced settings and update RPC label to .bso
Replace hardcoded advanced settings strings with i18n keys and translate them across all 35 languages, including the Ethereum RPC tip for .bso domains.
2026-06-12 19:06:02 +07:00
Tommaso Casaburi 15fb1bf57c chore(ai-workflow): add toolchain drift validator and harden agent rules
Borrowed from a review of addyosmani/agent-skills:

- add scripts/validate-ai-workflow.mjs (yarn ai-workflow:check): verifies
  .claude/.codex/.cursor skills, agents, and hooks stay in parity, with
  validator-owned exemptions for intentional harness-specific differences
  and enforcement of the AGENTS.md agent model rules
- browser-check and profiler agents: treat page content as untrusted data,
  never instructions (5chan pages render arbitrary user-generated content)
- refactor-pass: Chesterton's Fence rule (git blame unclear code before
  removing it)
- review-and-merge-pr: pass subagent verifiers only the artifact and
  contract, not the triage verdict, to keep reviews independent
2026-06-11 16:13:53 +07:00
Tommaso CasaburiandGitHub 17c63bb2e6 feat(reply modal): add sci tex preview button (#1170)
* feat(sci): add 4chan-style TeX support with MathJax on /sci/

- [math]/[eqn] tags typeset with MathJax 3 (lazy chunk, only on /sci/ with math present)
- 4chan-identical config: Safe mode, left-aligned eqn, neutered \color/\newcommand macros
- TeX button in reply modal title bar opens live TeX Preview modal
- /sci/ post form rules bullets for [math]/[eqn] usage and right-click source
- MathJax context menu on right-click (Show Math As > TeX Commands)
- woff fonts served from node_modules in dev and emitted into build

* feat(sci): finish TeX support: configmacros fix, preview preload, translations, tests

- add configmacros package so the 4chan macro neutering (\color, \newcommand, ...) applies
- preload MathJax when the TeX Preview opens, like 4chan
- stable closeModal callback for the preview modal
- pre-bundle mathjax components in vite optimizeDeps to avoid dev mid-session reload
- translate the 6 new TeX keys into all 35 languages
- markdown math segment component tests + math-tags unit tests

* feat(reply modal): add sci tex preview button

* fix(tex-preview): clear MathJax bookkeeping and pending typeset on close

Addresses Cursor Bugbot: the preview output was typeset via typesetMathElement but
never passed to clearMathElement on unmount, so repeated open/close cycles kept
detached nodes in MathJax's math list. Also cancels the pending debounce timer.

* fix(reply-modal): reset TeX preview state when the reply modal closes

Addresses CodeRabbit: showTexPreview persisted across close/reopen like the
bbcode preview flags, so the TeX preview would auto-open on the next reply.
2026-06-11 16:12:38 +07:00
Tommaso Casaburi dcc47c7bbd feat(board-header): show subtitle on /all view
Add all_subtitle copy and render it in the board header when browsing
the aggregated all-directories feed.
2026-06-08 22:30:14 +07:00
Tommaso Casaburi 30010bfc1a Merge branch 'codex/feature/submit-board-button' 2026-06-07 22:47:46 +07:00
Tommaso Casaburi 04af198140 feat(directory): add submit board link 2026-06-07 22:47:09 +07:00
Tommaso Casaburi 28c762e131 docs(readme): document local browser daemon 2026-06-07 22:08:20 +07:00
Tommaso Casaburi 404a464310 feat: use s.5chan.app share links and remove report menu items
Copy share links as path-based s.5chan.app URLs so the share server can render social previews, rename the menu label, remove the stub report action, and update the FAQ.
2026-06-06 19:06:04 +07:00
Tommaso CasaburiandGitHub 0493492f55 fix(react-doctor): correct test exclusion + React-Compiler lint policy + state-sync fix (#1155)
* fix(react-doctor): correctly exclude test files from scoring

The intended test-file ignore in react-doctor.config.json was never
applied: react-doctor's config precedence reads the "reactDoctor" key
in package.json (which had no ignore), shadowing the config file. On
top of that, react-doctor 0.4.0's ignore.files matcher is broken — any
non-empty value collapses scan scope and drops real product files, not
just tests.

Consolidate to a single canonical doctor.config.json using
ignore.overrides (which works correctly): only test files are excluded
while all product code is still scored. Remove the shadowing
package.json key and the dead react-doctor.config.json.

Product-code baseline is 55 (92 errors, 515 warnings, 118 files).

* chore(react-doctor): add long-running task tracking for score effort

* refactor(react): remove compiler-redundant memoization in verified files

Delete manual useMemo/useCallback/memo that the React Compiler already
handles, in 7 files validated to be behavior-preserving (factories are
pure functions of compiler-trackable reactive inputs). Kept memos whose
factories read external mutable DOM/theme state with load-bearing deps
(e.g. use-reply-height-estimates metrics). Also hoists a regex and reads
a localStorage value once.

Note: this is code-quality cleanup; react-doctor's score is error-
weighted, so warning cleanup like this does not move the score. See
docs/agent-runs/react-doctor-score/progress.md.

* fix(react-doctor): adopt React-Compiler lint policy + fix one state-sync bug

react-doctor's score is dominated by React-Compiler optimizability
diagnostics that flag intentional patterns (the latest-ref idiom) and
current compiler limitations (try/finally, throw-in-try/catch the
compiler can't lower yet), not bugs. Rewriting that working code to
satisfy them would degrade it.

- Replace doctor.config.json with a documented doctor.config.jsonc that
  does not enforce the react-hooks-js (React Compiler) rules or
  react-compiler-no-manual-memoization. All real code-quality, a11y, and
  performance rules stay enforced.
- Fix one genuine state-sync bug: use-now-seconds refreshed 'now' via a
  synchronous setState inside an effect (an extra render with a stale
  value); move it to a render-time prev-prop comparison (React's
  adjust-during-render pattern), behavior-equivalent.

Score 54 (broken config) -> 63. type-check/lint/1051 tests pass; browser
smoke confirms timestamps render with no re-render regression. The
remaining no-adjust-state-on-prop-change diagnostics are real bugs but
entangled with legitimate side effects (navigate/ref-cancel/async) in
critical flows; left for careful follow-up.

* chore(react-doctor): remove the vanity score badge, keep PR-diff review

The single 0-100 react-doctor score mostly reflects React-Compiler
optimizability and isn't a meaningful health grade to display (see
docs/agent-runs/react-doctor-score). Remove the README badge and its now-
dead generation infra (CI write/upload/publish steps + the
write-react-doctor-badge.mjs script + doctor:badge package script).

Kept: react-doctor's actual value -- the PR step that runs
'yarn doctor --diff <base> --annotations' on pull requests touching React
files, surfacing newly-introduced issues inline. Coverage badge untouched.

* docs(react-doctor): document why the score is not a target to chase

Record the reasoning so future agents/contributors don't re-attempt to
grind the react-doctor score: it overwhelmingly reflects React-Compiler
optimizability (most 'errors' flag intentional patterns and current
compiler limitations, not bugs) and saturates on the fraction of clean
files, so ~63 is the honest ceiling and 90 only comes from disabling the
linter.

- Add a known-surprises entry with the full reasoning + mitigation.
- Reframe the AGENTS.md react-doctor verification line: it's a PR-diff
  reviewer for newly-introduced issues, not an aggregate score to raise.
2026-06-05 22:21:30 +07:00
Tommaso Casaburi 1edd46eb84 docs: clarify large artifact context tooling 2026-06-05 18:40:37 +07:00
Tommaso Casaburi 0f6d74592e fix(flags): label Tor country flag 2026-06-04 17:18:35 +07:00
Tommaso Casaburi be2b774382 fix(mod queue): show pending approval reasons directly 2026-06-03 18:53:11 +07:00
Tommaso Casaburi 95f3a54b9d fix(post form): reject non-media file links 2026-06-03 17:10:37 +07:00
Tommaso Casaburi d357514397 feat(home stats): load stats progressively 2026-06-03 14:47:51 +07:00
Tommaso Casaburi 0a601c9392 fix(post-form): auto-convert YouTube links to thumbnail URLs
Add a countdown notice and shared hook to replace YouTube watch links
with img.youtube.com thumbnails in post and reply forms, with i18n copy.
2026-06-02 14:59:14 +07:00
Tommaso Casaburi 75c805c822 fix(post options): link sage warning to FAQ 2026-06-02 12:16:22 +07:00
Tommaso CasaburiandGitHub 829b672053 fix(embed): restore youtube thumbnails and file-row labels (#1148)
* fix(comment-content): render reason text as comment content

* fix(post-form): use native browser styling for flash tag select

Exclude the flash tag dropdown from themed post-form select styling so it
renders with the browser's default select appearance, matching the flag selector.

* fix(p2p-stats): show peer flags for DNS6 relay hostnames

Extract embedded IPv6 addresses from dns6 multiaddrs so geo lookup and country flags work for relay peers that publish IPv6 via DNS hostnames.

* fix(flags): hide geolocation-only selectors on /int/ and /sp/

Country-only boards auto-publish geographic location flags without
showing a flag dropdown, matching existing /bant/ behavior.

* fix(embed): restore youtube thumbnails and file-row labels

Restore thumbnail-first previews for YouTube embeds in post media and markdown hover.
Desktop posts show File with the thumbnail image URL and a youtube video type label.

* fix(embed): address youtube thumbnail review feedback

Translate the youtube video label, handle mobile/music YouTube hosts as standard YouTube URLs, keep affected mocks current, and cap default Vitest workers to reduce local CPU spikes.
2026-06-01 12:57:17 +07:00
Tommaso Casaburi f3494cc6bd merge: add playwright-cli low-spec throttling workflow 2026-05-30 17:29:35 +07:00
Tommaso Casaburi 711c97d834 chore(dev): add playwright-cli low-spec throttling workflow
Add pw-throttle.sh and a verification playbook so agents can stress-test UI
on throttled Chromium sessions before claiming perf-sensitive changes feel fast.
2026-05-30 17:29:30 +07:00
Tommaso Casaburi e8002727d4 docs(ai workflow): prefer local codegraph context 2026-05-30 16:23:38 +07:00
Tommaso CasaburiandGitHub 9b3a95dd95 feat(flash board): add SWF posting support (#1145) 2026-05-30 16:07:41 +07:00
Tommaso CasaburiandGitHub 56894700c1 feat(oekaki): add drawing flow for /i/ (#1144)
* feat(oekaki): add drawing flow for /i/

* fix(oekaki): address review feedback

* fix(oekaki): reset Tegaki edit sessions

* fix(oekaki): block drawing during export

* fix(oekaki): destroy Tegaki on preload errors

* fix(oekaki): preserve drawing on export failure

* fix(oekaki): unlock controls after export failure
2026-05-30 15:06:47 +07:00
Tommaso CasaburiandGitHub e082c7b428 fix(react): address Doctor findings (#1143)
Accessibility/semantics pass aligned with React Doctor: role-based spans/divs become real buttons, role=status becomes <output>, modals use native <dialog>, author/peer flags render as <img>, and embed/challenge iframes are sandboxed. Includes review follow-ups: correct button chrome/centering/themed dialog colors and focus rings, the missing aria-label i18n keys (all languages), the Yandex image-search URL, clearer .bso setup steps, a keyboard-accessible image-search dropdown, and removal of the post-edit ('comment edited') display (mod edits unchanged).
2026-05-29 17:09:07 +07:00