fix(czat): data w tabeli w jednej linii, linki w tabeli podkreslone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_016uwxqJbh3fPYdfdLG3MU6f
(cherry picked from commit b12cb5b8b5)
This commit is contained in:
tobayah
2026-11-12 20:39:43 +01:00
parent ca421b3609
commit fab55989dc
2 changed files with 8 additions and 3 deletions
+3
View File
@@ -147,6 +147,9 @@
.ha-table th, .ha-table td { overflow-wrap: normal; }
.ha-table td:first-child { white-space: nowrap; }
.ha-table td:last-child { min-width: 16em; }
.ha-table td.nw { white-space: nowrap; }
/* The platform's links are plain text until hovered; in a table that hides them, so a quiet underline. */
.ha-table a { text-decoration: underline; text-decoration-color: var(--at-border-strong); text-underline-offset: 3px; }
.ha-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--at-text-muted); }
.ha-trace { margin-top: 8px; white-space: normal; overflow-wrap: anywhere; }
.ha-trace summary { cursor: pointer; }
+5 -3
View File
@@ -1331,7 +1331,8 @@ function chatRender(toEnd) {
/* The rows stay whole (the history the model reads next turn is built from them); `view` only says how to draw
them, as plain data so it survives the conversation's storage: `sub` puts one column as a small second line
under another ("procesowy" under the item, the state under the date), `head` renames a column, `dropSame`
leaves out a column whose every row says the same (one owner for all). On a phone each row is a card. */
leaves out a column whose every row says the same (one owner for all), `nowrap` keeps a column on one line.
On a phone each row is a card. */
function chatTableEl({ head, rows, links = [], linkCol = -1, view = {} }) {
const sub = view.sub || {};
const under = new Set(Object.values(sub).map(Number));
@@ -1350,6 +1351,7 @@ function chatTableEl({ head, rows, links = [], linkCol = -1, view = {} }) {
for (const i of cols) {
const td = el('td');
td.dataset.label = label(i);
if ((view.nowrap || []).includes(i)) td.className = 'nw'; // a date is not broken after its year
const href = links[n];
if (i === linkCol && href && (href.startsWith('#') || sameOrigin(href))) {
const a = el('a', null, r[i]);
@@ -2641,14 +2643,14 @@ function chatPick(question, index) {
// read as "no links to the sources" (Tobiasz, 2026-11-06). The list itself opens Sygna's deadlines.
const links = items.map((d) => { const r = index.byKey.get(d.key); return r && r.inner ? moduleHref(r.slug, r.inner) : ''; });
return { empty, rec: { slug: 'sygna', kind: 'zestawienie', key: 'atrium:pilne', title: 'Pilne: pozycje wybrane do odpowiedzi', inner: 'deadlines', text,
members: items.map((d) => d.key) }, table: { head, rows, links, linkCol: 5, view: { sub: { 1: 2, 3: 4 }, head: { 3: en ? 'Due' : 'Termin' }, dropSame: [6] } } };
members: items.map((d) => d.key) }, table: { head, rows, links, linkCol: 5, view: { sub: { 1: 2, 3: 4 }, head: { 3: en ? 'Due' : 'Termin' }, dropSame: [6], nowrap: [3] } } };
}
const chatIsEn = (question) => !/[ąćęłńóśźż]/i.test(question) && /(?:^|\W)(?:the|what|which|is|are|how|english)(?!\w)/i.test(question);
function chatContractTable(cs, today, en) {
const head = en ? ['No.', 'Contract', 'Counterparty', 'Ends', 'Days left', 'Status', 'Value'] : ['Lp.', 'Umowa', 'Kontrahent', 'Koniec', 'Zostało dni', 'Status', 'Wartość'];
return { head, rows: cs.map((c, i) => [String(i + 1), `${c.number} ${c.name}`, c.counterparty || '-', c.ends_on || '-',
c.ends_on ? String(chatDays(c.ends_on, today)) : '-', c.status, c.value_amount ? `${chatMoney(c.value_amount)} ${c.value_currency}` : '-']),
view: { sub: { 3: 4 } } };
view: { sub: { 3: 4 }, nowrap: [3] } };
}
const chatTableText = (t) => [t.head, ...t.rows].map((r) => '| ' + r.join(' | ') + ' |').join('\n');
function chatListFor(sources, question) {