Skip to content

Conversation

@jonkafton
Copy link
Contributor

@jonkafton jonkafton commented Nov 13, 2025

What are the relevant tickets?

N/A

Description (What does it do?)

  • Refactors common create/update logic to the new ArticleEditor component (replaces EditorContainer).
  • Updates layout for full width header fixed toolbar.
  • Title input moved into shared component.
  • Save button moved to toolbar.
  • Error messaging from query hooks (replaces onError handling).
  • Removes /article/new route from initial editor PR, Initial Tiptap Editor #2691.

Screenshots (if appropriate):

image

How can this be tested?

Additional Context

Copy link
Contributor

@ahtesham-quraish ahtesham-quraish left a comment

Choose a reason for hiding this comment

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

Your Changes look good to me!

@ahtesham-quraish
Copy link
Contributor

ahtesham-quraish commented Nov 13, 2025

@jonkafton there is bug in your code

const [json, setJson] = useState<JSONContent>({
   type: "doc",
   content: article?.content
     ? JSON.parse(article.content)
     : [{ type: "paragraph", content: [] }],
 })

You dont need to parse the content here, the content is already in json shap.

2 - Secondly you need to initialize the state properly.

This should be

const [json, setJson] = useState<JSONContent>({
    type: "doc",
    content: article?.content
      ? article.content
      : [{ type: "paragraph", content: [] }],
  })

replace with following

const [json, setJson] = useState<JSONContent>(article?.content || {
    type: "doc",
    content: [{ type: "paragraph", content: [] }],
  })

with your code it does not work for me I have to make changes locally to get this work

@ahtesham-quraish
Copy link
Contributor

After editing the article it should lead me to article detail page which is not happening RN

@ahtesham-quraish
Copy link
Contributor

There is one more issue related to initializing the editor state from existing article

Currently we have in code.

content: value || {
      type: "doc",
      content: [{ type: "paragraph", content: [] }],
    },

it should be replaced with this

content: json || value || {
      type: "doc",
      content: [{ type: "paragraph", content: [] }],
   },

then it will show the article content.

@jonkafton
Copy link
Contributor Author

thanks @ahtesham-quraish . Not ready for review just yet

@jonkafton
Copy link
Contributor Author

it should be replaced with this

content: json || value || {
type: "doc",
content: [{ type: "paragraph", content: [] }],
}

We're not actually using the value prop. Check 3dc59f6, which removes the useEffect() as we have a state controlled component.

@ahtesham-quraish
Copy link
Contributor

it should be replaced with this

content: json || value || {
type: "doc",
content: [{ type: "paragraph", content: [] }],
}

We're not actually using the value prop. Check 3dc59f6, which removes the useEffect() as we have a state controlled component.

Yeah totally fine.

@jonkafton jonkafton changed the base branch from ahtesham/consume-tiptap to main November 13, 2025 13:47
@github-actions
Copy link

github-actions bot commented Nov 13, 2025

OpenAPI Changes

Show/hide No detectable change.

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Copy link
Contributor

@ahtesham-quraish ahtesham-quraish left a comment

Choose a reason for hiding this comment

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

LGTM!

@jonkafton jonkafton merged commit 8563fe5 into main Nov 13, 2025
13 checks passed
@jonkafton jonkafton deleted the jk/article-editor-layout branch November 13, 2025 18:42
@odlbot odlbot mentioned this pull request Nov 17, 2025
16 tasks
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