Documentation Navigation preferences bug
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nextjs, react, typescript
调研方向
从 src/components/DocsNavigation/index.tsx 开始,重点查看 openTopicPreferences 状态及其 localStorage effect。直接打开一个文档页面来复现问题,然后将行为和提议的处理方式与 PR #439 进行比较。当当前导航组被高亮并展开,且不会丢失预期的 preference 行为时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Possibly related PR - https://github.com/payloadcms/website/pull/439
If you navigate directly to a page (e.g. via URL or external navigation), the current nav group is highlighted, but not expanded. The expanded state is determined by the last page you clicked on or navigated to via the nav itself, however arriving at a page through other means results in this buggy state.
The issue seems to be related to the "openTopicPreferences" state in the DocsNavigation component. Claude Code suggested this fix, however it seems it might defeat the entire purpose of the "preferences" idea. Personally, I'd prefer an accurate nav bar over one that remember what I clicked on at 3am this morning.
// src/components/DocsNavigation/index.tsx:56
useEffect(() => {
const preference = window.localStorage.getItem(openTopicsLocalStorageKey)
if (preference) {
const parsedPreference = JSON.parse(preference)
// Ensure the current topic is always included in the open topics
if (!parsedPreference.includes(currentTopic)) {
const updatedPreference = [...parsedPreference, currentTopic]
setOpenTopicPreferences(updatedPreference)
window.localStorage.setItem(openTopicsLocalStorageKey, JSON.stringify(updatedPreference))
} else {
setOpenTopicPreferences(parsedPreference)
}
} else {
setOpenTopicPreferences([currentTopic])
}
}, [currentTopic])
- 主要语言
- TypeScript
- 星标
- 643
- 派生
- 193
- 平均合并
- 17 小时 9 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
payloadcms/website 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 42/100
payloadcms/website#495 ·
-
Invalid images.remotePatterns entry crashes next dev可能已有人在做 @aldoprogrammer 于 323 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 48/100
payloadcms/website#490 ·
-
"Payload Guides & Tutorials" contributions可能重新可做 @zubricks 于 511 天前认领,目前没有进行中的 PR。 未关闭
payloadcms/website#468 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 35/100
payloadcms/website#459 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
payloadcms/website#431 ·
查看 payloadcms/website 的全部 Issue
相似的 Issue
-
[BUG]: Shared links drop the configured basePath on GitHub Pages可能已有人在做 @anshulchikhale30-p 今天认领。 未关闭bug
难度 1/5 1 小时以内 新手友好度 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 条评论 ·
维护者通常 1 天内回复
-
Add: GTrekker未关闭check:passed streams:add
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
维护者通常 1 天内回复
-
area: ui Bug Payload OSS
难度 1/5 1 小时以内 新手友好度 88/100
payloadcms/payload#19839 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复