A site cannot override an installed app's route for a role with an external route
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
Start with runtime/routing/utils.ts, especially getUrlByRouteRole, and trace how resolveRouteByRole and getLinkProps use it. The issue describes precedence between app routes and externalRoutes but leaves the override behavior and duplicate-role reporting as design questions. Done means the issue's intended precedence is decided and role resolution follows it; the payload names no tests to run.
索引モデルが issue の本文から書いたものです。
説明
An app that declares a route for a role always wins over the site's externalRoutes for that role, so a site cannot send a role an installed app declares to a destination of its own. Found while planning to move Learning's tab links onto route roles (openedx/frontend-app-learning#2190, part of #1905): once it does, an operator who wants Learning's dates or outline link to go somewhere else has no way to say so.
[!NOTE]
The details below were generated by Claude (Claude Code) and reviewed before posting.
Claude Plan
How a role resolves today
getUrlByRouteRolewalkssiteConfig.appsin list order and each app's route tree depth-first, and returns the first route whosehandle.rolesincludes the role. Only when no app declares the role does it readsiteConfig.externalRoutes, again first match. There is no check for a second match and no warning, so when two apps declare the same role the one listed first inappswins silently, and an external route for a role any app declares is never consulted.resolveRouteByRoleandgetLinkPropsbuild on it, so every link resolved through a role follows the same order.ExternalRouteis a role and a URL; nothing on it or on the site config says it should take precedence.
What the docs say
- The migration guide's URL Config changes: URLs "should now be expressed as part of the
appsconfig as route roles, or asexternalRoutes, and resolved in code viaresolveRouteByRole()". It names both sources and does not say what happens when both declare a role.
Where it bites
- Learning declares
org.openedx.frontend.role.courseDates,courseOutlineandcourseProgresson its routes, which it must for the shell's course bar. Its progress tab is to link to the dates and outline tabs through those roles (openedx/frontend-app-learning#2190). A site that then wants one of those links to go elsewhere cannot express that in site config: an external route for the role is never reached while Learning is installed. - The same holds for any app that declares a role for a page it serves and any site that wants to point that role elsewhere.
Questions
- Should a site be able to override an installed app's route for a role with a destination of its own, without uninstalling the app?
- If so, how does the site say so?
- Should the resolver report when two sources declare the same role?
- 主要言語
- TypeScript
- スター
- 4
- フォーク
- 13
- 平均マージ
- 3日 5時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openedx/frontend-base のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openedx/frontend-base#330 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
openedx/frontend-base#327 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openedx/frontend-base#210 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
openedx/frontend-base#350 ·
-
External routes ignore params対応中かも @arbrandes が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
openedx/frontend-base#349 · 担当者 1 名 ·
openedx/frontend-base の issue をすべて見る
似ている issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
openclaw/openclaw#200365 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
effort: small good first issue priority: medium testing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
TMHSDigital/screencast-mcp#351 ·
メンテナーはふだん 1 日以内に返信
-
area-templates triage:bot-seen triage:needs-human
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/aspire#22356 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Archiving an agent that is not loaded keeps its old updatedAt対応中かも @luoph が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
content triage
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信