Skip to content

Conversation

@AllanOXDi
Copy link
Member

@AllanOXDi AllanOXDi commented Dec 11, 2025

Summary

This PR restructures the SafeHtmlTable as a Vue single-file component.
closes #13850

References

#13850

Reviewer guidance

Please see and verify ;

  1. If the new component accurately reproduces the visual and functional behavior of HTML table previously implemented?

@github-actions github-actions bot added DEV: renderers HTML5 apps, videos, exercises, etc. DEV: frontend SIZE: medium labels Dec 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

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

A bit more cleanup I think we can do.

Copy link
Member

Choose a reason for hiding this comment

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

As this prop is no longer being used, I think we can just delete it?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean tableCounter? because I can't see it from this comment

Copy link
Member

Choose a reason for hiding this comment

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

No - the stylingOverrides prop.

Copy link
Member

Choose a reason for hiding this comment

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

Likewise, we can delete styleOverrides here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think the prop being consumed by SafeHtmlImage

return {
functional: true,
render(h) {
const tableChildren = [];
Copy link
Member

Choose a reason for hiding this comment

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

Now that we're just adding safe-html class to the caption - couldn't we just use the passed in mapChildren function here to map the children and then return them - because it already does that!

const vm = this;
return {
functional: true,
render(h) {
Copy link
Member

Choose a reason for hiding this comment

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

This implementation looks correct, but architecturally it introduces a potential source of confusion. We’re creating a functional component inside a computed property of a regular component—essentially building a mini component-factory within the component. This adds layers of complexity we’re trying to move away from.

A cleaner alternative would be to generate the table elements dynamically (not programmatically) and then assigning relevant styling defined within the component itself, thus the redundancy of the style override props.

Our goal is to migrate the current functional component (.js) into an Options API or, ideally, a composable-based component structure. This will help keep the codebase more consistent and maintainable going forward.

Copy link
Member

@akolson akolson left a comment

Choose a reason for hiding this comment

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

Hi Allan! Great start to this refactor. I left a comment that I think is important in better shaping the outcomes of this pr. Thanks

@rtibbles rtibbles self-assigned this Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DEV: frontend DEV: renderers HTML5 apps, videos, exercises, etc. SIZE: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HTML5 Article Renderer] Refactor Table Implementation

3 participants