Skip to content
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

fix: get app content out of shadow DOM altogether #2488

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

benschell-okta
Copy link
Contributor

REPLACE_WITH_JIRA_TICKET_NUMBER

Summary

Testing & Screenshots

  • I have confirmed this change with my designer and the Odyssey Design Team.

@benschell-okta benschell-okta requested a review from a team as a code owner January 31, 2025 19:53
@@ -166,6 +132,28 @@ export type UiShellContentProps = {
};
} & UiShellNavComponentProps;

const appWindowStyles = {
border: "1px solid red",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this meant to be in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh, test code, will remove

Comment on lines +147 to +151
elementToStyle.style.setProperty("position", "absolute");
elementToStyle.style.setProperty("top", `${boundingRect.y}px`);
elementToStyle.style.setProperty("left", `${boundingRect.x}px`);
elementToStyle.style.setProperty("width", `${boundingRect.width}px`);
elementToStyle.style.setProperty("height", `${boundingRect.height}px`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be missing something real obvious, but why are we inlining these styles on the element instead of using className or emotion or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're handed a raw HTMLDivElement, so there's not really a good way to do a generated class or emotion or whatnot. Additionally the values are computed, so it would be constantly changing. This is the "good enough" solution IMO.

[hasStandardAppContentPadding, odysseyDesignTokens],
);

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to debounce this? Is this going to run everytime the browser invokes the animate state during a resize in progress?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thought. That (debounce) is the purpose of the requestAnimationFrame / cancelAnimationFrame below on L205-206

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I read more about this after seeing your reply. Interesting that requestAnimationFrame handles this in a performant way.

packages/odyssey-react-mui/src/ui-shell/renderUiShell.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@KevinGhadyani-Okta KevinGhadyani-Okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made over Zoom. Approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants