r/reactjs • • 3d ago

Show /r/reactjs I let AI agents write my app's React UI, with strict rules. React Doctor gave it 100/100

https://thermi.app/?v=2

I'm building thermi, a small always-on-top hardware monitor for Windows and Linux (temps, fans, FPS). The overlay is C#, but the settings app is React + Fluent UI, running in WebView2 on Windows and WebKitGTK on Linux: about 14k lines and 70 components. Here it is in action: https://github.com/claudiopi/thermi/blob/main/docs/images/gestures-settings.gif

AI agents wrote most of it, so I set a few rules early on. React holds no business logic: every decision comes from C# through a typed bridge. The tests run against recorded answers from that bridge. And any warning fails the build.

I was curious how it would hold up, so I ran React Doctor: 100/100, zero issues. Pretty happy with that, and always keen to learn, so if you spot something worth improving, I'm all ears.

Repo: https://github.com/claudiopi/thermi

0 Upvotes

6 comments sorted by

2

u/Kamensky124 2d ago

Recorded bridge answers are the part I'd poke at. Recordings make UI tests pass in a world where the C# side may have stopped agreeing weeks ago, so the suite stays green while the real app breaks at the seam. React Doctor checking the React side of the wall is nice, but the failure mode with agent-written code is rarely inside one file, it's the contract between the two halves drifting while every test replays old tape.

Worth checking how recordings get refreshed: a schema check on the C# side that fails the build when a bridge answer changes shape turns drift into a loud error instead of a manual re-record whenever a test fails for a reason that looks real.

Does anything on the C# side version those bridge answers today, or is the contract only enforced by whatever the recorded fixtures happen to contain?

1

u/claudio_pi 2d ago

That was exactly my worry too. Two things guard the seam. The bridge's TypeScript types are generated from the C# at build time, so a shape change breaks the page's type check. And a C# test replays every recorded call through the real bridge in CI and fails when any answer differs; a page test asking for something not recorded fails too. So drift is a red build, never a silent green.

1

u/Independent-Bonus529 2d ago

I really like the idea of testing against recorded bridge responses. How do you keep those recordings in sync when the C# side changes? Also, are you enforcing the architectural rules through CI or just agent instructions?

1

u/claudio_pi 2d ago

Thanks! A C# test replays every recorded call through the real bridge in CI and fails if any answer changed, so a stale recording can't stay green. Re-recording is one script. And yes, CI enforces the rules: every rule in the repo's AGENTS.md has a check next to it (repo-rule tests, analyzers, banned APIs). A rule without a check gets forgotten.

1

u/Honey-Entire 2d ago

At least you admitted you produced AI slop. I commend you OP

1

u/claudio_pi 2d ago

Fair enough 🙂 The code's all open, so if anything in it looks like slop, I'd genuinely like to know what you'd change.