[refactor] connect Open Library pages to Lark API - #100
Merged
Conversation
Closed
Copilot
AI
changed the title
[WIP] Connect open library Feishu multi-dimensional table API
Add Open Library books to shared search flow
Jul 23, 2026
TechQuery
requested changes
Jul 23, 2026
Contributor
Author
已按 issue 里的链接重新对照后修改,现已改成走飞书表格数据源,并删除临时 books API。5934fe6 |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
pages/open-library/books/index.tsx:40
store={new BookModel()}creates a fresh store instance on every render, which can reset list state and trigger unnecessary network requests. Memoize the store instance soScrollListcan preserve pagination/loading state across renders.
<ScrollList
translator={i18n}
store={new BookModel()}
defaultData={books}
Comment on lines
+34
to
+41
| export class BookModel extends BiDataTable<Book>() { | ||
| client = larkClient; | ||
|
|
||
| queryOptions: BiDataQueryOptions = { text_field_as_array: false }; | ||
|
|
||
| constructor(appId = LibraryBaseId, tableId = BookTableId) { | ||
| super(appId, tableId); | ||
| } |
Comment on lines
+44
to
+55
| export class SearchBookModel extends BiSearch<Book>(BookModel) { | ||
| searchKeys = [ | ||
| 'title', | ||
| 'isbn', | ||
| 'authors', | ||
| 'summary', | ||
| 'recommendation', | ||
| 'tags', | ||
| 'donors', | ||
| 'keepers', | ||
| ]; | ||
| } |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Comments suppressed due to low confidence (2)
models/Book.ts:44
- The PR description states that
pages/api/open-library/books.tswas extended for keyword filtering/pagination and that search uses the/api/open-library/booksendpoint, but this branch deletes that API route and implements book search viaBiDataTable/BiSearchagainst Lark instead. Either the PR description needs updating, or the intended API-backed search flow is missing.
}
export class SearchBookModel extends BiSearch<Book>(BookModel) {
searchKeys = [
'title',
pages/open-library/book/[id].tsx:106
- The ISBN label is hardcoded as
ISBNwhile the surrounding metadata labels uset(...). This creates an untranslated user-facing string and breaks the project’s i18n pattern on this page.
<Col as="li">
<div className="text-muted small">ISBN</div>
<div>{isbn || t('not_available')}</div>
</Col>
Comment on lines
44
to
49
| const SearchNameMap = ({ t }: typeof i18n): Record<string, string> => ({ | ||
| activity: t('activity'), | ||
| book: t('open_library'), | ||
| project: t('open_source_projects'), | ||
| NGO: t('NGO'), | ||
| }); |
TechQuery
approved these changes
Jul 24, 2026
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the shared search infrastructure to include Open Library books sourced from the Feishu-backed book dataset. Book search results now participate in the existing
/search/[model]flow and render with the established Open Library card UI.Search model integration
SearchBookModelinmodels/Book.tsbookinSystemModel.searchMapso books can be queried through the common search entrypointSearch result rendering
pages/search/[model]/index.tsxbookresults to the existing Open Library book card presentationAPI support for search
pages/api/open-library/books.tsto support:Response shape
Human changes