diff --git a/src/features/qword/QWord.test.tsx b/src/features/qword/QWord.test.tsx
index ee303b5..21390da 100644
--- a/src/features/qword/QWord.test.tsx
+++ b/src/features/qword/QWord.test.tsx
@@ -23,6 +23,43 @@ describe("qwordCurrentPageFromViewport", () => {
});
describe("QWord", () => {
+ it("держит ленту QWord вне прокручиваемой области документа", () => {
+ const originalResizeObserver = globalThis.ResizeObserver;
+ const originalRequestAnimationFrame = window.requestAnimationFrame;
+
+ globalThis.ResizeObserver = class {
+ observe() {}
+ disconnect() {}
+ } as unknown as typeof ResizeObserver;
+ window.requestAnimationFrame = ((callback: FrameRequestCallback) => {
+ callback(0);
+ return 1;
+ }) as typeof window.requestAnimationFrame;
+
+ const document: WordDocument = {
+ id: "word-ribbon-layout-test",
+ title: "Лента.docx",
+ updatedAt: "2026-06-02T00:00:00.000Z",
+ html: "
Текст
"
+ };
+
+ try {
+ const view = render();
+ const toolbar = view.container.querySelector(".word-module-toolbar") as HTMLElement;
+ const stage = view.container.querySelector(".document-stage") as HTMLElement;
+
+ expect(toolbar).toBeInTheDocument();
+ expect(stage).toBeInTheDocument();
+ expect(stage).not.toContainElement(toolbar);
+ expect(toolbar.querySelector(".word-ribbon-tabs")).toBeInTheDocument();
+ expect(stage.querySelector(".page-ruler")).toBeInTheDocument();
+ expect(stage.querySelector(".paper-frame")).toBeInTheDocument();
+ } finally {
+ globalThis.ResizeObserver = originalResizeObserver;
+ window.requestAnimationFrame = originalRequestAnimationFrame;
+ }
+ });
+
it("переключает вкладки ленты и показывает команды выбранной вкладки", () => {
const originalResizeObserver = globalThis.ResizeObserver;
const originalRequestAnimationFrame = window.requestAnimationFrame;
diff --git a/src/features/qword/QWord.tsx b/src/features/qword/QWord.tsx
index 46e439d..016aa06 100644
--- a/src/features/qword/QWord.tsx
+++ b/src/features/qword/QWord.tsx
@@ -686,8 +686,7 @@ export function QWord({ document, zoom = 100, onChange, onStatusChange }: QWordP
return (
+
{Array.from({ length: 9 }, (_, index) => (
{index + 1}
diff --git a/src/styles.css b/src/styles.css
index 4bec1ce..522ea83 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -365,6 +365,10 @@ button {
min-height: 0;
}
+.qword-layout {
+ grid-template-rows: auto minmax(0, 1fr);
+}
+
.document-stage,
.spreadsheet-stage,
.slide-stage {
@@ -393,6 +397,9 @@ button {
}
.word-module-toolbar {
+ position: relative;
+ top: auto;
+ z-index: 3;
display: block;
min-height: 154px;
padding: 0;
@@ -2227,6 +2234,11 @@ button {
overflow-y: auto;
}
+ .word-module-toolbar {
+ max-height: none;
+ overflow: hidden;
+ }
+
.file-title-input {
min-width: 0;
flex: 1 1 220px;