Typescript and Gemini evil mode
2025-08-10 18:17:53 +01:00 by Mark Smith
Last night‘s late night note turned out to not only be a great description of what had just happened, but be very prescient as to what was going to happen yet again.
I sat down today to finally make a start at the thing I‘ve been trying so hard to get to for the past few days, and I thought to do a quick review of the codebase. Wouldn't you know it, Gemini unearthed another inconsistency, related to a modal component that apparently used an "old style" of modal. Well, it was Gemini that recommended this now "old style" a few weeks ago. Would have been a lot easier if it had just recommended the correct way in the first place.
And you know what, yesterday‘s 24 hour refactor of the frontend router to use a "modern" style of React routing, was also a product of Gemini‘s advice to implement the original "old style" routing just a week before that. I‘m starting to see a pattern here.
Oh and by the way, all day today Gemini is back in I will ignore everything you say mode, then apologise for getting it wrong, and then do the exact same thing again, literally in the very next paragraph. It also went through a touch of secretly creating a file, then saying oh look I just noticed that this file exists, that means our next best thing to do is this huge and really dangerous refactoring.
I‘d love to say that Typescript was making this a whole lot better, but actually even Typescript seems to have been co-opted by evil mode Gem, because what has been happening is that though Typescript is super great in most normal situations, in a situation when you just want to implement a small portion of the refactor to test out if the idea works, well Typescript + Gemini actually work hand in hand to force you into refactoring the entire f-ing thing in one massive dangerous step, because each small change, creates another 20 breakages that you then need to fix. And on and on.
The best and safest way forward was actually to stop and temporarily add the offending file to tsconfig exclude list, comment out a bunch of UI code, and get the feature working in one small part of the app. Go figure. I‘m happy I went that route because, wouldn‘t you know it, as part of getting it working, it was necessary to fix another few small unexpected bugs. Had I gone down the refactor everything in one huge step route, no doubt there would have been even more bugs to fix, and I don‘t think I would have made it to the other side.
Maybe I'll be ready to start on this admin page finally tomorrow. #