-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
When switching themes switch the figma native theme mode selector if possible #2336
Open
robinhoodie0823
wants to merge
12
commits into
main
Choose a base branch
from
2187-when-switching-themes-switch-the-figma-native-theme-mode-selector-if-possible
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
11ec40d
add console logs to figure out issues
robinhoodie0823 76fb981
clean console log
robinhoodie0823 4fdd735
Merge branch 'main' of https://github.com/tokens-studio/figma-plugin …
robinhoodie0823 a45930e
apply style to figma check
robinhoodie0823 99d2004
switching active theme in plugin
robinhoodie0823 e8026a1
resolve comments
robinhoodie0823 31099b0
feat: add changeset
robinhoodie0823 64a4de2
Merge branch 'main' of https://github.com/tokens-studio/figma-plugin …
robinhoodie0823 253eca3
update: update the logic
robinhoodie0823 c1b0204
Merge branch 'main' of https://github.com/tokens-studio/figma-plugin …
robinhoodie0823 3fbd4d7
update to pass test case
robinhoodie0823 21f2ae5
feat: add changest
robinhoodie0823 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 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 | ||||
---|---|---|---|---|---|---|
|
@@ -122,6 +122,16 @@ export class AsyncMessageChannel { | |||||
this.attachMessageListener((msg: IncomingMessageEvent<AsyncMessageResults & { type: Message['type'] }>['data']['pluginMessage']) => { | ||||||
if (msg.id === messageId) { | ||||||
if ('message' in msg) { | ||||||
if (msg.message.type === 'async/get-theme-info') { | ||||||
if ('activeTheme' in msg.message && 'themes' in msg.message) { | ||||||
const { activeTheme } = msg.message; | ||||||
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.
Suggested change
|
||||||
const { themes } = msg.message; | ||||||
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.
Suggested change
|
||||||
const activeMode = themes.filter((theme) => theme.id === Object.values(activeTheme)[0])[0]; | ||||||
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.
Suggested change
|
||||||
figma.currentPage.children.forEach((frame) => { | ||||||
frame.setExplicitVariableModeForCollection(activeMode.$figmaCollectionId ?? '', activeMode.$figmaModeId ?? ''); | ||||||
}); | ||||||
} | ||||||
} | ||||||
resolve(msg.message); | ||||||
} else { | ||||||
reject(msg.error); | ||||||
|
This file contains 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.
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.
i dont think this belongs here. this file doesnt have any of the other message handlers, this needs to go elsewhere where we define those.
figma-plugin/src/app/components/Initiator.tsx
Line 31 in 1424c9f
this feels like the right place