Skip to content

Merge dev-talesam into main - #26

Merged
talesam merged 2 commits into
mainfrom
dev-talesam
Sep 7, 2026
Merged

Merge dev-talesam into main#26
talesam merged 2 commits into
mainfrom
dev-talesam

Conversation

@talesam

@talesam talesam commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Pull request created by GitRepo.

bigbruno and others added 2 commits August 19, 2026 14:52
The image window sorted OCR boxes by their top edge alone. Real detections
jitter vertically by a few pixels on the same visual line, so the sort
reordered them: a captured "Nome: Joao Silva" came out as "Joao Nome: Silva".
Measured on three boxes whose tops differ by 2 and 4 px, which is an ordinary
label/value row, not a pathological case -- it happened on nearly every
capture that produced more than one box.

The pipeline already owns a formatter that gets this right.
`TextFormattingController.format` groups boxes into lines by vertical overlap,
orders each line left to right, spaces them proportionally, and finds tables,
paragraphs and hyphen joins. The 55-line copy in `screen_capture` is gone, and
a capture now formats the same way a page of the same layout does. Its
alignment is made of spaces, so the result view is monospace: in a
proportional font the columns it computes would not line up, which makes the
output claim a layout it does not have.

Capture asked the XDG portal first and only fell back to Spectacle when the
portal was absent. On this KDE session the portal's interactive mode opens
"Solicitar captura de tela" with Area set to full screen and "include mouse
pointer" checked -- four or more clicks to reach a region, and the cursor
drawn into the image that goes to OCR. `spectacle -r -b -n -o` opens the
region selector directly and writes exactly the file we name; verified that it
overwrites an existing empty file in place and exits 0 with a valid PNG, with
another Spectacle instance already registered on the bus. So KDE runs the
native tool first and the portal second. Everywhere else the portal still
leads, because it is the only backend that works from inside a sandbox. A
cancelled region selection stays cancelled and does not open the portal behind
it.

While measuring that, Spectacle wrote a complete 672 KB PNG and then exited on
SIGSEGV. `_run_standard_tool` read the exit status before the file, so it threw
that capture away and reported failure. The bytes on disk decide first now. The
crash is intermittent -- three later runs exited 0 -- which is exactly why it
was worth handling rather than chasing.

"No text extracted." was written into the editable result buffer, offering
prose the OCR never read as if it were the extracted text, and it needed a
`_result_copyable` flag to stop Copy from putting that sentence on the
clipboard. An empty result is its own state now, with a cause and the two ways
to get a result, so the flag is gone and Copy follows the buffer alone.

Five tests cover the new behaviour: the KDE ordering, the fall back to the
portal when no native tool answers, a tool that crashes after writing, the
empty page, and the same-line ordering that started this. Two existing portal
tests now pin XDG_CURRENT_DESKTOP, because the backend order reads it.

pt and pt_BR carry the two new strings. The other 29 catalogs fall back to
English for them and still hold the retired msgid; the gate accepts that, and
merging them is a separate pass.
  Remove file-to-directory device comparisons from staged file validation
  and recovery journal parsing. OverlayFS can report different devices
  for files and their parent directory, blocking settings creation and
  application startup.

  Preserve atomic installation through destination-local snapshots and
  retain per-file identity checks during publication and recovery.

  Set bigocrpdf.svg and bigocrimage.svg intrinsic dimensions to 256x256.
  Preserve their viewBox and artwork to avoid enlarging 24px textures.

  Add regression coverage for creating and overwriting settings when
  directory and file device IDs differ.
@talesam
talesam merged commit f2b3cfe into main Sep 7, 2026
1 check passed
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 3 high

Alerts:
⚠ 3 issues (≤ 0 issues of at least minor severity)

Results:
3 new issues

Category Results
Security 3 high

View in Codacy

🟢 Metrics 3 complexity · 0 duplication

Metric Results
Complexity 3
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sonarqubecloud

sonarqubecloud Bot commented Sep 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants