View Issue Details

IDProjectCategoryView StatusLast Update
0035645mantisbtuipublic2025-08-21 19:20
Reporterraspopov Assigned Tocommunity  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.27.1 
Target Version2.28.0Fixed in Version2.28.0 
Summary0035645: Some widgets are not collapsible
Description

The "Time Tracking" (bugnote_stats_inc.php), "Activities" (bugnote_view_inc.php) and "Issue History" (bug_view_inc.php) widgets have a broken collapse feature.

I broke the second and third options myself at: MantisBT master 10971ed1

TagsNo tags attached.

Relationships

related to 0035503 resolvedcommunity The MantisBT web interface must pass HTML validation (part 2) 
related to 0036149 resolveddregad Cookie not set to keep filters collapsed 
related to 0036265 assigneddregad Search with collapsed filter section expands it 

Activities

raspopov

raspopov

2025-03-20 12:32

reporter   ~0070008

Last edited: 2025-03-21 10:19

PR: https://github.com/mantisbt/mantisbt/pull/2129

For now, we'll have to leave the HTML error - duplicate values of `id' tag attributes. I haven't found out why it happens this way.

I think we can carefully rename the widget id's, but temporarily their old names will be present in the database.

raspopov

raspopov

2025-03-21 10:16

reporter   ~0070010

I've found three different ways MantisBT collapses UI elements:

  1. Ace widgets and sidebar:

    • Code: ace.js + common.js
    • Print via: directly on page + using is_collapsed() from collapse_api.php
    • Set via: data-action="collapse" + id="id" attributes
    • Saved to cookies and database.
  2. "Select Profile" (platform) button, attachment button, sponsoring button.

    • Code: common.js
    • Print via: collapse_open()/collapse_close()/collapse_icon() from collapse_api.php
    • Set via: class="collapse-open|collapse-closed|collapse-link" + id="id" attributes
    • Saved to cookies and database.
  3. The navbar avatar button, on the small screen only:

    • Code: Bootstrap collapse.js
    • Print via: directly on page
    • Set via: data-toggle="collapse" + data-target="#id" or href="#id" attributes
    • Not saved.

That shocked me.

I've added edits to this PR to include loading widgets and sidebar status from cookies. So anonymous users can use it.

dregad

dregad

2025-03-21 11:23

developer   ~0070011

That's the kind of silliness you sometimes get when working on a 25 years old code base ;-)

It's great that you are able to analyze these things in depth and improve them. Thank you !

raspopov

raspopov

2025-03-22 01:20

reporter   ~0070019

I think we should put all the code that prints widgets from all the files in one place as functions like layout_widget_begin()/layout_widget_and(). This will simplify further code maintenance, nowadays it is very difficult to track where and what is printed.

For example news widgets (print_news_entry()) have an arrow to minimize, but no code to save that state, unlike similar widgets elsewhere. This is the way it has always been since the introduction of the new UI.

dregad

dregad

2025-03-22 17:17

developer   ~0070022

put all the code that prints widgets from all the files in one place as functions like layout_widget_begin()/layout_widget_and().

Sounds like a good idea, makes sense.
I assume you intend to replace the generic term widget by something more specific

Related Changesets

MantisBT: master 10971ed1

2025-02-26 10:56

raspopov

Committer: dregad


Details Diff
Fix Nu Html Checker issues

Fix various Nu Html Checker issues in dropzone (print_api.php):

- Error: Element img is missing required attribute src.
- Error: An img element must have an alt attribute, except under certain
conditions.

In bug_view_inc.php:

- Error: Element tbody not allowed as child of element table in this
context.
- Error: Duplicate ID history.

In bug_update_page.php and bugnote_view_inc.php:

- Error: The width attribute on the td element is obsolete.
- Warning: A table row was 0 columns wide, which is less than the column
count established by the first row (6).
- Error: Element option without attribute label must not be empty.
- Error: Duplicate ID bugnotes.

In print_all_bug_page.php:

- Error: Stray end tag td.
- Error: Row 2 of a row group established by a tbody element has no
cells beginning on it.
- Warning: A table row was 10 columns wide and exceeded the column count
established by the first row (5).

In print_all_bug_page_word.php:

- Error: The width attribute on the td element is obsolete.
- Error: Row 2 of a row group established by a tbody element has no
cells beginning on it.
Affected Issues
0035644, 0035645
mod - bug_update_page.php Diff File
mod - bug_view_inc.php Diff File
mod - bugnote_view_inc.php Diff File
mod - core/print_api.php Diff File
mod - print_all_bug_page.php Diff File
mod - print_all_bug_page_word.php Diff File

MantisBT: master 21428f7e

2025-03-21 19:07

raspopov

Committer: community


Details Diff
Fix collapsible widgets

One new fix and two regression fixes in
10971ed15a2f8476130c996f54dda6dc068828f9.

Fix restoring collapse state from cookies.

Fixes 0035645, PR https://github.com/mantisbt/mantisbt/pull/2129
Affected Issues
0035645
mod - bug_view_inc.php Diff File
mod - bugnote_stats_inc.php Diff File
mod - bugnote_view_inc.php Diff File
mod - js/common.js Diff File