Skip to content

Conversation

@jjoyce0510
Copy link
Collaborator

@jjoyce0510 jjoyce0510 commented Dec 1, 2025

Summary

This is the final PR for UI for context base V1 feature. Specifically this adds:

  • You can now view related context docs for an asset beside to it's links (for both V1 and V2 summary tab). This includes a new relatedDocuments field on specific entity types. This looks like a lot of changes but we are just adding this to select entity types. Initially I'd added tot he EntityType base interface but that added it to a bunch of things I really didn't want it for (e.g. execution requests, so I decided to target specific entity types for now). I've also added a new EntityCapabilityType in the entity registry that is used to decide whether to fetch and render related docs.

  • You can now Move / Delete docs from the document profile itself

  • You can now link related context docs for an asset from the asset profile!

  • We've made some changes to how searching documents works so that you see PUBLISHED docs OR your own drafts (owned by you) BY DEFAULT. This will be sufficient for all the features that currently use this GraphQL query.

Loom Overview: https://www.loom.com/share/50dbc526c82746978bd163b9526966c7

Screenshot 2025-11-30 at 11 23 04 PM Screenshot 2025-11-30 at 11 24 05 PM Screenshot 2025-11-30 at 11 24 12 PM

@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX devops PR or Issue related to DataHub backend & deployment smoke_test Contains changes related to smoke tests labels Dec 1, 2025
typeWiring ->
typeWiring
.dataFetcher("relationships", new EntityRelationshipsResultResolver(graphClient))
.dataFetcher(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

REMOVE THIS.

@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Dec 1, 2025
builder.type(
"StructuredPropertyEntity",
typeWiring -> typeWiring.dataFetcher("exists", new EntityExistsResolver(entityService)));
typeWiring ->
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove this

@codecov
Copy link

codecov bot commented Dec 1, 2025

* @param userAndGroupUrns List of URNs for the current user and their groups
* @return The combined filter
*/
private Filter buildCombinedFilter(SearchDocumentsInput input, List<String> userAndGroupUrns) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mostly removing and making small tweaks to the filtering logic inside of DocumentSearchFilterUtils.java

criteria.add(
CriterionUtils.buildCriterion(
"parentDocument", Condition.EQUAL, input.getParentDocuments()));
} else if (input.getParentDocument() != null) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No one is using this - we are removing this since we just moved to using parentDocuments instead.

@alwaysmeticulous
Copy link

alwaysmeticulous bot commented Dec 1, 2025

✅ Meticulous spotted 0 visual differences across 992 screens tested: view results.

Meticulous evaluated ~8 hours of user flows against your PR.

Expected differences? Click here. Last updated for commit bf16877. This comment will update as new commits are pushed.

"""
Get context documents related to this entity
"""
relatedDocuments(input: RelatedDocumentsInput!): RelatedDocumentsResult
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove this

"""
Get context documents related to this entity
"""
relatedDocuments(input: RelatedDocumentsInput!): RelatedDocumentsResult
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remove this for now..

"""
Optional parent document URN to filter by (for hierarchical browsing)
"""
parentDocument: String
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nothing released here, this is safe to change.

"""
The starting offset of the result set returned
"""
states: [DocumentState!]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Simplifying this interface a lot based on what we actually need.

Remove states filter - now we always default to PUBLISHED OR UNPUBLISHED (with owner == myself).

Remove includeDrafts - this was premature and is not used yet.

Remove filters - this was premature and is not used yet.

searchFlags - this was not used.

"""
Get context documents related to this entity
"""
relatedDocuments(input: RelatedDocumentsInput!): RelatedDocumentsResult
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remove - should NOT be on all types.

input: {
query: '*',
parentDocuments: urns,
states: [DocumentState.Published, DocumentState.Unpublished],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removing this

@@ -1,39 +1,13 @@
import { useMemo } from 'react';

import { extractMentions } from '@app/document/utils/extractMentions';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just refactoring :)

* - Loading children on demand
*/

function documentToTreeNode(doc: Document, hasChildren: boolean): DocumentTreeNode {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

just refactoring..

@codecov
Copy link

codecov bot commented Dec 1, 2025

Bundle Report

Changes will increase total bundle size by 63.2kB (0.22%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
datahub-react-web-esm 28.79MB 63.2kB (0.22%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: datahub-react-web-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 63.2kB 19.17MB 0.33%

Files in assets/index-*.js:

  • ./src/app/document/hooks/useLoadDocumentTree.ts → Total Size: 3.31kB

  • ./src/app/document/utils/documentUtils.ts → Total Size: 1.11kB

  • ./src/app/document/hooks/useExtractMentions.ts → Total Size: 118 bytes

  • ./src/app/document/hooks/useRelatedDocuments.ts → Total Size: 1.33kB

  • ./src/app/document/hooks/useDocumentTreeMutations.ts → Total Size: 5.44kB

  • ./src/app/entityV2/Entity.tsx → Total Size: 1.92kB

  • ./src/app/entity/shared/utils.ts → Total Size: 5.37kB

  • ./src/app/document/hooks/useSearchDocuments.ts → Total Size: 1.05kB

  • ./src/app/entity/Entity.tsx → Total Size: 2.01kB

  • ./src/app/document/utils/extractMentions.ts → Total Size: 606 bytes

/>
</Tooltip>
)}
<ActionsMenuWrapper>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is new!

border-radius: 4px;
resize: none;
overflow: hidden;
overflow: auto;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixing styling for overflowing titles - now we are wrapping.

{actor && (
<>
{' by '}
{(() => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can we simplify this?

);

/**
* Handle creating a new document
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From the popover

const location = useLocation();
const entityRegistry = useEntityRegistry();

const handleDelete = async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

simplifying a lot of this. should be no functional changes..


import { Document, InstitutionalMemoryMetadata } from '@types';

export type RelatedItem =
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needs unit tests

* Calculates the navigation target after deleting a document.
* Returns the URN to navigate to, or null if should go to home.
*/
export function calculateDeleteNavigationTarget(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add unit tests

const deleteDocument = useCallback(
async (urn: string) => {
// Get node for rollback
// Get node for rollback (may be null if document isn't in tree, e.g., opened in modal)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need unit test

}, [content]);

return mentions;
return useMemo(() => extractMentions(content), [content]);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unit test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops PR or Issue related to DataHub backend & deployment needs-review Label for PRs that need review from a maintainer. product PR or Issue related to the DataHub UI/UX smoke_test Contains changes related to smoke tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants