Skip to content

feat(files): add collaborative documents and slide decks - #681

Open
davemooreuws wants to merge 10 commits into
bots-and-channelsfrom
docs-slides-feat
Open

davemooreuws wants to merge 10 commits into
bots-and-channelsfrom
docs-slides-feat

Conversation

@davemooreuws

Copy link
Copy Markdown
Member

Members and bots can edit documents and slide decks together in Files. Members can request changes from a specific bot and review its suggestions. Whole-file bot writes require the revision returned by file_read, so a stale write cannot overwrite a member’s newer edits.

Adds Word, PDF, and PowerPoint exports. Downloads report a conflict if any content would be omitted because the file is only partly readable.

Verification. Workspace typecheck, Biome, 291 focused tests, and five Storybook checks passed. The full Windows run had failures in lint, migration, shell, GitHub, and blob-store checks. The affected file suites passed on the final focused run.

@davemooreuws
davemooreuws marked this pull request as draft November 29, 2026 08:16
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sugabots-website 40dccbd Dec 01 2026, 06:59 AM

@davemooreuws
davemooreuws force-pushed the docs-slides-feat branch 2 times, most recently from ea3b2ff to 6c061e6 Compare November 29, 2026 09:08
@jyecusch
jyecusch deleted the branch bots-review-fixes November 30, 2026 00:44
@jyecusch jyecusch closed this Nov 30, 2026
@jyecusch jyecusch reopened this Nov 30, 2026
@jyecusch
jyecusch changed the base branch from bots-review-fixes to jye/bots/8-streams-performance November 30, 2026 02:06
@jyecusch
jyecusch force-pushed the jye/bots/8-streams-performance branch from c6e9c61 to 9623fc2 Compare November 30, 2026 22:24
@davemooreuws
davemooreuws marked this pull request as ready for review November 30, 2026 22:29

@tjholm tjholm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One finding, inline. Not blocking.

— written by Claude

Effect.gen(function* () {
const chats = yield* Chats.Service;
const member = yield* proveIsMember(who);
const edit = yield* proveCanEditFile(yield* proveReachesWrittenFile(who, file));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A viewer can send an edit request, but the bot can never answer it with a suggestion.

CanEditFile and CanTakePart both let viewers in here, and the editor offers viewers the ask box (useAskedBot has no role check). The turn that answers acts with the viewer's permissions, though. canWriteFilesInChat is false for it, so file_write and file_edit aren't offered (chats/turns/tools.ts:267-269), and proveCanChangeFile would refuse them anyway, because changesIn needs project.change. When the turn ends, settleEditRequests marks the request answered, so the viewer sees an answered request and no suggestion.

permissions.test.ts asserts that viewers may post the request, but no test covers what the turn can then do with it. The architecture docs' rule is "a viewer's bot changes nothing, as the viewer can't".

Two ways out:

  • Refuse the request for members without project.change (check changesIn here rather than taking part), and hide the ask box for them. Small.
  • Or let a turn that answers an edit request make suggestion-only writes for a viewer, since a viewer can already make the same edit by hand. That's a proof change, and a decision against the current permissions docs.

— written by Claude

@tjholm tjholm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A question, inline.

— written by Claude

reach: ReachesFile<P, F>,
): Effect.Effect<CanEditFile<P, F>, ActionForbidden> => {
const member = reach.principal.value._tag === "MemberSession";
if (!member || !takesPartIn(reach.as, reach.project)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: who needs viewers to edit documents and decks, and why?

This lets anyone who can take part in the chat edit a file, viewers included. The GLOSSARY's "Live document" entry and edit-live.test.ts say so, so it's clearly on purpose, but I couldn't find the reason in the PR. It also goes further than editing:

  • files.create lets viewers create documents and decks in a project. In a public bot's default project, that's anyone who can talk to the bot.
  • Viewers can accept or undo a bot's suggestions.

It's a change to the viewer role. The architecture docs say "a viewer's bot changes nothing, as the viewer can't" (02-permissions.md), and the roles table in packages/docs/src/roles.ts has no row for editing or creating files.

If it's wanted, those docs and the roles table need to say so. If not, changesIn here and in createInProject would keep viewers to reading, which would also settle the edit-request comment.

— written by Claude

@davemooreuws
davemooreuws force-pushed the docs-slides-feat branch 3 times, most recently from 60ca6e1 to 4d7df1b Compare December 1, 2026 01:18
@HomelessDinosaur
HomelessDinosaur force-pushed the jye/bots/8-streams-performance branch from 9623fc2 to 3efb531 Compare December 1, 2026 02:21
Base automatically changed from jye/bots/8-streams-performance to bots-and-channels December 1, 2026 02:23
@davemooreuws
davemooreuws requested a review from tjholm December 1, 2026 05:26
Check the combined image size before writing any new images so a refused edit preserves the file's remaining storage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants