Record the width of some Protyle elements in the attributes - #15043
Merged
Conversation
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the setPadding function to fix width calculation issues and improve editor layout management. The changes address dynamic padding changes causing inaccurate data-realwidth attributes and remove a global style element that caused max-width conflicts.
- Refactored width calculations to compute values before setting padding styles
- Introduced CSS custom properties (
--b3-width-protyle,--b3-width-protyle-content,--b3-width-protyle-wysiwyg) for better width management - Removed
#editorAttrelement and replaced with CSS custom property for bookmark icon tooltips
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| kernel/conf/editor.go | Updated comment for DisplayBookmarkIcon field to clarify it controls content block badge display |
| app/src/protyle/ui/initUI.ts | Refactored setPadding to compute widths before applying styles, added CSS custom properties, removed dynamic style element generation |
| app/src/assets/template/desktop/index.tpl | Removed #editorAttr style element |
| app/src/assets/template/app/window.tpl | Removed #editorAttr style element |
| app/src/assets/template/app/index.tpl | Removed #editorAttr style element |
| app/src/assets/scss/protyle/_wysiwyg.scss | Added max-width style using new CSS custom property for tooltip width constraint |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
@Vanessa219 这样改不对吧,setAttribute 之后再 getAttribute 得到的是同一个数,然后后面 return 的始终是 0。
|
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.


.protyle,.protyle-contentand.protyle-wysiywg. #15021