Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style: lead the topic meta PR row with its number (#16970)

Arvin Xuddc05d93e0c9
diff --git a/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.test.tsx b/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.test.tsx
index 5b71e71ca4f..c75d13f8ce6 100644
--- a/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.test.tsx
+++ b/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.test.tsx
@@ -63,4 +63,34 @@ describe('MetaHoverCard', () => {
expect(screen.getByText('repo-fix')).toBeInTheDocument();
expect(screen.queryByText('metaCard.branchNote')).not.toBeInTheDocument();
});
+
+ it('renders the PR number ahead of the title so the ellipsis never eats it', () => {
+ const metadata: ChatTopicMetadata = {
+ workingDirectory: '/repo',
+ workingDirectoryConfig: {
+ git: {
+ branch: 'perf/active-scope-key',
+ github: {
+ pullRequest: {
+ ciStatus: 'success',
+ mergedAt: '2026-07-09T00:00:00.000Z',
+ number: 16_951,
+ state: 'closed',
+ title: 'perf(swr): persist activeScopeKey',
+ url: 'https://github.com/lobehub/lobehub/pull/16951',
+ },
+ },
+ },
+ path: '/repo',
+ repoType: 'git',
+ },
+ };
+
+ render(<MetaHoverCard metadata={metadata} title="Topic" />);
+
+ const link = screen.getByRole('link');
+ expect(link).toHaveAttribute('href', 'https://github.com/lobehub/lobehub/pull/16951');
+ expect(link).toHaveTextContent('metaCard.pr.merged · #16951 perf(swr): persist activeScopeKey');
+ expect(screen.getByTitle('#16951 perf(swr): persist activeScopeKey')).toBeInTheDocument();
+ });
});
diff --git a/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.tsx b/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.tsx
index 478867565bf..bdc765eac45 100644
--- a/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.tsx
+++ b/src/routes/(main)/agent/_layout/Sidebar/Topic/List/Item/MetaHoverCard.tsx
@@ -80,7 +80,10 @@ const styles = createStaticStyles(({ css }) => ({
color: inherit;
text-decoration: none;
+ /* antd's global a:hover outranks the color:inherit above, so without this the
+ row would turn link-blue; hovering should read as emphasis instead. */
&:hover {
+ color: ${cssVar.colorText};
background: ${cssVar.colorFillTertiary};
}
`,
@@ -183,6 +186,9 @@ const MetaHoverCard = memo<MetaHoverCardProps>(({ metadata, title, time }) => {
(() => {
const prState = getPullRequestState(pullRequest);
const prVisual = PR_STATE_VISUAL[prState];
+ const prTitleAttr = pullRequest.title
+ ? `#${pullRequest.number} ${pullRequest.title}`
+ : `#${pullRequest.number}`;
const prInner = (
<>
<Icon
@@ -191,12 +197,16 @@ const MetaHoverCard = memo<MetaHoverCardProps>(({ metadata, title, time }) => {
size={15}
style={{ color: prVisual.color }}
/>
- <span className={styles.rowText} title={pullRequest.title}>
+ <span className={styles.rowText} title={prTitleAttr}>
<span style={{ color: prVisual.color, fontWeight: 500 }}>
{t(prVisual.labelKey)}
</span>
- {pullRequest.title ? ` · ${pullRequest.title}` : ''}
- <span style={{ color: cssVar.colorTextTertiary }}>{` #${pullRequest.number}`}</span>
+ {/* The number leads the title: it is the stable identifier, and a
+ long title would otherwise push it past the ellipsis. */}
+ <span
+ style={{ color: cssVar.colorTextTertiary }}
+ >{` · #${pullRequest.number}`}</span>
+ {pullRequest.title ? ` ${pullRequest.title}` : ''}
</span>
</>
);