You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "ngineer420 (via GitHub)" <gi...@apache.org> on 2026/08/26 03:50:47 UTC

Re: [PR] feat: add a banner area below the site header [answer]

ngineer420 commented on PR #1564:
URL: https://github.com/apache/answer/pull/1564#issuecomment-5420323661

   @robinv8 Thanks for the detailed review. All three points are addressed, and the approach changed.
   
   The PR no longer moves `custom_header`. It adds a separate `custom_banner` field and renders it below the site header. `ui/src/components/Customize/index.tsx`, `ui/template/header.html` and `internal/controller/template_controller.go` are now unchanged from `main`. The diff adds 130 lines and removes none.
   
   1. **Breaking change** — gone. The Header area keeps its position and its behaviour. The banner is a separate optional field, and it renders nothing until an admin fills it in.
   2. **Scripts** — `CustomBanner` re-creates the script nodes after it renders the slot, and runs them one time for each value. It wraps only a classic script, so a data block such as `application/ld+json` keeps its content.
   3. **Head and footer refactor** — reverted. `Customize/index.tsx` matches `main` byte for byte, and the `meta[name="go-template"]` skip stays.
   
   Your third point also showed that the first version was wrong in a second way. `App` returns `<InitialLoadingPlaceholder />` on its first render, because `useMergeRoutes` starts with an empty route list. That placeholder is the first commit of the root, and `createRoot` clears the container on the first commit. So React empties `#root` before `Layout` renders at all. A banner painted into `#root` by the server cannot survive that, and the browser has already run its scripts once during parse. The banner is therefore client-rendered only, in the same way as `custom_sidebar` and `CustomSidebar`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org