Skip to content

fix: support the classic sidebar when the navigation rail is absent - #451

Closed
M2niwa wants to merge 2 commits into
mainfrom
fix/classic-sidebar-fallback
Closed

M2niwa wants to merge 2 commits into
mainfrom
fix/classic-sidebar-fallback

Conversation

@M2niwa

@M2niwa M2niwa commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Refs #446

Merges PR #447 from @liar177, preserving the contributor's commit and authorship.

When Codex renders the classic expanded sidebar (\data-app-shell-feature-navigation=false\), the Taskboard entry never mounted and, even when forced, clicking it did nothing — five places in \inject/codex-taskboard.user.js\ hard-depend on \
av[data-app-navigation-rail]\.

The fix keeps the rail as the preferred path with unchanged behavior and only falls back when the rail is absent:

  • entry location: rail first, then Explore → Plugins → last top-level button inside \[data-app-action-sidebar-scroll]\
  • entry label: fall back to \.text-fade-truncate\ so the svg icon survives
  • page mount surface: fall back to \�iewport.parentElement\ (inside \main\) and return \
    ail: null\
  • left offset and \ itlebarLeftInset()\ branch on whether the rail exists

Verification:

  • \
    ode --check inject/codex-taskboard.user.js\ passes
  • \
    ode --test test/inject.test.mjs\ 36/36
  • \
    pm run typecheck\ and \
    pm run build:web\ pass
  • \git diff --check\ clean

Note: existing fixtures only render the rail form, so the classic fallback branch has no test coverage. That gap is left as-is, matching the contributor's scope.

liar177 and others added 2 commits October 10, 2026 11:29
Codex renders either the compact navigation rail or the classic expanded
sidebar depending on its own feature flags, so the injected entry and the
panel mount were both lost whenever the rail was not present.

- findReferenceButton falls back to the sidebar's Explore/Plugins button
- createEntry also recognises the sidebar's .text-fade-truncate label, so
  rewriting the entry text keeps its icon
- findPageMount falls back to the viewport container when there is no rail
- mountActivePage and titlebarLeftInset no longer assume a rail exists
@M2niwa

M2niwa commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

与 #447 内容重复,误开。经比对,本 PR 的代码 diff 与 #447 字节级完全相同(同为基础 main@6a79ef5,同为 inject/codex-taskboard.user.js +53/-5),且同样保留了 @liar177 的原始提交与作者信息,没有增加任何价值。按仓库规则应直接改进并合入外部贡献者的 #447,而不是另开替代 PR。关闭本 PR,改由 #447 承担该修复。

@M2niwa M2niwa closed this Oct 15, 2026
@M2niwa
M2niwa deleted the fix/classic-sidebar-fallback branch October 15, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants