foolish-bandit/gary: /explain page and consistent backend-unavailable messaging

Commit `b3287856` adds a 159-line `/explain` page that wraps pasted legal text into a structured prompt and hands off to the assistant chat. It also standardises the error strings across draft and review flows and adds a handful of sidebar and auth-screen fixes.

chat-uisummarization

The /explain page takes a required legal text textarea and three optional fields: context/document type, goal, preferred tone. On submit it builds an array of prompt parts, filters out empty optional fields, joins them with double newlines, and hands the assembled string to useAssistantChat.handleNewChat. The fixed structure line at the end -- "Use this structure: What it says, Why it matters, What could go wrong, Possible revision." -- is the only opinionated piece and is defined inline in the function, not as a named constant in this version.

The draft and review pages previously showed "Could not start the draft/review. Try again." when handleNewChat returned no chat ID. Both now share BACKEND_UNAVAILABLE_MESSAGE: "This will be available once GaryOSS is connected to the backend." That single string makes the frontend-without-backend state visible rather than suggesting a transient failure.

Other fixes in the same commit: the initial view gains an uploadError state so upload failures surface to the user instead of dropping to the console. Desktop sidebar open/closed state is routed through a single variable. The sidebar's chat link becomes "Ask Gary." Login and signup screens display a visible banner when NEXT_PUBLIC_GARY_SKIP_AUTH is set.

The PR was opened and merged within seconds -- consistent with a self-merge by foolish-bandit. No automated test run was reported.

So what Worth a look if you want the `/explain` surface or the backend-unavailable messaging pattern. Both are small and well-contained. The sidebar state fix is a real bug fix (state disagreement on navigation) and is worth pulling if you're running into it.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

1 commit from foolish-bandit/gary, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
b3287856 Add Explain This workflow shell Zack Brenner 2026-05-07 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-321.md from inside the repo you want the changes in.

⬇ Download capture-thread-321.md