Repository navigation
Conversation
- Add a Browse picker (Novels/Fanfics); Fanfics browses /stories/fanfic
with the selected sort, complementing the existing fanfic keyword search
- Add a Tag picker listing all 82 tags currently indexed on
webnovel.com/tags, sorted A-Z; selected tags browse the tag's
/tags/{tag}-novel page via a new .g_book_item parser
- Verified live: tag browse (20 items, paginates), fanfic browse,
fanfic keyword search, popular/search/latest/parseNovel/parseChapter
Co-Authored-By: opencode@Anomalyco
[Medium impact] The changes affect the Webnovel source’s browse workflow. Fix the tag initialization, required picker default, and Latest ordering before merging. Findings
SummaryAdds fanfic browsing and an A–Z tag picker to Webnovel, with a separate parser for tag pages. Bumps the plugin to
Reviews (1) · Last reviewed commit: "feat(english/webnovel): add fanfic brows..." · Reviewed by Greptile |
| }, | ||
| tag: { | ||
| label: 'Tag (A-Z browse)', | ||
| options: TAG_OPTIONS, |
There was a problem hiding this comment.
Tag options initialize too late
export default new Webnovel() reads TAG_OPTIONS before the array is initialized below it. In development, importing the plugin throws a ReferenceError. The ES5 build instead captures undefined in filters.tag.options, so opening the filters fails at options.map. Move TAG_OPTIONS above the instance creation.
| tag: { | ||
| label: 'Tag (A-Z browse)', | ||
| options: TAG_OPTIONS, | ||
| type: FilterTypes.Picker, | ||
| }, |
There was a problem hiding this comment.
Tag picker lacks required default
The new tag picker has no value, but Filters requires a string value for every picker. This makes filters fail its satisfies Filters check and the class's PluginBase contract. Add an explicit default, such as value: '0', matching the existing no-tag check.
| tag: { | |
| label: 'Tag (A-Z browse)', | |
| options: TAG_OPTIONS, | |
| type: FilterTypes.Picker, | |
| }, | |
| tag: { | |
| label: 'Tag (A-Z browse)', | |
| value: '0', | |
| options: TAG_OPTIONS, | |
| type: FilterTypes.Picker, | |
| }, |
| }, | ||
| tag: { | ||
| label: 'Tag (A-Z browse)', | ||
| options: TAG_OPTIONS, |
There was a problem hiding this comment.
Selected tags cannot be cleared
The tag picker has no “All” or empty option. After choosing a tag, users must reset every filter to clear it. Changing Browse to Fanfics still returns the tag page because the tag branch runs first. Add a no-tag option with value: '0', which the route already supports.
| options: TAG_OPTIONS, | |
| options: [{ label: 'All', value: '0' }, ...TAG_OPTIONS], |
| filters, | ||
| }: Plugin.PopularNovelsOptions<typeof this.filters>, | ||
| ): Promise<Plugin.NovelItem[]> { | ||
| const sort = filters?.sort?.value || '1'; |
There was a problem hiding this comment.
The new tag and fanfic branches return before checking showLatestNovels. When users select either mode and then switch to Latest, the saved sort remains in effect—orderBy=1 by default—instead of the existing latest order, 5. Honor showLatestNovels when choosing the order in both branches.
Description
/stories/fanficwith the selected sort order)webnovel.com/tags, sorted A-Z; selected tags browse the tag's/tags/{tag}-novelpage via a new.g_book_itemparserwebnovel.tsfrom 1.0.3 to 1.1.0Testing
/tags/academy-novel?pageIndex=1&pageIndex=2returning 20 items per page)/stories/fanfic?orderBy=1&pageIndex=1)