Repository navigation
[Maintainer] Land #1345, #1305, #1308 from kruschdev, with review fixes #1350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,401
−172
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
65fddeb
core: apply per-fallback-locale plural rules in PascalI18n
cursoragent ec42d13
editor: restore saved camera projection and lens on open and view
cursoragent 42a0696
nodes: make item physical width, height and depth editable in the ite…
cursoragent 365b67c
core: keep active-locale formatting and one resolver for fallback plu…
cursoragent 37284c7
nodes: bound item dimension edits and keep them on the item they star…
cursoragent eb4261a
editor: keep typed measurements exact and make in-field nudges a draft
cursoragent f1a4484
editor: let floor picks and projection changes win over pending camer…
cursoragent a5b3d18
viewer: frame a saved view in its own projection outside the editor
cursoragent 757fa9b
editor: type the level id in the camera level-follow tests
cursoragent 4865eee
viewer: open the standalone viewer on the site view's saved projectio…
cursoragent af4715d
editor: keep the landed opening view's pose across a projection switch
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { describe, expect, test } from 'bun:test' | ||
| import { CameraSchema } from './camera' | ||
| import { SiteNode } from './nodes/site' | ||
|
|
||
| describe('CameraSchema', () => { | ||
| test('parses a legacy { position, target } camera without defaulting mode and round-trips cleanly', () => { | ||
| const legacy = { | ||
| position: [10, 12, 14] as [number, number, number], | ||
| target: [0, 1, 0] as [number, number, number], | ||
| } | ||
|
|
||
| const parsed = CameraSchema.parse(legacy) | ||
| expect(parsed.mode).toBeUndefined() | ||
| expect(parsed.fov).toBeUndefined() | ||
| expect(parsed.zoom).toBeUndefined() | ||
| expect(parsed).toEqual(legacy) | ||
|
|
||
| const roundTripped = CameraSchema.parse(JSON.parse(JSON.stringify(parsed))) | ||
| expect(roundTripped.mode).toBeUndefined() | ||
| expect(roundTripped).toEqual(legacy) | ||
|
|
||
| const site = SiteNode.parse({ | ||
| id: 'site_legacy_cam', | ||
| camera: legacy, | ||
| }) | ||
| expect(site.camera?.mode).toBeUndefined() | ||
| const siteRoundTripped = SiteNode.parse(JSON.parse(JSON.stringify(site))) | ||
| expect(siteRoundTripped.camera).toEqual(legacy) | ||
| expect(siteRoundTripped.camera?.mode).toBeUndefined() | ||
| }) | ||
|
|
||
| test('preserves explicit projection mode and lens fields on round-trip', () => { | ||
| const persp = { | ||
| position: [14, 7, 18] as [number, number, number], | ||
| target: [2, 1.2, -3] as [number, number, number], | ||
| mode: 'perspective' as const, | ||
| fov: 34, | ||
| } | ||
| const ortho = { | ||
| position: [16, 12, 20] as [number, number, number], | ||
| target: [3, 1.5, -2] as [number, number, number], | ||
| mode: 'orthographic' as const, | ||
| zoom: 85, | ||
| } | ||
|
|
||
| expect(CameraSchema.parse(JSON.parse(JSON.stringify(CameraSchema.parse(persp))))).toEqual(persp) | ||
| expect(CameraSchema.parse(JSON.parse(JSON.stringify(CameraSchema.parse(ortho))))).toEqual(ortho) | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tagged plurals skip catalog locale rules
Medium Severity
hasPluralSelectiononly treats a nested array as a message of tokens, so a Lingui element/tag token whose children hold apluralis missed. A fallback-catalog message wrapped in tags then interpolates with the active locale’s plural rules instead of the catalog’s, so forms that differ by region (for exampleptvspt-PTat 0) come out wrong.Reviewed by Cursor Bugbot for commit af4715d. Configure here.