Skip to content

Long running branch: Group documents#2720

Draft
scytacki wants to merge 45 commits intomasterfrom
group-documents
Draft

Long running branch: Group documents#2720
scytacki wants to merge 45 commits intomasterfrom
group-documents

Conversation

@scytacki
Copy link
Member

Do not merge yet.

scytacki and others added 17 commits January 6, 2026 11:21
- group documents just use the firestore metadata instead of having firebase metadata too. This is a pattern that all documents should change to eventually.
- group document content is stored in a different place firebase because they don't have a user. We could use the fake uid that is created for them so they could be stored in the same place in firebase that the other documents are stored, but this seems like it would lead to more problems.
This also enables reloading the page when a group document is open.
replace "group" with GroupDocument
Also:
- save the firebase metadata for the document so it is consistent with other CLUE documents. This removes some complexity around the createdAt timestamp.
- remove some console logs.
- revert the useSyncMst*ToFirebase to requiring a path as a string which makes more sense. However keep them checking for a non-empty path to prevent weird behavior
- have createDocument return the firestore metadata that it creates, so it can be used by other code
- add an official VisibilityType to unify "public" | "private" typing.
- add a type guard for DocumentType, this makes it safer when loading in documents from Firestore and other places.
- unify document title component used in sort-work-document-area and document-view
- note that use-document-caption has overlapping features with the document-title
- update db.ts so the document.self is not required to get the documentKey, some documents do not have this set and it isn't really needed
- add GroupDocument as a sortable type
- update getDocumentDisplayTitle to handle group documents.
- move some createDocMapBy* into the DocumentGroup to simplify the code
- update the byGroup and byName groupings so they handle group documents
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 48.38710% with 192 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.30%. Comparing base (08b2a22) to head (c0bae39).
⚠️ Report is 33 commits behind head on master.

Files with missing lines Patch % Lines
src/lib/db.ts 37.03% 45 Missing and 6 partials ⚠️
src/components/document/history-view-panel.tsx 17.02% 39 Missing ⚠️
src/models/history/firestore-history-manager.ts 22.72% 31 Missing and 3 partials ⚠️
src/components/document/history-entry-item.tsx 20.00% 16 Missing ⚠️
src/components/document/document.tsx 71.42% 8 Missing ⚠️
src/models/stores/persistent-ui/persistent-ui.ts 0.00% 8 Missing ⚠️
src/components/document/document-workspace.tsx 33.33% 5 Missing and 1 partial ⚠️
src/models/document/document-metadata-model.ts 14.28% 6 Missing ⚠️
src/components/toolbar.tsx 20.00% 4 Missing ⚠️
src/components/document/document-title.tsx 85.71% 3 Missing ⚠️
... and 10 more

❗ There is a different number of reports uploaded between BASE (08b2a22) and HEAD (c0bae39). Click for more details.

HEAD has 36 uploads less than BASE
Flag BASE (08b2a22) HEAD (c0bae39)
cypress-regression 15 0
cypress 21 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2720       +/-   ##
===========================================
- Coverage   86.67%   66.30%   -20.37%     
===========================================
  Files         816      814        -2     
  Lines       43754    43979      +225     
  Branches    11186    11247       +61     
===========================================
- Hits        37922    29161     -8761     
- Misses       5485    13778     +8293     
- Partials      347     1040      +693     
Flag Coverage Δ
cypress ?
cypress-regression ?
cypress-smoke 43.82% <37.42%> (-0.09%) ⬇️
jest 49.43% <29.30%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cypress
Copy link

cypress bot commented Jan 19, 2026

collaborative-learning    Run #17478

Run Properties:  status check passed Passed #17478  •  git commit c0bae39fa5: Merge pull request #2727 from concord-consortium/CLUE-362-unit-option-to-enable-...
Project collaborative-learning
Branch Review group-documents
Run status status check passed Passed #17478
Run duration 03m 01s
Commit git commit c0bae39fa5: Merge pull request #2727 from concord-consortium/CLUE-362-unit-option-to-enable-...
Committer Ethan McElroy
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
View all changes introduced in this branch ↗︎

scytacki and others added 10 commits January 19, 2026 08:29
Use a Firestore transaction and the metadata to safely track the
last history entry when multiple users are adding history entries
at the same time.
it is only shown when the historyView debug option is enabled
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This way the toolbar is only modified for the primary document.
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.

2 participants