Make "Open in new window" respect project-type#2260
Conversation
Previously the URL was hardcoded to /project/<code>/browse, which is wrong for fwdata projects (/fwdata/<name>/browse) and for paratext- embedded projects (/paratext/...). Read projectType, projectCode, and inParatext from the ProjectContext at invocation time so the context is fully initialized when used.
UI unit Tests 1 files 59 suites 30s ⏱️ Results for commit 70f096a. ♻️ This comment has been updated with latest results. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesProjectContext Injection into MultiWindowService
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
C# Unit Tests165 tests 165 ✅ 19s ⏱️ Results for commit 70f096a. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/viewer/src/lib/services/multi-window-service.ts (1)
43-44: ⚡ Quick win
new URL(location.href)is only used to read.hash– preferlocation.hashdirectly.
location.hashreturns the exact same value (including the#prefix or empty string) with no object allocation.♻️ Proposed simplification
- const url = new URL(location.href); - await this.openNewWindow(`${browsePath}?${entryBrowseParams(entryId)}${url.hash}`, SM_VIEW_MAX_WIDTH); + await this.openNewWindow(`${browsePath}?${entryBrowseParams(entryId)}${location.hash}`, SM_VIEW_MAX_WIDTH);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/viewer/src/lib/services/multi-window-service.ts` around lines 43 - 44, The code unnecessarily constructs new URL(location.href) just to read .hash; replace that allocation by using location.hash directly in the call to openNewWindow so the URL becomes `${browsePath}?${entryBrowseParams(entryId)}${location.hash}` (update the call site where openNewWindow is invoked, referencing openNewWindow, entryBrowseParams and SM_VIEW_MAX_WIDTH).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@frontend/viewer/src/lib/services/multi-window-service.ts`:
- Around line 43-44: The code unnecessarily constructs new URL(location.href)
just to read .hash; replace that allocation by using location.hash directly in
the call to openNewWindow so the URL becomes
`${browsePath}?${entryBrowseParams(entryId)}${location.hash}` (update the call
site where openNewWindow is invoked, referencing openNewWindow,
entryBrowseParams and SM_VIEW_MAX_WIDTH).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 99ceaef5-5cbf-4fb5-ba5f-27f78ae1e225
📒 Files selected for processing (1)
frontend/viewer/src/lib/services/multi-window-service.ts
3d53a22 to
70f096a
Compare
Resolves #2261