/* ObsiGate — XLSX command bar builder (#154-A5). * * Pure string builder for the spreadsheet shell (sheet tabs + grouped action * buttons + status pills). Extracted from frontend/js/viewer.js so the markup * is testable and the viewer only wires behaviour. */ import { t } from '../i18n.js'; import { escapeHtml } from '../utils.js'; /** * @param {object} ctx * @param {Array<{name: string}>} ctx.sheets * @param {boolean} ctx.isCsv * @param {boolean} ctx.readOnly * @param {boolean} ctx.editable - not a CSV and not read-only * @returns {{ tabs: string, actionsHtml: string, statusBar: string }} */ export function buildCommandBar({ sheets, isCsv, readOnly, editable }) { // Sheet tabs are always rendered (even for a single sheet) so the strip reads // as a real affordance; an editable workbook gets an explicit “+” button. const tabs = isCsv ? "" : `