Repository navigation
Conversation
Add a third view next to the diff and the graph: a model groups the changed files into parts a reader follows in order, with a summary up front and a narrative per part. Each part lists its files with their diffs beside them and a Reviewed box for the whole part; a file opens in the diff for comments. The server owns the story: `GET /api/story` and `POST /api/story`, one raw call to the Anthropic Messages API constrained to a JSON schema, the answer validated against the snapshot (unknown and repeated paths dropped, forgotten files in a trailing part, generated files always last), and the result kept under `<git-dir>/diffle/stories/` by a fingerprint of the endpoints and the changed blobs, so a reopened review finds it and an edit marks it stale. The key comes from ANTHROPIC_API_KEY; without one the view says so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LWB8Be3qmrYtGnBxbNsV9S
Collaborator
Author
|
Not intended to be merged. Just want to get the vibe of it |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A third view next to Diff and Graph, keyed on
S: a model groups the changed files into parts a reader follows in order, with a summary up front and a couple of sentences per part. Each part has a sticky column with its number, title, narrative, a part-level Reviewed box and its file list; beside it, each file's diff with the story's note, a Viewed box, a fold toggle and an open-in-diff button. Keys:j/kfiles,n/pparts,v/Vviewed,zfold,Enteropens the file in the diff for comments,rwrites or rewrites.How
src/shared/protocol.ts):Story,StoryPart,StoryFile,StoryStateand astoryserver message; the generated schema is updated.crates/diffle/src/story/):prompt.rsbuilds the request from the comparison label, the commits, the file list with status and flags, and the patches within a size budget (generated and binary files are listed by name only).client.rsmakes one raw HTTPS call to the Anthropic Messages API behind aStoryModeltrait:claude-opus-5-5at medium effort, the answer constrained to a JSON schema, server-side fallbacks on.validate.rsdrops unknown and repeated paths, collects forgotten files into an "Other changes" part and always closes with "Generated files".mod.rsowns the state: one story in the writing at a time, kept under<git-dir>/diffle/stories/<fingerprint>.jsonwhere the fingerprint hashes the endpoints and every changed blob, so a reopened review finds its story and an edit marks it stale.GET /api/storyandPOST /api/story;storyon the socket when the writing starts and ends.Error::Storyanswers 409 for something to fix (no key, no changes) and 502 for a model that did not answer.src/client/story/): the view definition, its state store, the pane, and a standaloneDiffBlockover the library'sFileDiff. The diff library'sCodeViewonly takes file and diff items, so part headers cannot sit inside the virtualised list; the story pane renders its own layout and hands line-level work to the diff view.ANTHROPIC_API_KEY, withANTHROPIC_BASE_URLandDIFFLE_STORY_MODELas overrides. Without a key the view says so and the run prints📖 story off.Tests
crates/diffle/tests/story.rs: a fake model through the API, persistence across servers, staleness after an edit, failure and retry, the no-key and no-changes blockers, and the request shape against a fake Anthropic endpoint (two insta snapshots).test/client/HelpOverlay.test.tscovers the story's help.test-node,test-rustand the release build pass locally.Notes
Generated by Claude Code