Skip to content

Fix white line at bottom of iframe kiwix/kiwix-tools#809#1288

Open
zeyad-elkholy wants to merge 3 commits intokiwix:mainfrom
zeyad-elkholy:patch-1
Open

Fix white line at bottom of iframe kiwix/kiwix-tools#809#1288
zeyad-elkholy wants to merge 3 commits intokiwix:mainfrom
zeyad-elkholy:patch-1

Conversation

@zeyad-elkholy
Copy link
Copy Markdown

@zeyad-elkholy zeyad-elkholy commented Mar 24, 2026

Fixes kiwix/kiwix-tools#809

I removed the hardcoded Javascript math that was calculating the iframe height with an arbitrary - 4 pixel offset. I replaced it with the CSS Flexbox approach (display: flex, flex: 1) on the html, body, and iframe elements to allow it to scale naturally without leaving a gap at the bottom.

@zeyad-elkholy zeyad-elkholy changed the title Fix white line at bottom of iframe (fixes #809) Fix white line at bottom of iframe (kiwix-tools#809) Mar 24, 2026
@zeyad-elkholy zeyad-elkholy changed the title Fix white line at bottom of iframe (kiwix-tools#809) Fix white line at bottom of iframe kiwix-tools#809 Mar 24, 2026
@zeyad-elkholy zeyad-elkholy changed the title Fix white line at bottom of iframe kiwix-tools#809 Fix white line at bottom of iframe kiwix/kiwix-tools#809 Mar 24, 2026
@zeyad-elkholy
Copy link
Copy Markdown
Author

Fixes kiwix/kiwix-tools#809

@david-cako
Copy link
Copy Markdown

🎉 sweet!!

I hope this works on all dependents of libkiwix, but it should. Looks like iOS and Android are webviews. Still could be scaffolding that gets changed with this, and I'm sure someone can test it!

@zeyad-elkholy
Copy link
Copy Markdown
Author

i don't know to be honest but i don't see smth wrong in web, so check it on safari, it works in firefox

@Yizhen-Zheng
Copy link
Copy Markdown

I've verified this works perfectly on Safari.
Before:(notice the white line at the bottom
Screenshot 2026-03-25 at 12 01 01
After:
Screenshot 2026-03-25 at 12 01 11

@kelson42
Copy link
Copy Markdown
Collaborator

@zeyad-elkholy Thank you very much for your PR. I have assigned reviewers and will test things myself. Give us a few days to complete the review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix the bottom gap/white line caused by hardcoded iframe height calculations by switching the viewer layout to a CSS flexbox-based sizing approach.

Changes:

  • Added inline flexbox CSS in static/viewer.html to make the iframe naturally fill remaining viewport height.
  • Disabled the JavaScript-based iframe height calculation previously performed on viewport changes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
static/viewer.html Adds inline flexbox rules intended to make the toolbar + iframe layout fill the viewport without a bottom gap.
static/skin/viewer.js Comments out the resize-based iframe height math in handle_visual_viewport_change().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@veloman-yunkan veloman-yunkan left a comment

Choose a reason for hiding this comment

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

I didn't test the fix (leaving it to @kelson42). If testing doesn't reveal any problems and the fix is going to be merged then we should simply drop the handle_visual_viewport_change() function (as suggested by Copilot).

Also, the cacheids in the server unit-test must be updated.

@zeyad-elkholy
Copy link
Copy Markdown
Author

zeyad-elkholy commented Mar 25, 2026

@kelson42 @veloman-yunkan i removed handle_visual_viewport_change() and his calls and also updated the cache ids and SHA1 hash

@veloman-yunkan
Copy link
Copy Markdown
Collaborator

@kelson42 This PR should be merged as a single (squashed) commit.

@zeyad-elkholy
Copy link
Copy Markdown
Author

zeyad-elkholy commented Apr 5, 2026

@kelson42 could you review or merge the PR plz if u have time?

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.

White line at bottom of content iframe due to fixed height

6 participants