Fix Ruff errror, update node and fix buttton breakline

This commit is contained in:
Pier-Jean Malandrino 2026-03-23 10:13:24 +01:00
parent f267f6c183
commit 1edd0668d1
5 changed files with 12 additions and 8 deletions

View file

@ -55,7 +55,7 @@ jobs:
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
node-version: 20 node-version: 22
cache: npm cache: npm
cache-dependency-path: frontend/package-lock.json cache-dependency-path: frontend/package-lock.json

View file

@ -208,7 +208,7 @@ def _process_content_item(
# Docling edge case). US Letter dimensions are used as a safe default. # Docling edge case). US Letter dimensions are used as a safe default.
# This may cause slight bbox misalignment on non-Letter pages (e.g. A4). # This may cause slight bbox misalignment on non-Letter pages (e.g. A4).
logger.warning( logger.warning(
"Page %d not found in document metadata — using US Letter fallback (%s×%s pt)", "Page %d not found in document metadata — using US Letter fallback (%sx%s pt)",
page_no, _DEFAULT_PAGE_WIDTH, _DEFAULT_PAGE_HEIGHT, page_no, _DEFAULT_PAGE_WIDTH, _DEFAULT_PAGE_HEIGHT,
) )
pages[page_no] = PageDetail(page_number=page_no, width=_DEFAULT_PAGE_WIDTH, height=_DEFAULT_PAGE_HEIGHT) pages[page_no] = PageDetail(page_number=page_no, width=_DEFAULT_PAGE_WIDTH, height=_DEFAULT_PAGE_HEIGHT)

View file

@ -10,7 +10,6 @@ from docling_core.types.doc.base import BoundingBox, CoordOrigin
from domain.bbox import EMPTY_BBOX, to_topleft_list from domain.bbox import EMPTY_BBOX, to_topleft_list
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Standard conversions # Standard conversions
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
@ -65,7 +64,7 @@ class TestPageFormats:
"""Verify correct conversion across different page sizes.""" """Verify correct conversion across different page sizes."""
def test_a4_page(self): def test_a4_page(self):
"""A4 page (595.28 × 841.89 pt) — most common non-US format.""" """A4 page (595.28 x 841.89 pt) -- most common non-US format."""
page_height = 841.89 page_height = 841.89
bbox = BoundingBox(l=72, t=769.89, r=523.28, b=72, coord_origin=CoordOrigin.BOTTOMLEFT) bbox = BoundingBox(l=72, t=769.89, r=523.28, b=72, coord_origin=CoordOrigin.BOTTOMLEFT)
result = to_topleft_list(bbox, page_height=page_height) result = to_topleft_list(bbox, page_height=page_height)
@ -76,14 +75,14 @@ class TestPageFormats:
assert result[3] == pytest.approx(page_height - 72) # ~769.89 assert result[3] == pytest.approx(page_height - 72) # ~769.89
def test_a3_page(self): def test_a3_page(self):
"""A3 page (841.89 × 1190.55 pt).""" """A3 page (841.89 x 1190.55 pt)."""
page_height = 1190.55 page_height = 1190.55
bbox = BoundingBox(l=0, t=1190.55, r=841.89, b=0, coord_origin=CoordOrigin.BOTTOMLEFT) bbox = BoundingBox(l=0, t=1190.55, r=841.89, b=0, coord_origin=CoordOrigin.BOTTOMLEFT)
result = to_topleft_list(bbox, page_height=page_height) result = to_topleft_list(bbox, page_height=page_height)
assert result == pytest.approx([0, 0, 841.89, 1190.55]) assert result == pytest.approx([0, 0, 841.89, 1190.55])
def test_legal_page(self): def test_legal_page(self):
"""US Legal page (612 × 1008 pt).""" """US Legal page (612 x 1008 pt)."""
page_height = 1008.0 page_height = 1008.0
bbox = BoundingBox(l=50, t=50, r=562, b=958, coord_origin=CoordOrigin.TOPLEFT) bbox = BoundingBox(l=50, t=50, r=562, b=958, coord_origin=CoordOrigin.TOPLEFT)
result = to_topleft_list(bbox, page_height=page_height) result = to_topleft_list(bbox, page_height=page_height)

View file

@ -1,4 +1,5 @@
<template> <template>
<!-- eslint-disable-next-line vue/no-v-html -- sanitized by DOMPurify -->
<div class="markdown-viewer" v-html="rendered" /> <div class="markdown-viewer" v-html="rendered" />
</template> </template>

View file

@ -26,13 +26,17 @@
class="toggle-btn" class="toggle-btn"
:class="{ active: mode === 'configurer' }" :class="{ active: mode === 'configurer' }"
@click="mode = 'configurer'" @click="mode = 'configurer'"
>{{ t('studio.configure') }}</button> >
{{ t('studio.configure') }}
</button>
<button <button
class="toggle-btn" class="toggle-btn"
:class="{ active: mode === 'verifier' }" :class="{ active: mode === 'verifier' }"
@click="mode = 'verifier'" @click="mode = 'verifier'"
:disabled="!analysisStore.currentAnalysis" :disabled="!analysisStore.currentAnalysis"
>{{ t('studio.verify') }}</button> >
{{ t('studio.verify') }}
</button>
</div> </div>
</div> </div>
<div class="topbar-actions"> <div class="topbar-actions">