feat(forecast): expose DOCX & PPTX export buttons (#958) #1121

Merged
bot-backend merged 1 commit from feat/forecast-docx-pptx-buttons into main 2026-06-07 10:13:25 +00:00
Collaborator

Что

Кнопки «Скачать .docx» (Word) и «Скачать .pptx» (PowerPoint) в ForecastExportButtons рядом с существующими .md / .json / Telegram. Backend /forecast/export?format=docx|pptx уже рендерил оба формата — они просто не были доступны из UI.

Относится к #958 (EPIC 14: мульти-экспорт прогноза).

Корректность

  • Оба формата идут через существующий response.blob()triggerDownload путь — корректно для бинарных zip-based OOXML (никогда .text(), который повредил бы архив). Existing .md/.json уже на blob-пути, latent-corruption риска не было.
  • Backend-контракт сверен (parcels.py /forecast/export): format = Literal["md","json","tg","docx","pptx"]; docx → application/vnd.openxmlformats-officedocument.wordprocessingml.document, pptx → …presentationml.presentation; not-ready → 404 (не 202) → существующий UI-путь «Отчёт ещё не готов» уже покрывает.
  • Per-format loading state (одна загрузка не блокирует другие навсегда); cad через encodeURIComponent; aria-labels; иконки FileText/Presentation из уже подключённого lucide-react (без новых deps).

Качество

  • Diff +32/-3, один файл, переиспользует уже-задеплоенный протестированный download-путь (без новой логики). npm run build зелёный, prettier чисто, no any, no console.log, токены, RU. Self-reviewed (полный diff прочитан orchestrator'ом) — изменение тривиальное, без security-поверхности.

Тест-план (post-deploy)

/site-finder/analysis/66:41:0702048:27 → Секция 6 → ряд экспорта: 5 кнопок (.md · Telegram · .json · .docx · .pptx); .docx/.pptx скачивают корректно именованные Office-файлы; на участке без прогноза — «Отчёт ещё не готов».

## Что Кнопки **«Скачать .docx»** (Word) и **«Скачать .pptx»** (PowerPoint) в `ForecastExportButtons` рядом с существующими .md / .json / Telegram. Backend `/forecast/export?format=docx|pptx` уже рендерил оба формата — они просто не были доступны из UI. Относится к #958 (EPIC 14: мульти-экспорт прогноза). ## Корректность - Оба формата идут через **существующий `response.blob()` → `triggerDownload`** путь — корректно для бинарных zip-based OOXML (никогда `.text()`, который повредил бы архив). Existing .md/.json уже на blob-пути, latent-corruption риска не было. - Backend-контракт сверен (`parcels.py` `/forecast/export`): `format` = `Literal["md","json","tg","docx","pptx"]`; docx → `application/vnd.openxmlformats-officedocument.wordprocessingml.document`, pptx → `…presentationml.presentation`; not-ready → **404** (не 202) → существующий UI-путь «Отчёт ещё не готов» уже покрывает. - Per-format loading state (одна загрузка не блокирует другие навсегда); `cad` через `encodeURIComponent`; aria-labels; иконки `FileText`/`Presentation` из уже подключённого `lucide-react` (без новых deps). ## Качество - Diff +32/-3, один файл, переиспользует уже-задеплоенный протестированный download-путь (без новой логики). `npm run build` зелёный, prettier чисто, no `any`, no console.log, токены, RU. Self-reviewed (полный diff прочитан orchestrator'ом) — изменение тривиальное, без security-поверхности. ## Тест-план (post-deploy) `/site-finder/analysis/66:41:0702048:27` → Секция 6 → ряд экспорта: 5 кнопок (.md · Telegram · .json · **.docx** · **.pptx**); .docx/.pptx скачивают корректно именованные Office-файлы; на участке без прогноза — «Отчёт ещё не готов».
bot-backend added the
scope/frontend
GG-форсайт
site-finder
labels 2026-06-07 10:13:22 +00:00
bot-backend added 1 commit 2026-06-07 10:13:22 +00:00
feat(forecast): expose DOCX & PPTX export buttons in forecast UI
All checks were successful
CI / changes (pull_request) Successful in 5s
CI / backend-tests (pull_request) Has been skipped
Deploy / changes (push) Successful in 5s
Deploy / build-backend (push) Has been skipped
Deploy / build-worker (push) Has been skipped
CI / changes (push) Successful in 6s
CI / backend-tests (push) Has been skipped
Deploy / build-frontend (push) Successful in 28s
Deploy / deploy (push) Successful in 1m0s
7131bed1f4
Add «Скачать .docx» (Word) and «Скачать .pptx» (PowerPoint) buttons to
ForecastExportButtons, alongside the existing .md/.json/Telegram controls.
The backend /forecast/export already renders both formats; they were just
not reachable from the UI. Both reuse the existing response.blob() →
triggerDownload path (correct for binary zip-based OOXML — never .text(),
which would corrupt the archive). Per-format loading state; 404 →
«Отчёт ещё не готов». No new deps (icons from lucide-react).

Part of #958.
bot-backend merged commit 7131bed1f4 into main 2026-06-07 10:13:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#1121
No description provided.