-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat(kb): added tags information to kb docs table #2589
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryAdded tags column to the knowledge base documents table to display tag information for each document, improving visibility of document metadata without requiring navigation to individual documents. Key Changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant KnowledgeBase
participant Hook as useKnowledgeBaseTagDefinitions
participant API as /api/knowledge/{id}/tag-definitions
participant getDocumentTags
participant Table as Documents Table
User->>KnowledgeBase: View documents table
KnowledgeBase->>Hook: useKnowledgeBaseTagDefinitions(id)
Hook->>API: fetch tag definitions
API-->>Hook: return TagDefinition[]
Hook-->>KnowledgeBase: tagDefinitions
loop For each document
KnowledgeBase->>getDocumentTags: getDocumentTags(doc, tagDefinitions)
getDocumentTags->>getDocumentTags: iterate TAG_SLOTS
getDocumentTags->>getDocumentTags: format values by fieldType
getDocumentTags-->>KnowledgeBase: TagValue[]
KnowledgeBase->>Table: render tags column
Table-->>User: display truncated tags
end
User->>Table: hover over tags
Table-->>User: show tooltip with full tag details
|
| <TableCell className='px-[12px] py-[8px]'> | ||
| <Skeleton className='h-[24px] w-[64px] rounded-md' /> | ||
| </TableCell> | ||
| <TableCell className='px-[12px] py-[8px]'> |
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.
function SkeletonCell({
w,
h,
rounded = 'md',
className = '',
}: {
w: string
h: string
rounded?: 'sm' | 'md' | 'full'
className?: string
}) {
const roundedMap = {
sm: 'rounded-[4px]',
md: 'rounded-md',
full: 'rounded-full',
}
return (
<Skeleton
className={${h} ${w} ${roundedMap[rounded]} ${className}}
/>
)
}
| <Skeleton className='h-[24px] w-[64px] rounded-md' /> | ||
| </TableCell> | ||
| <TableCell className='px-[12px] py-[8px]'> | ||
| <div className='flex items-center gap-[4px]'> |
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.
const columns = [
{ key: 'name', width: '180px' },
{ key: 'size', width: '8%' },
{ key: 'tokens', width: '8%' },
{ key: 'chunks', width: '8%', responsive: 'lg' },
...
]
| </TableCell> | ||
| <TableCell className='px-[12px] py-[8px]'> | ||
| <div className='flex items-center gap-[4px]'> | ||
| <Skeleton className='h-[18px] w-[40px] rounded-full' /> |
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.
{columns.map(col => (
<TableCell key={col.key} style={{ width: col.width }}>
))}
| <Skeleton className='h-[18px] w-[40px] rounded-full' /> | ||
| <Skeleton className='h-[18px] w-[40px] rounded-full' /> | ||
| </div> | ||
| </TableCell> |
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.
if (isLoading) return
if (!data.length) return
e6c7bd3 to
6b332ee
Compare
Summary
Type of Change
Testing
Tested manually
Checklist
Screenshots/Videos