Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/qrcoderesponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@
DEFAULT_BG_COLOR = "#ffffff"
MIN_PIXEL_WIDTH = 1
MAX_PIXEL_WIDTH = 100
<<<<<<< Updated upstream
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Remove unresolved merge marker from Python module

The <<<<<<< conflict marker committed in app/qrcoderesponse.py makes the module invalid Python, so importing qrcoderesponse raises a SyntaxError and the app cannot start (including /qr handling and tests that import this module). This is a release-blocking runtime failure until the conflict is resolved and a single constant set is kept.

Useful? React with 👍 / 👎.

DEFAULT_LOGO_SCALE = 20
MIN_LOGO_SCALE = 5
MAX_LOGO_SCALE = 30
=======
DEFAULT_LOGO_SCALE = 15
MIN_LOGO_SCALE = 5
MAX_LOGO_SCALE = 20
>>>>>>> Stashed changes


def _pixel_width_from_env():
Expand Down
7 changes: 7 additions & 0 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@

<label class="form-label mt-3" for="logo_scale">Logo size:</label>
<div class="logo-slider-wrap">
<<<<<<< Updated upstream
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve unresolved conflict block in template

The committed conflict block in app/templates/index.html ships merge-marker text and both slider variants, which duplicates id="logo_scale" and id="logo-scale-value" in the DOM while the script uses document.getElementById for a single element. In browsers this makes the logo-size UI inconsistent (only the first node is wired/updated) and exposes raw conflict markers to users.

Useful? React with 👍 / 👎.

<input class="form-range" type="range" id="logo_scale" name="logo_scale" min="5" max="30" step="1" value="20">
<span id="logo-scale-value">20%</span>
</div>
=======
<input class="form-range" type="range" id="logo_scale" name="logo_scale" min="5" max="20" step="1" value="15">
<span id="logo-scale-value">15%</span>
</div>
<small class="text-light d-block mt-2">For scan reliability, logo size is capped at 20%.</small>
>>>>>>> Stashed changes
</form>
<div class="device-container"></div>
<div class="iphone-mockup"></div>
Expand Down
7 changes: 7 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
sys.path.insert(0, APP_DIR)

from main import app # noqa: E402
from qrcoderesponse import DEFAULT_LOGO_SCALE, MAX_LOGO_SCALE, _normalized_logo_scale # noqa: E402


class QRCodeAppTestCase(unittest.TestCase):
Expand Down Expand Up @@ -41,6 +42,12 @@ def test_qr_returns_png_for_valid_text(self):
self.assertEqual(response.mimetype, "image/png")
self.assertTrue(response.data.startswith(b"\x89PNG"))

def test_logo_scale_is_clamped_to_maximum(self):
self.assertEqual(_normalized_logo_scale("999"), MAX_LOGO_SCALE)

def test_logo_scale_uses_new_default(self):
self.assertEqual(_normalized_logo_scale(None), DEFAULT_LOGO_SCALE)


if __name__ == "__main__":
unittest.main()
Loading