Move document title ownership from document to version#1001
Merged
SachaProbo merged 3 commits intomainfrom Apr 9, 2026
Merged
Conversation
There was a problem hiding this comment.
1 issue found across 19 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/console/src/pages/organizations/documents/_components/DocumentActionsDropdown.tsx">
<violation number="1" location="apps/console/src/pages/organizations/documents/_components/DocumentActionsDropdown.tsx:346">
P2: The PDF filename uses the latest version title, not the title of the version being exported, so exports of older versions can be mislabeled.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
apps/console/src/pages/organizations/documents/_components/DocumentActionsDropdown.tsx
Outdated
Show resolved
Hide resolved
377da69 to
50624e8
Compare
gearnode
approved these changes
Apr 9, 2026
Contributor
gearnode
left a comment
There was a problem hiding this comment.
LGTM, please check it does not break the CLI before merging.
cd8221c to
ef236f4
Compare
Title is now owned by document_versions, following the same pattern as classification and document_type. The documents.title column is made nullable with a TODO to drop it. Backend loads title from a latest_versions CTE for ordering purposes only. The frontend resolves title from the latest version, and DocumentTitleForm now operates on DocumentVersion using UpdateDocumentVersion mutation. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
The description field on Document and EmployeeDocument was never populated. Remove it from the database, GraphQL schema, and Go types. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
Now that title lives on document_versions, the full-text search vector belongs there too. Drop the generated column and GIN index from documents, recreate them on document_versions, and update the document filter to query the latest version's search_vector. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
ef236f4 to
eb6c06e
Compare
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.
Summary by cubic
Move document titles from
DocumenttoDocumentVersion. The UI and APIs now read/write titles on versions and show/order by the latest (or published) version.Refactors
DocumentVersion; lists/dialogs/breadcrumbs/actions useversions.edges[0].node.title.DocumentTitleFormnow edits version titles viaupdateDocumentVersion, checkscore:document-version:update, and only allows edits on draft versions.Document.titleanddescription(also removedEmployeeDocument.description);UpdateDocumentInputdropstitleandcontent;UpdateDocumentVersionInputaddstitle.Documentno longer persiststitle; backend resolves title from the latest/published version for display/ordering;UpdateDocumentVersionvalidates/savestitle; draft creation copies the latest version’s title.search_vectortodocument_versions; filter queries the latest version’ssearch_vector.updateDocumentVersionand stop queryingDocument.title.Migration
documents.titlenullable; dropdocuments.description; movesearch_vectorand its GIN index fromdocumentstodocument_versionswith a generated column.Document.title/description; readDocumentVersion.title(latest or published); useupdateDocumentVersionto change titles.Written for commit eb6c06e. Summary will update on new commits.