Skip to content

Conversation

@mattConnHarbour
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Jan 6, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 81c48eb01e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +29 to +33
setTimeout(() => {
const documents = editor.superdocStore.documents;
const presentationEditor = documents[0]?.getPresentationEditor();

if (presentationEditor) {

Choose a reason for hiding this comment

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

P2 Badge Avoid computing page count before documents finish loading

The onEditorCreate callback runs as soon as the editor instance is created, but document initialization in superdocStore.init is async (it awaits file/URL loading). With the fixed setTimeout(100) here, editor.superdocStore.documents can still be empty for larger files or remote URLs, so presentationEditor stays undefined and the page count is never displayed. This shows up when users load a real document via the file picker: the UI stays blank even though the document eventually renders. Consider waiting for a document-ready signal (e.g., a store-ready flag/event) or recomputing when pages become available rather than using a hard-coded delay.

Useful? React with 👍 / 👎.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please assess if this is relevant or not

@mattConnHarbour
Copy link
Contributor Author

@caio-pizzol Could I get your review on this when you get a chance? This adds page count to the vanilla SuperDoc example.
You can test it here: https://superdoc-page-count.pages.dev/

Copy link
Contributor

@caio-pizzol caio-pizzol left a comment

Choose a reason for hiding this comment

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

Let's respond to codex comment + example deploy (do we actually need to deploy it?)

Comment on lines +29 to +33
setTimeout(() => {
const documents = editor.superdocStore.documents;
const presentationEditor = documents[0]?.getPresentationEditor();

if (presentationEditor) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please assess if this is relevant or not

@@ -0,0 +1,21 @@
name = "superdoc-page-count"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why cloudflare pages? :)

I thought we agreed on Github pages instead

"superdoc": "1.2.1"
},
"devDependencies": {
"vite": "^4.4.6"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's update devDeps as well

npx npm-check-updates -u

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