-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Web - Workspace - Workspace More menu opens on the left #58492
Comments
Triggered auto assignment to @CortneyOfstad ( |
🚨 Edited by proposal-police: This proposal was edited at 2025-03-14 15:25:28 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Workspace - Workspace More menu opens on the left What is the root cause of that problem?In #56594 we changed the menu anchor position to be calculated onLayout instead of onPress App/src/pages/workspace/WorkspacesListRow.tsx Lines 171 to 182 in b09e2d1
onLayout is being called too early in this case and the anchor position will be miscalculated
What changes do you think we should make in order to solve the problem?We used this approach to solve a bug related with search menu item so we can revert it for this cases and others that cause a problem and set the anchor position onPress
Or optionally we can give the calculation any kind of delay and it will fix the problem, for instance, setTimeout like:
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?N / A - UI bug What alternative solutions did you explore? (Optional)Alternatively we can reimplement the solution in #56594. We can revert it to change it back to calculating the anchor position on press but to solve the original issue we will make onIconPress to return a promise that will resolve inside App/src/components/ThreeDotsMenu/index.tsx Lines 71 to 74 in b09e2d1
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - Workspace - Workspace More menu opens on the left What is the root cause of that problem?We are calculating three dots position in onLayout function App/src/pages/workspace/WorkspacesListRow.tsx Lines 169 to 183 in b09e2d1
but there will be cases where onLayout is called too early, leading to incorrect calculations. What changes do you think we should make in order to solve the problem?We can use onLayout={(e: LayoutChangeEvent) => {
if (shouldUseNarrowLayout) {
return;
}
InteractionManager.runAfterInteractions(() => {
const target = e.target || (e as LayoutChangeEventWithTarget).nativeEvent.target;
target?.measureInWindow((x, y, width) => {
setThreeDotsMenuPosition({
horizontal: x + width,
vertical: y,
});
});
});
}} What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?None UI bug What alternative solutions did you explore? (Optional)Or we can use the useEffect with viewRef const viewRef = useRef<View>(null);
useEffect(() => {
if (!shouldUseNarrowLayout && viewRef.current) {
viewRef.current.measureInWindow((x, y, width) => {
setThreeDotsMenuPosition({
horizontal: x + width,
vertical: y,
});
});
}
}, [shouldUseNarrowLayout, viewRef]);
<View ref={viewRef} onLayout={() => {}} /> Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
Added alt section |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.1.13-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Workspace Settings
Action Performed:
Precondition:
Expected Result:
More menu will open at where the 3-dot menu is.
Actual Result:
More menu opens on the left.
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6770613_1741956703547.20250314_204729.mp4
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: