OneMore icon indicating copy to clipboard operation
OneMore copied to clipboard

Adding Snippet Box Does Not Properly Resize Default-Width Outline

Open dwillis77 opened this issue 10 months ago • 5 comments
trafficstars

Problem to Solve

First let me start by saying this is a very minor issue but I figured I'd bring it up. If a predefined snippet box (e.g. "info", "warning", etc.) is added to a page whose outline is at the default width, because the default width of the snippet box is wider than this, OneNote will auto-expand the outline to match but the rest of the page content does not get expanded with it.

I believe this is actually a OneNote bug at its core (with its outline's auto-resizing functionality), not an issue with OneMore, because the same thing happens with images (e.g. insert an image that is wider than the default outline width onto a page that has a default-width outline on it, and the outline will expand to accommodate the image but the page content will stay aligned to the previous width). The wider the added object is, the more pronounced the issue is. See below for screenshots with an example of what I mean.

With that in mind, I'm wondering if this issue could be "fixed" by simply explicitly setting the outline width to that of the snippet box if it's current width is less (as opposed to letting OneNote auto-resize) since the adjustment of existing page content seems to work perfectly when the outline is manually resized.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new page and add some text content (enough to wrap around at least once) - do not manually resize the outline (leave at its default width)
  2. Add a snippet box (e.g. info, warning, etc.) to the same page
  3. See that the outline auto-expands to accommodate the snippet box, however the text and other page content does not adjust to match (it stays wrapped at the previous width).

Expected Behavior

The outline on the OneNote page should expand to accommodate the snippet box, and all content within the outline should adjust to match.

Screenshots

When snippet box is added to outline with default width (user has not resized outline at all), the outline auto-expands but the extra space is not used by any content other than the object that forced the auto-expansion:

Image

However, when a snippet box is added to an outline with a non-default width (meaning the user has already resized the outline manually), then the outline does auto-expand properly to the width of the box, and the extra space is properly used by all page content:

Image

Environment (if applicable)

  • OneNote Version: Office 365 version 2408 (build 17928.20392) semi-annual channel, 64-bit
  • OneMore Version: 6.7.1

Additional Context

The workaround I've always used for this issue (which works whether the object being inserted is an image or a snippet box) is to just manually resize the outline a tiny bit, and this will get all the other page content to adjust/re-wrap to fit the new outline size. So again, this is a minor issue that has a workaround - but I figured I'd bring it up just in case it might be easy to fix.

dwillis77 avatar Jan 23 '25 05:01 dwillis77

This is not a bug at all; it is by design. The code is here, in case you're a developer:

  • If in a table cell, it tries to use the width of the cell.
  • If in an outline with a user-set width, it will use that width
  • If in an outline without a user-set width, it defaults the Box snippets to 600 to accommodate "reasonable" content

I could add a setting to change the DefaultWidth for that last case.

Note that those Box snippets are just tables (or tables with hidden borders inside tables), so can be easily adjusted after inserted.

EDIT: After reminding myself, the Info/Warn boxes are a bit more stringent. But that was also a design choice considering their use; I did not expect people to want to put them into small spaces. And, because these are indeed tables-within-tables, it makes the user experience confusing if you try to edit and adjust content with a dynamic table floating inside dynamic a table. It's the lesser of two evils.

stevencohn avatar Jan 25 '25 13:01 stevencohn

Thanks for the reply. Indeed, I think it's the behavior of OneNote that is the issue here, not the behavior of OneMore. It's just simply the fact that when any object apparently (image, table, etc.) is added to an outline that has a default/non-user-set width, if that object's width is wider than whatever the outline's default is, the outline will appear to stretch but the content inside will not adjust with it.

I think the logic used by OneMore you described which is used when adding a new snippet box makes perfect sense. The only changes I would ask for would be concerning case 3 from your post - the other two I think are good as-is.

The two possible solutions I can think of would be to either set the default width of new snippets to default to whatever the outline's current size is (even if it is currently at "default size", not modified by the user), or have a configurable default width that the user could configure. Even if the configurable default width is added, I still think it would be nice to have the snippet box default its width to whatever the outline width is (even if the outline is at default width). Maybe set an absolute minimum though if there is concern about it jumbling things up if added to a very small outline (since as you mentioned, these were clearly designed for use in larger spaces, not very small ones).

As an example (just throwing out numbers here) - default behavior could be: if outline is >200, set snippet to outline width; if outline is <= 200, set snippet width to 200, and let user override this default behavior with a static default width in settings if desired. If no static default is specified in the settings, then the "dynamic" default behavior takes over.

dwillis77 avatar Jan 28 '25 05:01 dwillis77

Code Box and Text Box cannot be inserted at a horizontal position greater than 600, is this the expected result? @stevencohn

felixrw avatar Mar 09 '25 10:03 felixrw

One other note to add here, resizing snippet boxes down is a pain because there are apparently two underlying tables (or maybe one is the column edge, the other is the actual table edge, although I'd think those would be the same in a one-column table?) that have to be resized.

When expanding outward (increasing horizontal size), expanding the "inner" box (which appears to be the edge of the "visible" box) will expand both of them. However when decreasing horizontal size, dragging the edge of the inner table inward does not resize the outer table. That means if we then try to resize down the containing ON outline to match the snippet box size, we can't, because the invisible 2nd table is blocking it. If we mouse over exactly the correct point, the mouse cursor will change to a resize cursor and we can then click-drag to resize down the outer table, after which we can resize down the ON outline as well. But it's a hassle.

Is there anything we could potentially do to remedy some of these issues?

dwillis77 avatar Apr 30 '25 01:04 dwillis77

Yeah, I get it. But no, not really. They're simply OneNote tables, the inner one with a hidden border - that you can unhide if you need to.

Other than changing the layout of the snippet itself, or creating your own custom snippet to save and reuse, there's nothing that can really be done here. It's just the way the tables work.

stevencohn avatar Apr 30 '25 02:04 stevencohn