Skip to content

[#74710] show inline page link macros in editing mode#23142

Merged
Kharonus merged 8 commits into
devfrom
feature/74710-render-macro-in-ckeditor-editing-mode
May 19, 2026
Merged

[#74710] show inline page link macros in editing mode#23142
Kharonus merged 8 commits into
devfrom
feature/74710-render-macro-in-ckeditor-editing-mode

Conversation

@Kharonus
Copy link
Copy Markdown
Member

@Kharonus Kharonus commented May 8, 2026

Ticket

#74710

What are you trying to accomplish?

  • show inline page link macros while editing with ckeditor

What approach did you choose and why?

  • show page link as turbo frame
  • add route for loading the macro
  • update ckeditor build

Related PR

opf/commonmark-ckeditor-build#115

- https://community.openproject.org/work_packages/74710
- show page link as turbo frame
- add route for loading the macro
- update ckeditor build
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Caution

The provided work package version does not match the core version

Details:

Please make sure that:

  • The work package version OR your pull request target branch is correct

Copy link
Copy Markdown
Contributor

@NobodysNightmare NobodysNightmare left a comment

Choose a reason for hiding this comment

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

This PR LGTM mostly.

Exclusions:

  • I did not yet look at the underlying CKEditor changes, those still require a review
  • I think we can remove the provider from the InlinePageLinkMacroComponent

Comment thread modules/wikis/app/components/wikis/inline_page_link_macro_component.rb Outdated
Comment thread modules/wikis/app/services/wikis/text_formatting/wiki_link_matcher.rb Outdated
Comment thread modules/wikis/app/controllers/wikis/page_link_controller.rb Outdated
Comment thread frontend/src/app/core/path-helper/path-helper.service.ts Outdated
Comment thread frontend/src/app/core/path-helper/path-helper.service.ts Outdated
Copy link
Copy Markdown
Contributor

@NobodysNightmare NobodysNightmare left a comment

Choose a reason for hiding this comment

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

I left some additional low-profile comments on this PR. They are easier not important or easy to fix.

However, after testing the change locally (now that the previously mentioned error is gone), I found some edge cases in cursor movement. See my comment on the related PR.

Comment thread modules/wikis/app/controllers/wikis/page_link_controller.rb
Comment thread modules/wikis/app/controllers/wikis/page_link_controller.rb Outdated
Comment thread modules/wikis/app/controllers/wikis/page_link_controller.rb Outdated
Comment thread modules/wikis/app/views/wikis/page_link/load.html.erb Outdated
Comment thread modules/wikis/app/services/wikis/text_formatting/wiki_link_matcher.rb Outdated
- drop before action in controller for more comprehensive code logic
@Kharonus Kharonus requested a review from NobodysNightmare May 19, 2026 10:08
Copy link
Copy Markdown
Contributor

@NobodysNightmare NobodysNightmare left a comment

Choose a reason for hiding this comment

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

Sorry for those two late comments.

In general the PR looks good to me. I think the 🟡 comment should be addressed and the 🟢 comment _could be addressed.

In any case, after fixing what you fixed, you can go ahead with a merge yourself.

end
end

resource :wiki_page_link_macro, controller: "wikis/page_link" do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Last thing that I noticed so late, that it feels weird to bring this up now: I saw that the controller was called PageLinksController, which felt weird to me, because page_links#load could mean anything.

Seeing that the route is already called wiki_page_link_macro improves this a lot for me. I'd still prefer if the controller was equally named wikis/page_link_macro.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The controller was renamed in the follow up PR - #23193 - to be better distinguished to the other page link related controllers.

end
end

resource :wiki_page_link_macro, controller: "wikis/page_link" do
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Another thing that I noticed pretty late in the review, the use of resource adds a bunch of default routes here. None of which you need:

Image

What you want to do is add only: %i[], so that none of the default are auto-generated.

Also see the lines below for this.

Copy link
Copy Markdown
Member Author

@Kharonus Kharonus May 19, 2026

Choose a reason for hiding this comment

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

yes, this was a flaw I also detected when working on the next iteration, the PR #23193 has some changes here, changing the route definition to

  resource :wiki_page_link_macro, controller: "wikis/inline_page_link_macro", only: [] do
    get :load
  end

@Kharonus Kharonus merged commit f04fc08 into dev May 19, 2026
21 checks passed
@Kharonus Kharonus deleted the feature/74710-render-macro-in-ckeditor-editing-mode branch May 19, 2026 14:03
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants