shadok-ai 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/index.html +17 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadok-ai",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "main": "dist/session.js",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test test/*.ts context/*/test/*.test.mjs",
package/public/index.html CHANGED
@@ -879,13 +879,15 @@
879
879
  overflow-x: auto;
880
880
  }
881
881
  .bubble.md pre code { background: none; padding: 0; }
882
+ /* The horizontal scroll for a wide table lives on this wrapper (added in JS
883
+ after sanitising), NOT on the <table>: `display:block` on a table breaks its
884
+ own layout — thead and tbody stop sharing column widths, so the header row
885
+ detaches and misaligns from the body. */
886
+ .bubble.md .md-table-wrap { overflow-x: auto; max-width: 100%; margin: 8px 0; }
882
887
  .bubble.md table {
883
888
  border-collapse: collapse;
884
- margin: 8px 0;
885
889
  font-size: 13px;
886
- display: block;
887
- overflow-x: auto;
888
- max-width: 100%;
890
+ width: auto;
889
891
  }
890
892
  .bubble.md th, .bubble.md td {
891
893
  border: 1px solid var(--line);
@@ -4077,6 +4079,17 @@
4077
4079
  if (role === "claude" && (extraClass === "hist" || extraClass === "live") && window.marked && window.DOMPurify) {
4078
4080
  bubble.classList.add("md");
4079
4081
  bubble.innerHTML = DOMPurify.sanitize(marked.parse(text));
4082
+ // A wide table must be able to scroll sideways WITHOUT `display:block` on
4083
+ // the <table> itself — that turns the thead and tbody into separate stacked
4084
+ // blocks that size their columns independently, so the header detaches from
4085
+ // the body and the columns no longer line up (a real, reported render bug).
4086
+ // The scroll belongs on a wrapper; the table stays a real table.
4087
+ for (const t of bubble.querySelectorAll("table")) {
4088
+ const wrap = document.createElement("div");
4089
+ wrap.className = "md-table-wrap";
4090
+ t.replaceWith(wrap);
4091
+ wrap.appendChild(t);
4092
+ }
4080
4093
  } else {
4081
4094
  bubble.textContent = text;
4082
4095
  }