Skip to content

Commit 5509b35

Browse files
committed
Show last paper in author list
Signed-off-by: Jay Wang <[email protected]>
1 parent ea67cff commit 5509b35

File tree

3 files changed

+72
-17
lines changed

3 files changed

+72
-17
lines changed

src/components/author-list/author-list.css

+55-11
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,41 @@
1616
width: 100%;
1717
border-collapse: collapse;
1818
white-space: nowrap;
19+
box-sizing: border-box;
1920
--cell-padding-right: 50px;
2021

2122
&:has(.author-row) {
2223
margin-top: 10px;
2324
}
2425

2526
.col-icon {
26-
width: 0;
27+
width: 0px;
2728
min-width: min-content;
2829
}
2930

3031
.col-name {
31-
width: 0;
32+
width: 0px;
3233
min-width: min-content;
3334
}
3435

35-
.col-paper-count {
36-
width: 0;
36+
.col-citation-count {
37+
width: 0px;
3738
min-width: min-content;
3839
}
3940

40-
.col-citation-count {
41-
width: 0;
41+
.col-paper-count {
42+
width: 0px;
4243
min-width: min-content;
4344
}
4445

45-
.col-filler {
46-
width: 100%;
46+
.col-paper {
47+
width: 0px;
48+
min-width: min-content;
4749
}
4850

4951
.author-row {
5052
cursor: pointer;
51-
width: 100%;
53+
box-sizing: border-box;
5254

5355
.svg-icon {
5456
color: var(--gray-300);
@@ -67,6 +69,7 @@
6769
vertical-align: center;
6870
padding: 3px 0;
6971
height: 24px;
72+
box-sizing: border-box;
7073
}
7174

7275
.icon {
@@ -75,12 +78,15 @@
7578
display: flex;
7679
align-items: center;
7780
justify-content: center;
81+
width: min-content;
82+
position: relative;
83+
top: 2px;
7884
}
7985

8086
.name {
8187
padding-right: var(--cell-padding-right);
8288
font-weight: 600;
83-
max-width: 500px;
89+
max-width: 300px;
8490
overflow: hidden;
8591
text-overflow: ellipsis;
8692
white-space: nowrap;
@@ -96,6 +102,16 @@
96102
.citation-count {
97103
color: var(--gray-500);
98104
vertical-align: top;
105+
padding-right: var(--cell-padding-right);
106+
}
107+
108+
.paper {
109+
color: var(--gray-500);
110+
max-width: 500px;
111+
font-style: italic;
112+
overflow: hidden;
113+
text-overflow: ellipsis;
114+
white-space: nowrap;
99115
}
100116
}
101117

@@ -121,9 +137,37 @@
121137
.author-table {
122138
--cell-padding-right: 10px;
123139

140+
& td {
141+
padding-top: 5px;
142+
padding-bottom: 5px;
143+
}
144+
145+
.icon {
146+
display: none;
147+
}
148+
124149
.name {
125-
min-width: 100px;
150+
padding-left: calc(1rem - 2px);
151+
max-width: unset;
152+
overflow: unset;
153+
text-overflow: unset;
154+
white-space: wrap;
155+
}
156+
157+
.citation-count {
158+
white-space: wrap;
159+
}
160+
161+
.paper-count {
162+
max-width: unset;
163+
white-space: wrap;
164+
}
165+
166+
.paper {
126167
white-space: wrap;
168+
overflow: unset;
169+
text-overflow: unset;
170+
padding-right: calc(1rem - 2px);
127171
}
128172
}
129173
}

src/components/author-list/author-list.ts

+16-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type {
1111
import iconPerson from '../../images/icon-person.svg?raw';
1212
import componentCSS from './author-list.css?inline';
1313

14-
const AUTHORS_PER_PAGE = 100;
14+
const AUTHORS_PER_PAGE = 50;
1515
let authorDetailAPITimeout: number | null = null;
1616

1717
/**
@@ -94,7 +94,12 @@ export class RecRecAuthorList extends LitElement {
9494
}
9595

9696
try {
97-
const data = await searchAuthorDetails(this.authors.map(d => d.authorId));
97+
const fields =
98+
'authorId,name,affiliations,paperCount,citationCount,papers.title';
99+
const data = await searchAuthorDetails(
100+
this.authors.map(d => d.authorId),
101+
fields
102+
);
98103
this.authorDetails = data;
99104
this.updateIsSearching(false);
100105
} catch (e) {
@@ -138,6 +143,11 @@ export class RecRecAuthorList extends LitElement {
138143
)) {
139144
if (author === null) continue;
140145

146+
let latestPaper = '';
147+
if (author.papers !== undefined && author.papers.length > 0) {
148+
latestPaper = author.papers[0].title;
149+
}
150+
141151
authors = html`${authors}
142152
<tr
143153
class="author-row"
@@ -153,9 +163,9 @@ export class RecRecAuthorList extends LitElement {
153163
? ` (${author.affiliations![0]})`
154164
: ''}
155165
</td>
156-
<td class="paper-count">${author.paperCount} papers</td>
157166
<td class="citation-count">${author.citationCount} citations</td>
158-
<td class="extra-cell"></td>
167+
<td class="paper-count">${author.paperCount} papers</td>
168+
<td class="paper">"${latestPaper}"</td>
159169
</tr> `;
160170
}
161171

@@ -165,9 +175,9 @@ export class RecRecAuthorList extends LitElement {
165175
<colgroup>
166176
<col class="col-icon" />
167177
<col class="col-name" />
168-
<col class="col-paper-count" />
169178
<col class="col-citation-count" />
170-
<col class="col-filler" />
179+
<col class="col-paper-count" />
180+
<col class="col-paper" />
171181
</colgroup>
172182
${authors}
173183
</table>

src/types/common-types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export interface SemanticAuthorDetailContent {
9696
paperCount?: number;
9797
hIndex?: number;
9898
url?: string;
99+
papers?: SemanticPaper[];
99100
}
100101

101102
export enum Step {

0 commit comments

Comments
 (0)