You can use the following to prevent the issues, it checks for links that contain “Edit with Bricks” then whenever those are clicked it opens the editor in a new tab preventing the issues from push state and lack of document cotnent not loading with UIPress.
function add_bricks_target_blank() {
if (is_admin()) {
echo '<script>
document.addEventListener("DOMContentLoaded", function() {
const bricksLinks = Array.from(document.getElementsByTagName("a")).filter(link =>
link.textContent.trim() === "Edit with Bricks"
);
bricksLinks.forEach(link => {
link.setAttribute("target", "_blank");
});
});
</script>';
}
}
add_action('admin_footer', 'add_bricks_target_blank');