Commit graph

23949 commits

Author SHA1 Message Date
Henry Castro
91b082fb44 browser: preview: fix invalidate previews when resize
Change-Id: Ic4f4a2cc9e98134564e0a9015b0d4c99bad66e08
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-29 07:39:52 -04:00
Henry Castro
53d702b717 browser: preview: remove unused code '_isPreviewVisible'
Change-Id: Ie7c4a8d4909837888db31952dee8a190a0d332c5
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-29 07:39:52 -04:00
Henry Castro
c2f4c999ae browser: preview: remove accessor hack
Change-Id: Id936503eade75aba9d9a4772a9dcdd3e5ed4742f
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-29 07:39:52 -04:00
Henry Castro
df0ec74f9c browser: preview: replace missing 'preview_placeholder.svg'
.

Change-Id: Ic12df42d1b7bdc79377c9cb5f52f819f0d5083f1
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-29 07:39:52 -04:00
Henry Castro
a1c976f913 browser: preview: simplify 'updateAllPreviews'
Change-Id: I0d7c3877924544064bafc3ca93c887329b04a245
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-29 07:39:52 -04:00
Michael Meeks
d2dae8f2b5 Fix broken conditional compilation for WASM.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ib0f3733a0719c87281b432c7c009fc2362ad3cce
2024-04-29 10:56:54 +02:00
Michael Meeks
31624e869c test: cleanup logging accounting post fork, for more helpful tests.
coolforkit: common/Log.cpp:677: void Log::shutdown(): Assertion
`ThreadLocalBufferCount <= 1 && "Unstopped threads may have unflushed
buffered log entries"' failed.

Was caused by mis-accounting. Also join document threads on 'exit'
which happens during unit tests to ensure we don't hit the above.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I523e723e54e4252ae0d65de36af086e97dd79f04
2024-04-29 10:56:54 +02:00
Michael Meeks
12310c7dec test: allow an exitTest to work in Kit and propagate its result.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I0d32d46e81eb3ed42d8531860ef2d8e06bdca591
2024-04-29 10:56:54 +02:00
Michael Meeks
a866719881 test: abort a test whose kit has a segfault by default.
Otherwise forkit tends to loop aggressively re-starting that for the
duration of the test wastefully.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia1c684a5d995f54f29290c9631b1ee14266445d7
2024-04-29 10:56:54 +02:00
Michael Meeks
642da39dc5 test: create UnitSyntheticLok - to stub and override LOK behavior.
Simple example to re-instate previous unit test.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I26da1178bc897797a656eb5ae9f838d17cbaf75f
2024-04-29 10:56:54 +02:00
Michael Meeks
14e3a20e18 DocumentManagerInterface - remove un-helpful abstract base.
This added 200+ lines of code, made things harder to
understand, and was used only in a single test that can be
covered in another way.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4ed8d1d52d533f8b24be7dd5e12dbb7702ef1a80
2024-04-29 10:56:54 +02:00
Michael Meeks
08e17a0388 Simplify Document creation, and coupling to KitWebSocket.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Iec7dfd3d33de2ae548ca73081d50361958672e4a
2024-04-29 10:56:54 +02:00
Rashesh Padia
7a75153290 fix: zotero options not visible when viewId is zero
- regression from 9202365fc6

Signed-off-by: Rashesh Padia <rashesh.padia@collabora.com>
Change-Id: I4554a5fcc9b0c5dce48c8b35ea32142ff1c323f3
2024-04-29 10:28:54 +02:00
Gökay Şatır
1a1835bd90 Remove "updateResolvedState" function.
It sets a reply's status to "resolved" only if its parent is resolved.

I can't remember why we implemented this like this before.

But now, we don't need to.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: Ia31dab0237d3b89e5d391cf87394514d18b595f7
2024-04-29 11:09:36 +03:00
Gökay Şatır
e43d988084 Fix typo. Causes JS error.
Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: If2ffdf4d561d34f3febc6c976e7427621c5cdf79
2024-04-29 11:06:01 +03:00
Miklos Vajna
c559e2fc5e cool#8806 clipboard: fix paste special of images in Firefox
Copy an image to the clipboard, click Paste -> Paste special on the
notebookbar in Firefox: the image is pasted, but the paste special
dialog doesn't close.

What happens here is that Firefox lacks navigator.clipboard.read(), so
the relevant code is Clipboard.js dataTransferToDocumentFallback(), not
the new _navigatorClipboardGetTypeCallback(). Here e.g. copy from
desktop Writer (html+text) would lead to a _doInternalPaste(), which
would call _checkAndDisablePasteSpecial() for us, but the image case
returns early, so the closing doesn't happen.

Fix the problem by explicitly calling _checkAndDisablePasteSpecial()
before returning early.  In contrast with the other uses of
_checkAndDisablePasteSpecial(), we don't need to call the paste or paste
special uno command (since _asyncReadPasteImage() takes care of pasting
with a websocket comment), so it's fine to ignore the return value.

No testcase, our cypress tests run on Chrome, and this happens only with
Firefox.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I751d234edfdf9e8fb37f2bf2d6b3f3d8e65a27f4
2024-04-29 08:52:53 +01:00
Ashod Nakashian
7268248481 wsd: test: give up attempting to connect if the test finished
Some tests are designed to exercise the reconnection
logic. Once the test validates that the correct
reconnection logic is used, the test is considered
finished. In those cases, we need to break the
test framework's retry logic.

Change-Id: Ie0bb5dcc430a954910c2af4817a500f5b576bd4c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-27 14:14:28 +02:00
Aron Budea
b38e1f41ea Don't log warnings about version mismatch for admin console
It's only relevant for regular URLs that contain version hash.

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I73afaa0559c3dddc09a8ed5f786fb5126e1c8f0c
2024-04-27 06:52:04 -04:00
Neil Guertin
190a3acf78 Cypress: Fix mobile/impress/apply_font_text_spec.js
Failed because mobile wizard opened too soon.
Fix: Wait for selection before opening mobile wizard.

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Ie29e3f5be17bafa2dd09b3f8f5b6415104456cb7
2024-04-27 01:37:10 -04:00
Neil Guertin
c44bcb2980 Cypress: Join subFolder and fileName into filePath
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I361d523f564e7b9a46dd2398080eef110eeae79c
2024-04-26 21:10:39 -04:00
Aron Budea
d471d93c1e browser: Add correct class to Share / See History buttons in Impress
...as in other tabbed bar JS files.

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I29c43d9dc0ce4fa929e049e70171e0b8ab029088
2024-04-27 02:00:44 +02:00
Neil Guertin
ed731b7091 Cypress: Retry selectTextOfShape
Most users of selectTextOfShape also need to select all text.
Sometimes the cursor appears but does not allow CTRL+a to select
all text. Work around this by including the selection in the retry
using waitUntil.

Fixes mobile/impress/apply_paragraph_props_text_spec.js, which started
failing sporadically after commit e0a0646ce1.

I also adjusted the dblclick selector because it was finding multiple
elements but I think that is unrelated

I also created a separate function editTextInShape, for tests
that do not need to select all text

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Icdfa731ba9a5f8d08a858192a4f1f5bc79b09b76
2024-04-26 17:35:05 -04:00
Szymon Kłos
d1a58af640 css: fix insert shape popup
insert shape now shows all the items in one column.
fix it so we have rows

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I371f7fa233e46a62dbb6637d934bc5ceb5cdecb0
2024-04-26 15:26:48 +02:00
Pranam Lashkari
1a287fd96d annotation: avoid resizing editing comment
problem:
when you try to reply to long comment, it would be resized
and subsequntly reply box will take space and other comments
will not make enough space for it

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I4d81904721e5bb196947598d0dca211ee9d480a6
2024-04-25 20:27:25 +01:00
Pranam Lashkari
fe9b582275 annotation: fixed comments could not expand
problem:
when comment was on the edge of the document/screen(vertically)
resize was called which ultimately collapsed the comments in small screen
which could not be expanded unless scrolled further from edge.
It was more problematic for the threads,
if entire thread could not fit in the screen it was always failing to expand

regression from bac4161

it nullifies the effect from 81b00e7
now if comment is added at the end of the document and it goes beyond doc boundry
doc will not scroll automatically to make entire comment visible

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I198b4887ae19ca0c17ba1453960cd36a66beb04d
2024-04-25 20:27:25 +01:00
Pranam Lashkari
0c2247213e annotation: fixed thread scrolling to root comment on action
problem:
when long thread did not fit on screen and actions were performed
on last comments of thread which put root comment out of view,
it will cause scroll back to root comment (i.e: reply)

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I23d699425dc2dff1cfeddf6ab9be7131f80c3a31
2024-04-25 20:27:25 +01:00
Pranam Lashkari
38efd68c14 annotation: avoid explicit unselect before select
select function now can take care of reselection and layout update

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I2a061643ec190d5b2d005b940923a28131ed6cb0
2024-04-25 20:27:25 +01:00
Pranam Lashkari
e443f940d1 annotation: make comment section scrollable with mouse
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ib6a2fee7ace81ffbc82ec4545e6f613f79c6734f
2024-04-25 20:27:25 +01:00
Caolán McNamara
a327d3ec83 do invalidation tests without spellchecking
which may kick in at an arbitrary point. We shouldn't invalidate if
there is no change, but that's a TODO.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I910c96f2c2a0efab393ccea52c9f25d5804cd967
2024-04-25 20:00:18 +01:00
Miklos Vajna
24109be2e3 cool#8648 clipboard: fix idle tests
This is not part of CI at the moment, so I didn't notice it till Szymon
pointed it out.

	make -C cypress_test check-idle spec=calc/idle_spec.js

passes with this, which is the only suite in 'make check-idle'.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ieeb15653abcc016bc7de87115df136dfe3f27d0d
2024-04-25 15:09:51 +02:00
Gökay Şatır
e0a0646ce1 Use app.file.textCursor.rectangle instead of map._docLayer._visibleCursor.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I9108d5b3281cf6d2c904d227880e451b608d8d37
2024-04-25 15:42:35 +03:00
Gökay Şatır
a3abadc17e Use "app.file.textCursor.visible" instead of "map._isCursorVisible".
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Iedb841ec64b4fa72511603ac7e43c997676da837
2024-04-25 15:42:35 +03:00
Gökay Şatır
95d1b6d3ca Rename app.file.cursor to app.file.textCursor.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ic81a775efb6592e81f52e8b2a6789ac5a90c761c
2024-04-25 15:42:35 +03:00
Miklos Vajna
fa6d8f6dde cool#8806 clipboard: improve detection of HTML that's just an image
Copy an image in Firefox, paste in Chrome with the Paste button or with
Ctrl-V. Nothing happens in Calc, Writer gives you a popup to copy the
image, which is already the case.

What happens is that Clipboard.js already had some code to guess when
the HTML only contains an image, but while Chrome puts '<img ...' to the
clipboard, Firefox puts '<meta ...><img ...', so we don't recognize the
content as image.

Fix the problem by adding a new isHtmlImage() function to Clipboard.js
that handles both markups and use it from both places that deal with
paste (Paste button, keyboard).

Note that this manual parsing is needed, because the input is user
provided, so DOMParser or innerHTML would not be safe.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ia1340cd3777c5597e3fd257e905e9cc637802bcc
2024-04-25 08:33:49 +01:00
Michael Meeks
1b6af5e28d killpoco: remove lots of redundant JSON includes.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I976c5b8d6763cbbf0ee5cadfa2f7335ec719fe85
2024-04-25 09:06:13 +02:00
Neil Guertin
4f01c7e4de Cypress: Remove beforeAll and rewrite document loading helpers
New helpers setupDocument, loadDocument, reloadDocument
Clean up beforeEach functions
Replace most calls to beforeAll with setupAndLoadDocument
Replace calls to reload with reloadDocument

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I12307f93c8a418e6f55bb36b8afe340d7841b726
2024-04-25 07:37:56 +02:00
Neil Guertin
dfa13bfe62 Replace beforeAll with setupAndLoadDocument
Replace beforeAll in most tests with new helper function
Tests that need to close or reopen test files cannot use
the new function and will be updated later

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I372280e55993123fc26f83cb2e6e6e78665a6846
2024-04-25 07:37:56 +02:00
Neil Guertin
7cc0c1996e Cypress: Remove afterEach/afterAll
Cypress recommends NOT cleaning up after tests
  https://docs.cypress.io/guides/references/best-practices#Using-after-Or-afterEach-Hooks
Open documents should not affect other tests
Files will be closed automatically by the server anyways
Tests with more strict requirements can explicitly close
  documents before, during, or after those tests
This is necessary to support beforeAll cleanup
Half of tests were verifying the wrong filename was closed anyways

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: Iab458963a3fbfe87f732dc97140704c2d0ef53d4
2024-04-25 07:37:56 +02:00
Skyler
8510db5560 iOS: stop keyboard pushing content offscreen
Previously using the onscreen keyboard would shrink the visual viewport
while leaving the elements at the same size, meaning some of the content
had to be offscreen. As we scrolled the page to have the cursor in view,
this would move the notebook bar offscreen.

To avoid the possibility of the cursor leaving the screen or the bottom
toolbar being offscren, we can use the VisualViewport API to force the
logical viewport to have the same size as the visual one

This won't have an effect in iframes as the logical and visual viewport
in iframes are always the same, and we already scale to 100% height by
default anyway

Signed-off-by: Skyler <skyler.grey@collabora.com>
Change-Id: I07726bee8b61334f6a32e873ab2d5428fa60dca3
2024-04-24 21:53:19 +02:00
Attila Szűcs
4566ee65d1 writer: fix annotation size regression
Hidden contentNodes (in annotation) may become visible during resize.
Looks like setting style.max-height also change style.display.

Now i set it only if style.display is not none.

Signed-off-by: Attila Szűcs <attila.szucs@collabora.com>
Change-Id: I30f2eb75cb3ccb5b43044cef856314b0e35b9300
2024-04-24 19:59:26 +01:00
Attila Szűcs
e02ae8be7a writer: resize comments based on space
Make comments window bigger, if needed, and possible.
Selected commits grow up to MAX size, even if there is no space for it.

There is 2 constant limitation:
MAX - --annotation-max-size this is the maximum size commentText window
can grow. If the comment have more text, than it will have scrollbar.

MIN - --annotation-min-size if there is not enought space, but comment
have more text, this is the minimum size of commentText window.

note: commentText window can be smaller then MIN, if it has less text.

During doLayout:
first, in resetCommentsSize comments size resets to default.
(max-height = MIN size.)

after comments positioned with loopUp / loopDown,
resizeComments check all comments (maybe it could be optimized)

If a comment have more text as its actual size, then
it check the space between this, and next comment..
and resize this comment.

If there is not enought space after the comment, then
it check for more space between this, and previous comment, and
resize + move up the comment as much as needed.

Signed-off-by: Attila Szűcs <attila.szucs@collabora.com>
Change-Id: Ie7b0971febd8c965b01ebe23125eac4eded1a742
Signed-off-by: Attila Szűcs <attila.szucs@collabora.com>
2024-04-24 19:59:26 +01:00
Henry Castro
97f82d0a72 browser: preview: change place hoder to svg
spinner pre-loading previews

Change-Id: Ib6316d58da60fb537e238f93981f0cc8294f6885
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-24 12:05:29 -04:00
Henry Castro
780b5a8e67 browser: preview: simplify "layoutPreview"
Change-Id: Ia7b478cd14901e877dece81b57f418e8bdf1668b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-24 12:05:29 -04:00
Henry Castro
7d96728081 browser: preview: remove more unused code
Change-Id: I6431ee0093c006d142c2c0d3561a36ec31ba94f0
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-24 12:05:29 -04:00
Gülşah Köse
1d84071fc5 Prevent opening multiple tooltip on drawing area widgets
We see multiple tooltip problem on drawing area widgets.
Example case:
    Add basic shape into a writer document
    Right click on shape and open Position and Size dialog
    Select the Rotation tab
    Hold the rotation angle widget and drag around itself
When you inspect the "Rotation Angle" tooltip, count may be 600
We expect only 1.

So we prevent to show another tooltip if we have already one.

Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: I2f548f8c7afce8095e83a6faa3722e164f990210
2024-04-24 17:07:03 +02:00
Gökay Şatır
dc7b6d93a3 Add HTMLObjectSection for using for icons.
Replace dropdownmarker with an instance of HTMLObjectSection, which doesn't use lat/lng.

Signed-off-by: Gökay Şatır <gokaysatir@collabora.com>
Change-Id: I152ed3ea4120c0682d057b2beedd4e5d8910da17
2024-04-24 16:44:43 +03:00
Michael Meeks
2d1865a8f6 logging: remove now unused StreamLogger.
Change-Id: Ic8a28dcc97aa0b17d2cb8efa99c42f7791486a15
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-04-24 10:59:51 +01:00
Michael Meeks
884a841cde Logging: wrap poco and simplify logging.
Centralize more logging functionality in Log.cpp, simplify and
wrap underlying logging APIs better.

Code is much more generic, and hides implementation details
much more thoroughly, while keeping the same API / wrappers.

To do this we have to sub-class Poco::Logger to get access to
its generic 'log' method instead of a mess of in-line wrappers,
this lets us avoid lots of code.

Change-Id: I541d3aef49f99ce582655c5102a0041bf84cd56a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-04-24 10:59:51 +01:00
Henry Castro
722a2e57d2 wsd: simplify LOG_MESSAGE to the logging framework
Change-Id: I997855e586783451a556cefe2860f9384585045a
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-24 10:59:51 +01:00
Henry Castro
1271ee3e7f wsd: remove "PRIO" parameter to the logging framework
remove POCO dependency enumerator value.

Change-Id: I2abccd591374db96be81932d25b59fb0b10bac69
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-04-24 10:59:51 +01:00