pp-planer/.sisyphus/evidence/task-6-translated-bounds.txt
Thorsten Bus fa3162b2b7 docs: add build commands and architecture overview to AGENTS.md
Add build/test/lint commands, architecture overview, PHP/Vue/test
code style conventions, and key project constraints. Include dompdf
config, vite HMR note, and sisyphus evidence files.
2026-03-02 23:03:14 +01:00

155 lines
4.6 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Task 6: Translated Textbox Positioning - QA Evidence
## Test 1: Translated Slide Has Correct Dual Bounds
### Command
```bash
cd /Users/thorsten/AI/cts-work && php -r "
require 'vendor/autoload.php';
use ProPresenter\Parser\ProFileGenerator;
use ProPresenter\Parser\ProFileWriter;
use ProPresenter\Parser\ProFileReader;
\$song = ProFileGenerator::generate('TranslateTest',
[['name'=>'V1','color'=>[0,0,0,1],'slides'=>[['text'=>'Amazing Grace','translation'=>'Erstaunliche Gnade']]]],
[['name'=>'normal','groupNames'=>['V1']]]
);
ProFileWriter::write(\$song, '/tmp/translate-test.pro');
\$readSong = ProFileReader::read('/tmp/translate-test.pro');
\$slides = \$readSong->getSlides();
\$elements = \$slides[0]->getAllElements();
echo 'count: ' . count(\$elements) . PHP_EOL;
echo 'name0: ' . \$elements[0]->getName() . PHP_EOL;
echo 'name1: ' . \$elements[1]->getName() . PHP_EOL;
\$b0 = \$elements[0]->getGraphicsElement()->getBounds();
\$b1 = \$elements[1]->getGraphicsElement()->getBounds();
echo 'height0: ' . round(\$b0->getSize()->getHeight(), 1) . PHP_EOL;
echo 'height1: ' . round(\$b1->getSize()->getHeight(), 1) . PHP_EOL;
echo 'y0: ' . round(\$b0->getOrigin()->getY(), 3) . PHP_EOL;
echo 'y1: ' . round(\$b1->getOrigin()->getY(), 3) . PHP_EOL;
"
```
### Output
```
count: 2
name0: Orginal
name1: Deutsch
height0: 182.9
height1: 113.9
y0: 99.543
y1: 303.166
```
### Verification
✅ Element count: 2 (expected: 2)
✅ Element 0 name: "Orginal" (expected: "Orginal")
✅ Element 1 name: "Deutsch" (expected: "Deutsch")
✅ Element 0 height: 182.9px (expected: ~182.946px)
✅ Element 1 height: 113.9px (expected: ~113.889px)
✅ Element 0 Y position: 99.543 (expected: 99.543)
✅ Element 1 Y position: 303.166 (expected: 303.166)
**Result**: PASS - Translated slides have correctly positioned dual textboxes matching TestTranslated.pro reference
---
## Test 2: Non-Translated Slide Has Single Full Bounds
### Command
```bash
cd /Users/thorsten/AI/cts-work && php -r "
require 'vendor/autoload.php';
use ProPresenter\Parser\ProFileGenerator;
use ProPresenter\Parser\ProFileWriter;
use ProPresenter\Parser\ProFileReader;
\$song = ProFileGenerator::generate('NoTranslateTest',
[['name'=>'V1','color'=>[0,0,0,1],'slides'=>[['text'=>'Amazing Grace']]]],
[['name'=>'normal','groupNames'=>['V1']]]
);
ProFileWriter::write(\$song, '/tmp/no-translate-test.pro');
\$readSong = ProFileReader::read('/tmp/no-translate-test.pro');
\$slides = \$readSong->getSlides();
\$elements = \$slides[0]->getAllElements();
echo 'count: ' . count(\$elements) . PHP_EOL;
echo 'name0: ' . \$elements[0]->getName() . PHP_EOL;
\$b = \$elements[0]->getGraphicsElement()->getBounds();
echo 'height: ' . round(\$b->getSize()->getHeight(), 1) . PHP_EOL;
echo 'width: ' . round(\$b->getSize()->getWidth(), 1) . PHP_EOL;
echo 'y: ' . round(\$b->getOrigin()->getY(), 1) . PHP_EOL;
echo 'x: ' . round(\$b->getOrigin()->getX(), 1) . PHP_EOL;
"
```
### Output
```
count: 1
name0: Orginal
height: 880
width: 1620
y: 100
x: 150
```
### Verification
✅ Element count: 1 (expected: 1)
✅ Element 0 name: "Orginal" (expected: "Orginal")
✅ Height: 880px (expected: 880px)
✅ Width: 1620px (expected: 1620px)
✅ Y position: 100 (expected: 100)
✅ X position: 150 (expected: 150)
**Result**: PASS - Non-translated slides keep single full-size textbox
---
## PHPUnit Tests
### Test: testTranslatedSlideHasCorrectDualBounds
```bash
./vendor/bin/phpunit vendor/propresenter/parser/tests/ProFileGeneratorTest.php --filter testTranslatedSlideHasCorrectDualBounds
```
**Result**: OK (1 test, 7 assertions)
### Test: testNonTranslatedSlideHasSingleFullBounds
```bash
./vendor/bin/phpunit vendor/propresenter/parser/tests/ProFileGeneratorTest.php --filter testNonTranslatedSlideHasSingleFullBounds
```
**Result**: OK (1 test, 6 assertions)
### All ProFileGeneratorTest Tests
```bash
./vendor/bin/phpunit vendor/propresenter/parser/tests/ProFileGeneratorTest.php
```
**Result**: OK (14 tests, 95 assertions)
---
## Laravel Tests
### Command
```bash
php -d memory_limit=512M artisan test
```
**Result**: Tests: 203 passed (1115 assertions), Duration: 3.89s
---
## Summary
✅ All acceptance criteria met:
- [x] Two new methods created: buildOriginalBounds(), buildTranslationBounds()
- [x] Translated slides have 2 elements with different bounds (heights: ~183px, ~114px)
- [x] Non-translated slides keep single element with full bounds (1620×880)
- [x] Textbox names unchanged: "Orginal" (typo intentional), "Deutsch"
- [x] New test: translated slide has correct dual bounds
- [x] New test: non-translated slide has single full-size bounds
- [x] PHPUnit tests pass (14/14)
- [x] Laravel tests pass (203/203)
**Task Status**: COMPLETE
**Date**: 2026-03-02