-
Notifications
You must be signed in to change notification settings - Fork 1
fix(customer-master): open related posts in place instead of jumping to Board #458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7978f51
3c0c668
926a86a
11c65c1
91b5141
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5252,10 +5252,8 @@ function customerMasterScopeBuckets(entity: CustomerMasterEntity): CustomerMaste | |
|
|
||
| function CustomerMasterPanel({ | ||
| accessToken, | ||
| onOpenPost, | ||
| }: { | ||
| accessToken: string; | ||
| onOpenPost: (postId: string) => void; | ||
| }) { | ||
| const [master, setMaster] = useState<CustomerMasterResponse | null>(null); | ||
| const [scopeFilter, setScopeFilter] = useState<Set<CustomerMasterScopeFilter>>( | ||
|
|
@@ -5265,6 +5263,12 @@ function CustomerMasterPanel({ | |
| const [expandedEntityId, setExpandedEntityId] = useState<string | null>(null); | ||
| const [relatedByEntity, setRelatedByEntity] = useState<Record<string, RelatedNode[]>>({}); | ||
| const [relatedLoading, setRelatedLoading] = useState<string | null>(null); | ||
| // A related post opens in this panel's own right-docked popup -- it must | ||
| // never hand off to the Board's destination/selection state (that | ||
| // hand-off was the reported bug: clicking a customer's post jumped the | ||
| // whole workspace to the Board instead of showing the post here). | ||
| const [selectedPostId, setSelectedPostId] = useState<string | null>(null); | ||
| const [selectedPostGraph, setSelectedPostGraph] = useState<LineageGraph | null>(null); | ||
| const [resolvingHint, setResolvingHint] = useState<string | null>(null); | ||
| const [resolveError, setResolveError] = useState<string | null>(null); | ||
| // Fetched independently, same pattern as PostList's own canRebuild -- | ||
|
|
@@ -5329,6 +5333,28 @@ function CustomerMasterPanel({ | |
| } | ||
| } | ||
|
|
||
| useEffect(() => { | ||
| if (!selectedPostId) { | ||
| setSelectedPostGraph(null); | ||
| return; | ||
| } | ||
| let active = true; | ||
| fetchLineageGraph(accessToken, selectedPostId) | ||
| .then((nextGraph) => { | ||
| if (active) setSelectedPostGraph(nextGraph); | ||
| }) | ||
| .catch(() => { | ||
| if (active) setSelectedPostGraph({ nodes: [], edges: [] }); | ||
| }); | ||
| return () => { | ||
| active = false; | ||
| }; | ||
| }, [accessToken, selectedPostId]); | ||
|
|
||
| function openPost(postId: string) { | ||
| setSelectedPostId(postId); | ||
| } | ||
|
|
||
| const filteredEntities = (master?.corporate_entities ?? []).filter((entity) => | ||
| customerMasterScopeBuckets(entity).some((bucket) => scopeFilter.has(bucket)), | ||
| ); | ||
|
|
@@ -5381,7 +5407,7 @@ function CustomerMasterPanel({ | |
| relatedByEntity={relatedByEntity} | ||
| relatedLoading={relatedLoading} | ||
| onToggle={toggleEntity} | ||
| onOpenPost={onOpenPost} | ||
| onOpenPost={openPost} | ||
| /> | ||
| ))} | ||
| </ul> | ||
|
|
@@ -5451,7 +5477,7 @@ function CustomerMasterPanel({ | |
| postTitle={post.post_title} | ||
| postBodyExcerpt={post.post_body_excerpt} | ||
| postBodyTruncated={post.post_body_truncated} | ||
| onOpenPost={onOpenPost} | ||
| onOpenPost={openPost} | ||
| /> | ||
| </li> | ||
| ))} | ||
|
|
@@ -5504,7 +5530,7 @@ function CustomerMasterPanel({ | |
| postTitle={post.post_title} | ||
| postBodyExcerpt={post.post_body_excerpt} | ||
| postBodyTruncated={post.post_body_truncated} | ||
| onOpenPost={onOpenPost} | ||
| onOpenPost={openPost} | ||
| /> | ||
| </li> | ||
| ))} | ||
|
|
@@ -5530,6 +5556,16 @@ function CustomerMasterPanel({ | |
| </ul> | ||
| </section> | ||
| ) : null} | ||
| {selectedPostId && ( | ||
| <PostDetailPopup | ||
| postId={selectedPostId} | ||
| accessToken={accessToken} | ||
| canExtract={canResolveHints} | ||
| graph={selectedPostGraph} | ||
| onClose={() => setSelectedPostId(null)} | ||
| onSelectPost={openPost} | ||
| /> | ||
| )} | ||
|
Comment on lines
+5559
to
+5568
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: Popup lineage graph loads lazily here
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| </section> | ||
| ); | ||
| } | ||
|
|
@@ -6256,13 +6292,7 @@ export default function App({ showLabPanels = false }: { showLabPanels?: boolean | |
| /> | ||
| ) : null} | ||
| {activeDestination === "customers" ? ( | ||
| <CustomerMasterPanel | ||
| accessToken={accessToken} | ||
| onOpenPost={(postId) => { | ||
| setPostToOpen(postId); | ||
| changeDestination("board"); | ||
| }} | ||
| /> | ||
| <CustomerMasterPanel accessToken={accessToken} /> | ||
| ) : null} | ||
| {activeDestination === "calendar" ? ( | ||
| <CalendarPanel | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Info: Tie check re-scores candidates
The tie short-circuit scores
entity_nameagainst candidates, thenget_or_create_corporate_entityscores the same inputs again internally. This is deliberate so a tie is not mistaken for a miss in the flat-fallback path; the duplication is harmless and side-effect-free.Was this helpful? React with 👍 or 👎 to provide feedback.