webxdc/editor
16
9
Fork
You've already forked editor
2

general layout issues #11

Closed
opened 2023年07月12日 16:25:31 +02:00 by r10s · 8 comments
Owner
Copy link

before diving into detailed layout tweaking (size, button placements, save feedback etc), we should fix the following larger layout glitches:

  • the toolbar scrolls away when scrolling editor content. this is bad, the toolbar should really always stay visible at the top of the screen
    EDIT: this is still an issue on iOS

  • the toolbar needs to handle overflow more gracefully. currently, things break in another row, however, without resizing the outer box (so that items are over the vertical line:

Screenshot 2023年07月12日 at 16.17.31.png

for a good layout, we need the possibility to left- and right-align items in the toolbar plus the option to have at least one item that shows a menu (similar to the current "Type...")

before diving into detailed layout tweaking (size, button placements, save feedback etc), we should fix the following larger layout glitches: - [ ] the toolbar scrolls away when scrolling editor content. this is bad, the toolbar should really always stay visible at the top of the screen EDIT: this is still an issue on iOS - [x] the toolbar needs to handle overflow more gracefully. currently, things break in another row, however, without resizing the outer box (so that items are over the vertical line: ![Screenshot 2023年07月12日 at 16.17.31.png](/attachments/23118eb8-8d89-4dbb-8a9f-11be478e99b3) for a good layout, we need the possibility to left- and right-align items in the toolbar plus the option to have at least one item that shows a menu (similar to the current "Type...")
Author
Owner
Copy link

reopening as the scrollbar is still not fixed on iOS, i did not have a closer look at possible reasons yet

EDIT: double checked that i was using the correct version (recent master)

reopening as the scrollbar is still not fixed on iOS, i did not have a closer look at possible reasons yet EDIT: double checked that i was using the correct version (recent master)
r10s added this to the MVP M3 milestone 2023年07月20日 17:47:35 +02:00
Author
Owner
Copy link

if one looks closely, the scrolling away of the scrollbar is also visible in desktop shortly:

  • type some pages of text into a document
  • close the document
  • reopen the document
  • scroll down really fast
  • -> you'll see some flickering of the toolbar, that gets fixed, however

i think, this "fixing" is not working on ios, however, if one is using really "sticky" layout elements, it should not flicker at all. so i think, we should use sth. as position: sticky - not sure how the current fix is supposed to work at all

if one looks closely, the scrolling away of the scrollbar is also visible in desktop shortly: - type some pages of text into a document - close the document - reopen the document - scroll down _really fast_ - -> you'll see some flickering of the toolbar, that gets fixed, however i think, this "fixing" is not working on ios, however, if one is using really "sticky" layout elements, it should not flicker at all. so i think, we should use sth. as `position: sticky` - not sure how the [current fix](https://codeberg.org/webxdc/editor/commit/5bf0452651174c9c86c16730a0b7fdbcc452e33d) is supposed to work at all

@Septias could you please tell where you got this CSS

Lines 82 to 406 in add1be9
Preview has been truncated
/* Prosemirror's example style */
.ProseMirror {
position: relative;
}
.ProseMirror {
word-wrap: break-word;
white-space: pre-wrap;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
}
.ProseMirror pre {
white-space: pre-wrap;
}
.ProseMirror li {
position: relative;
}
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection *::-moz-selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
.ProseMirror-selectednode {
outline: 2px solid #8cf;
}
/* Make sure li selections wrap around markers */
li.ProseMirror-selectednode {
outline: none;
}
li.ProseMirror-selectednode:after {
content: "";
position: absolute;
left: -32px;
right: -2px; top: -2px; bottom: -2px;
border: 2px solid #8cf;
pointer-events: none;
}
.ProseMirror-textblock-dropdown {
min-width: 3em;
}
.ProseMirror-menu {
margin: 0 -4px;
line-height: 1;

? I feel like the problem is here:

position: relative;

Because the stickiness is supposed to behave differently on iOS:

github.com/ProseMirror/prosemirror-menu@1870eca2b6/src/menubar.ts (L59)

github.com/ProseMirror/prosemirror-menu@1870eca2b6/src/menubar.ts (L127)

@Septias could you please tell where you got this CSS https://codeberg.org/webxdc/editor/src/commit/add1be95a87a34c5462ab10a79ca038f88195d7e/src/styles/style.css#L82-L406 ? I feel like the problem is here: https://codeberg.org/webxdc/editor/src/commit/add1be95a87a34c5462ab10a79ca038f88195d7e/src/styles/style.css#L245 Because the stickiness is supposed to behave differently on iOS: https://github.com/ProseMirror/prosemirror-menu/blob/1870eca2b6512f260a45480b4072b38f8965cbee/src/menubar.ts#L59 https://github.com/ProseMirror/prosemirror-menu/blob/1870eca2b6512f260a45480b4072b38f8965cbee/src/menubar.ts#L127
Author
Owner
Copy link

Because the stickiness is supposed to behave differently on iOS:

weird. why so, prosemirror? :)

but anyways, we should find a solution here. if in doubt, we should not use the toolbar of prosemirror (is it easily replaceable? it seems to be a separate dependency). but let's postpone this issue and target the other ones first

> Because the stickiness is supposed to behave differently on iOS: weird. why so, prosemirror? :) but anyways, we should find a solution here. if in doubt, we should not use the toolbar of prosemirror (is it easily replaceable? it seems to be a separate dependency). but let's postpone this issue and target the other ones first

weird. why so, prosemirror? :)

Yes github.com/ProseMirror/prosemirror-menu@1870eca2b6/src/menubar.ts (L59)

Edit: oh, you're asking Prosemirror 😅

> weird. why so, prosemirror? :) Yes https://github.com/ProseMirror/prosemirror-menu/blob/1870eca2b6512f260a45480b4072b38f8965cbee/src/menubar.ts#L59 Edit: oh, you're asking Prosemirror 😅
Author
Owner
Copy link

if in doubt, we probably can copy prosemirror-menu similar to #22 (comment)

if in doubt, we probably can copy `prosemirror-menu` similar to https://codeberg.org/webxdc/editor/issues/22#issuecomment-1009121

if in doubt, we probably can copy prosemirror-menu similar to #22

It's still an option of prosemirror-menu:

Lines 127 to 131 in 6972781
// TODO `floating` doesn't work the way we want it to on iOS. See
// https://codeberg.org/webxdc/editor/issues/11
// Also maybe just replace it with `position: sticky`, like here:
// https://codeberg.org/webxdc/editor/pulls/32
floating: true,
> if in doubt, we probably can copy prosemirror-menu similar to #22 It's still an option of `prosemirror-menu`: https://codeberg.org/webxdc/editor/src/commit/6972781877a321f3183791f175b6fcb18dcf52ac/src/prosemirror-setup.js#L127-L131
Author
Owner
Copy link

closing this more general issue in favour of a dedicated #43

closing this more general issue in favour of a dedicated https://codeberg.org/webxdc/editor/issues/43
Sign in to join this conversation.
No Branch/Tag specified
main
tooling
add-presence
link2xt/autosave-interval-limit
hpk/tryquill
hpk/cleanup-indexhtml
target-legacy
inline-b64
webxdc-x-web-version
pages-demo
status-string
toolbar-position-sticky
v3.2.0
v3.1.1
v3.1.0
v3.0.0
v2.7.0
v2.6.0
v2.5.1
v2.5.0
v2.4.0
v2.3.0
v2.2.1
v2.2.0
v2.1.0
v2.0.2
v2.0.1
v2.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
webxdc/editor#11
Reference in a new issue
webxdc/editor
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?