Repository navigation
feat(files): add collaborative documents and slide decks - #681
davemooreuws wants to merge 10 commits into
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sugabots-website | 40dccbd | Dec 01 2026, 06:59 AM |
ea3b2ff to
6c061e6
Compare
f75cce6 to
eec16ce
Compare
c6e9c61 to
9623fc2
Compare
eec16ce to
04ef69d
Compare
tjholm
left a comment
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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(checkchangesInhere 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
left a comment
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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.createlets 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
60ca6e1 to
4d7df1b
Compare
9623fc2 to
3efb531
Compare
2c51330 to
c3387c6
Compare
Keep file switching available from the editor and adapt its chat layout to the available width.
6084676 to
24b0418
Compare
Check the combined image size before writing any new images so a refused edit preserves the file's remaining storage.
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.