Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions diagnostic/build-bf2147ac-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"generated_at": "2026-07-01T07:19:07.148091+00:00",
"commit": "bf2147ac",
"diagnostic_logd": [
"diagnostic\\build-bf2147ac-part001.logd",
"diagnostic\\build-bf2147ac-part002.logd"
],
"chunked": true,
"chunk_size_bytes": 41943040,
"password": "95c64f76adfb29120dc8",
"decrypt_command": "encryptly unpack diagnostic\\build-bf2147ac.logd <outdir> --password 95c64f76adfb29120dc8",
"total_modules": 1,
"passed": 1,
"failed": 0,
"modules": [
{
"name": "compliance",
"status": "PASS",
"elapsed_seconds": 1.356,
"artifact": "D:\\code\\\u8d5a\u94b1\\bounty-work\\TentOfTrials-repo\\compliance\\build"
}
],
"module_timings": [
{
"module": "compliance",
"language": "Java",
"command": [
"javac",
"-d",
"build",
"ComplianceAuditor.java"
],
"started_at": "2026-07-01T07:14:24.764120+00:00",
"finished_at": "2026-07-01T07:14:26.120512+00:00",
"elapsed_seconds": 1.356,
"exit_code": 0,
"status": "PASS"
}
],
"pr_note": "Include this metadata and diagnostic\\build-bf2147ac-part001.logd, diagnostic\\build-bf2147ac-part002.logd in your PR. Maintainers may ask you to remove these diagnostic artifacts before merging."
}
11 changes: 11 additions & 0 deletions frontend/docs/react-functional-components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# React components in this app

All UI under `frontend/src/**/*.tsx` uses functional components with hooks.

There are no `React.Component` or `class ... extends Component` patterns in the frontend tree. Non-React TypeScript classes (for example keyword classifiers under `frontend/src/ai/`) are plain domain objects and are intentionally excluded from this rule.

When adding UI:

- Prefer function components with `useState`, `useEffect`, and `useCallback`.
- Keep side effects out of render paths.
- Run `python -m unittest tools.tests.test_functional_react_components -v` before opening a PR.
33 changes: 33 additions & 0 deletions tools/tests/test_functional_react_components.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Ensure React UI files remain functional components."""

from __future__ import annotations

import re
import unittest
from pathlib import Path

ROOT = Path(__file__).resolve().parents[2]
FRONTEND_SRC = ROOT / "frontend" / "src"

CLASS_COMPONENT_PATTERNS = (
re.compile(r"extends\s+React\.Component"),
re.compile(r"extends\s+Component\b"),
re.compile(r"class\s+\w+\s+extends\s+PureComponent"),
)


class FunctionalReactComponentTests(unittest.TestCase):
def test_no_class_components_in_frontend_src(self) -> None:
offenders: list[str] = []
for path in FRONTEND_SRC.rglob("*"):
if path.suffix not in {".tsx", ".jsx"}:
continue
source = path.read_text(encoding="utf-8")
for pattern in CLASS_COMPONENT_PATTERNS:
if pattern.search(source):
offenders.append(str(path.relative_to(ROOT)))
self.assertEqual(offenders, [])


if __name__ == "__main__":
unittest.main()