Repository navigation
fix(canvas): add Layer properties to the layer menu #10133
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
2c78523
e464722
9bcff8d
6a88a82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,3 +27,27 @@ export const useRevealLayerProperties = (): ((layerId: string) => void) => { | |
| [registry, widgets] | ||
| ); | ||
| }; | ||
|
|
||
| /** How long a reveal waits for the Properties pane, just opened, to render the Layer section. */ | ||
| const REVEAL_WAIT_MS = 1500; | ||
|
|
||
| /** | ||
| * Scrolls the Properties pane to its Layer section, which sits below the active tool's settings and often starts out of | ||
| * view. The caller opens the pane first; a reveal whose pane never renders gives up quietly. | ||
| */ | ||
| export const revealLayerSection = (): void => { | ||
| const deadline = performance.now() + REVEAL_WAIT_MS; | ||
|
|
||
| const attempt = () => { | ||
| const section = [...document.querySelectorAll<HTMLElement>('[data-properties-section="layer"]')].find( | ||
| (element) => element.getClientRects().length > 0 | ||
| ); | ||
| if (section) { | ||
| section.scrollIntoView({ block: 'nearest' }); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] The shortcut can leave the section’s initial controls offscreen. After scrolling down within a tall Layer section, choosing Layer properties may do nothing: |
||
| } else if (performance.now() < deadline) { | ||
| requestAnimationFrame(attempt); | ||
| } | ||
| }; | ||
|
|
||
| requestAnimationFrame(attempt); | ||
| }; | ||
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.
[P2] Layer properties can show the child’s settings instead.
Select a regional reference image, mask modifier, or raster adjustment; then right-click its parent and choose Layer properties. The parent is already selected, and this action never clears child selection. The pane therefore retains the child editor—for example, reference-image controls instead of regional prompts. Clear child selection in this action and test that transition.