"Normal scale" replaces "A4 scale" in the Page menu
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
56ab259cd4
commit
46a82bf3b7
4 files changed
+9
-9
No files matched your search
+2
-2
@@ -78,13 +78,13 @@
|
||||
<div class="toolbar_right">
|
||||
<div class="group" id="host_tools">
|
||||
<button id="page_menu_button" type="button" aria-haspopup="menu" aria-expanded="false"
|
||||
data-help="The page and the view: fit the page to the window, show it at A4 scale, make it larger or smaller, and whether it grows as you write.">Page</button>
|
||||
data-help="The page and the view: fit the page to the window, show it at its normal scale, make it larger or smaller, and whether it grows as you write.">Page</button>
|
||||
<div id="page_menu" class="popup menu" role="menu" hidden>
|
||||
<div class="menu_title">Change the display of the page</div>
|
||||
<button id="zoom_fit" type="button" class="menu_item" role="menuitem"
|
||||
data-help="Show the whole page in the window. Pressed by the host, it does so on every screen. Ctrl (Command on a Mac) with the scroll wheel, or with a pen stroke up or down, zooms about the pointer.">Fit to the window</button>
|
||||
<button id="zoom_sheet" type="button" class="menu_item" role="menuitem"
|
||||
data-help="Show the page at the scale a new page has: a full A4 page filling the window. A shrunk page is then seen at its own size rather than enlarged. Pressed by the host, it does so on every screen.">A4 scale</button>
|
||||
data-help="Show the page at the scale a new page has, one full page filling the window. A shrunk page is then seen at its own size rather than enlarged. Pressed by the host, it does so on every screen.">Normal scale</button>
|
||||
<hr>
|
||||
<div class="menu_title">Change the size of the page</div>
|
||||
<button id="zoom_expand" type="button" class="menu_item" role="menuitem" hidden
|
||||
|
||||
+2
-2
@@ -547,7 +547,7 @@ async function enterSession(invitationText, name, notebook) {
|
||||
writer.changed();
|
||||
},
|
||||
onViewCommand: (command) => {
|
||||
log(`The host's view: ${command === 'fit' ? 'Fit' : 'A4'}`);
|
||||
log(`The host's view: ${command === 'fit' ? 'Fit' : 'Normal scale'}`);
|
||||
if (command === 'fit') renderer.fit();
|
||||
else renderer.sheetScale();
|
||||
},
|
||||
@@ -1050,7 +1050,7 @@ async function enterSession(invitationText, name, notebook) {
|
||||
textEditor?.layout();
|
||||
viewChanged();
|
||||
};
|
||||
// The host's Fit and A4 reach everyone (Andy, 2026-10-08); a guest's
|
||||
// The host's Fit and Normal scale ("A4" until 2026-10-14) reach everyone (Andy, 2026-10-08); a guest's
|
||||
// are the guest's own.
|
||||
// The page and view commands live in the Page menu (Andy, 2026-10-14:
|
||||
// seldom used, and the one row is precious); Help is a note for now.
|
||||
|
||||
@@ -66,7 +66,7 @@ import { trimTrailingBlankLines } from './text_layout.js';
|
||||
* @property {() => void} onPermissionsChanged
|
||||
* Who may start pages changed.
|
||||
* @property {(command: 'fit' | 'sheet') => void} onViewCommand
|
||||
* The host pressed "Fit" or "A4": everyone's view follows (Andy,
|
||||
* The host pressed "Fit" or "Normal scale": everyone's view follows (Andy,
|
||||
* 2026-10-08), each in their own window.
|
||||
* @property {() => void} onParticipantsChanged
|
||||
* @property {(status: 'connecting' | 'connected' | 'failed', detail?: string) => void} onStatus
|
||||
@@ -244,7 +244,7 @@ export class Session {
|
||||
}
|
||||
|
||||
/**
|
||||
* The host's "Fit" or "A4" goes to everyone. Only the host's does.
|
||||
* The host's "Fit" or "Normal scale" goes to everyone. Only the host's does.
|
||||
* @param {'fit' | 'sheet'} command
|
||||
*/
|
||||
sendViewCommand(command) {
|
||||
|
||||
@@ -1512,7 +1512,7 @@ class EndToEndTest(unittest.TestCase):
|
||||
self.assertGreater(menu[1], button[3])
|
||||
self.assertLess(menu[2], firefox.run("return window.innerWidth;"))
|
||||
items = firefox.run("return [...document.querySelectorAll('#page_menu .menu_item')].filter((e) => !e.hidden).map((e) => e.textContent.trim());")
|
||||
self.assertEqual(items, ["Fit to the window", "A4 scale", "Expand to the window",
|
||||
self.assertEqual(items, ["Fit to the window", "Normal scale", "Expand to the window",
|
||||
"Shrink to the contents", "Extend the page while writing"])
|
||||
# Two grey titles, over the first two sections, in the muted colour.
|
||||
self.assertEqual(firefox.run("return [...document.querySelectorAll('#page_menu .menu_title')].map((e) => e.textContent);"),
|
||||
@@ -1958,7 +1958,7 @@ class EndToEndTest(unittest.TestCase):
|
||||
self.assertEqual(doubled["strokes"], before["strokes"])
|
||||
firefox.run(CTRL_DRAG, 0.5, 0.3, 0.5, 0.3, 104)
|
||||
self.assertAlmostEqual(zoom()["width"], before["width"], delta=2)
|
||||
# The host's Fit and A4 reach the guest, who then fits the page to
|
||||
# The host's Fit and Normal scale reach the guest, who then fits the page to
|
||||
# the guest's own window; the guest's own Fit stays the guest's.
|
||||
firefox.switch_to(student_tab)
|
||||
firefox.run("""
|
||||
@@ -2048,7 +2048,7 @@ class EndToEndTest(unittest.TestCase):
|
||||
lambda text: f'data-base="{sheet["width"]} {sheet["height"]} {sheet["left"]} {sheet["top"]}"' in text,
|
||||
"the shrunk sheet in the student's file")
|
||||
firefox.switch_to(teacher_tab)
|
||||
# "A4" shows the shrunk page at the scale a new page has: a blank
|
||||
# "Normal scale" ("A4" until 2026-10-14) shows the shrunk page at the scale a new page has: a blank
|
||||
# sheet fitted to the window, so the page is smaller than it.
|
||||
firefox.run("document.getElementById('zoom_fit').click();")
|
||||
fitted_scale = firefox.run("return window.kokkoja.renderer.cssPixelsPerUnit;")
|
||||
|
||||
Reference in new issue
Block a user