-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(core): new template doc property #9538
base: canary
Are you sure you want to change the base?
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
5935bbf
to
70fdcf3
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## canary #9538 +/- ##
==========================================
- Coverage 52.93% 52.63% -0.30%
==========================================
Files 2170 2174 +4
Lines 97494 97614 +120
Branches 16646 16625 -21
==========================================
- Hits 51609 51384 -225
- Misses 44471 44790 +319
- Partials 1414 1440 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
packages/frontend/core/src/components/blocksuite/block-suite-editor/lit-adaper.tsx
Outdated
Show resolved
Hide resolved
a136e6d
to
f8bfa51
Compare
const disposable = doc.slots.blockUpdated.on(() => { | ||
const empty = doc.isEmpty; | ||
setIsEmpty(empty); | ||
// once the doc is not empty, stop checking |
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.
what if user delete all the content?
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.
It is acceptable to display the Starter only when it is empty for the first time; otherwise, any edits need to check whether the document is empty.
} | ||
|
||
public getTemplateDocs() { | ||
return Object.values(this.docsService.allDocProperties$.value) |
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.
what about use this.listStore.getTemplateDocIds()
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.
you can add a watch version this.listStore.watchTemplateDocIds()
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.
Watch is unnecessary for now since the list will only show in popup.
packages/frontend/core/src/modules/doc/entities/property-list.ts
Outdated
Show resolved
Hide resolved
}; | ||
|
||
export const StarterBar = ({ doc }: { doc: Blocks }) => { | ||
const [isEmpty, setIsEmpty] = useState(doc.isEmpty); |
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.
It seems that this will never be empty, because doc has at least one note
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.
The empty judgment logic has been refactored in #9570
f8bfa51
to
e484196
Compare
e484196
to
0905ead
Compare
close AF-2045, AF-2047, AF-2065