Closed Bug 2083474 Opened 1 month ago Closed 29 days ago

Search Messages has broken dragging, custom headers, deletion warnings, and column and sort state

Categories

(Thunderbird :: Search, defect)

Thunderbird 160
defect

Tracking

(thunderbird_esr153 unaffected, thunderbird158 unaffected, thunderbird159 unaffected, thunderbird160 affected)

RESOLVED FIXED
160 Branch
Tracking Status
thunderbird_esr153 --- unaffected
thunderbird158 --- unaffected
thunderbird159 --- unaffected
thunderbird160 --- affected

People

(Reporter: welpy-cw, Assigned: welpy-cw)

References

(Regression)

Details

(Keywords: regression)

Attachments

(5 external files)

The Search Messages dialog has several regressions after bug 2079158, introduced by the TreeView conversion and the subsequent dead-code cleanup.

  1. Invalid initial sort state

Steps: Open Search Messages in a profile with no saved sorting settings for the dialog.
Actual: The console prints primarySortColumnId: unsupported sort type: 0 twice. The backend sort type and sort order are both 0, although the header displays a date sort indicator.
Expected: A valid default sort, with the indicator matching the backend state.
Cause: In searchOnLoad() in searchDialog.js, xulStore.getValue() returns an empty string for a missing value, so the ?? defaults do not apply. The fallback column also needs to be dateCol rather than date. Using || for both defaults and dateCol fixes this case.

  1. Dragging search results produces no message payload

Steps: Run a search, select a result, and drag it to another mail folder or the filesystem.
Actual: The drag handler supplies no message data.
Expected: Dragging should transfer the selected messages or export them as message files.
Cause: ThreadPaneOnDragStart() still reads gFolderDisplay.selectedMessageUris, but the cleanup removed that getter. The handler therefore returns immediately, even with a selected message.

  1. Custom search-header editing throws an exception

Steps: In a search criterion, choose Customize from the search-attribute menu, then close the custom-header dialog.
Actual: ReferenceError: UpdateAfterCustomHeaderChange is not defined. The header menus are not rebuilt and the chosen header is not selected.
Expected: The menus should refresh and select the chosen custom header.
Cause: The cleanup removed UpdateAfterCustomHeaderChange() from searchDialog.js, but the shared widget in searchWidgets.js still calls it after the modal dialog returns.

  1. The delete-column button bypasses deletion confirmation

Steps: Search a Trash folder containing disposable messages, enable the Delete column, and click its delete icon with mail.warn_on_delete_from_trash enabled.
Expected: The existing permanent-deletion confirmation should be shown and cancellation should preserve the message.
Cause: The new request-delete handler calls applyCommandToIndices() directly. The previous handler went through cmd_delete and MailUtils.confirmDelete().
Validation: In a temporary test with disposable messages in a normal local folder, the toolbar called a confirmation helper stub that returned false and did not delete. The delete-column button bypassed the same stub and deleted the message. Permanent deletion from Trash was not exercised by that test; the missing warning follows from bypassing the helper that implements it.

  1. Resized column widths are discarded

Steps: Resize the Subject column, then toggle another column in the column picker. Also close and reopen the dialog after resizing.
Actual: Resized widths are not retained. Updating column visibility recreates the headers and discards their width styles.
Expected: Resized widths should survive visibility changes and reopening the dialog.
Cause: updateColumns() recreates the headers without restoring widths. The dialog also lacks the column-resized listener and width persistence/restoration used by about3Pane.js.

Validation: Initial-sort assertions in browser_searchMessages.js failed with sort type/order 0 before the fallback fix and passed afterward. A separate temporary headless browser diagnostic reproduced the missing drag payload, custom-header callback error, discarded width, and confirmation bypass. The full existing search-dialog test encounters a separate headless drag-service failure later in its column-reordering section.

Use the date column ID and apply defaults when XUL store values are empty. Add headless coverage for the initial sort and restoration of a user-selected sort.

Read selected message URIs directly from the database view instead of the removed FolderDisplayWidget getter. Cover empty, single, and multiple selections and the message and file export payloads.

Restore the callback used by the shared search attribute widget after the custom header editor closes. Verify that all criteria refresh, the chosen header is selected, and cancellation leaves a valid attribute.

Use the existing deletion confirmation helper with the clicked message folder so warnings apply even when a different folder has the selection. Cover cancellation and confirmed permanent deletion from Trash.

Save resized widths with the existing column states and restore them through the table column definitions. Verify that multiple resized columns retain their widths after visibility changes and reopening the dialog.

Target Milestone: --- → 160 Branch

Pushed by vineet@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/20527b6e2f45
Part 1: Initialize search results with valid sort defaults. r=darktrojan
https://hg.mozilla.org/comm-central/rev/63fd159903e6
Part 2: Restore dragging messages from search results. r=darktrojan
https://hg.mozilla.org/comm-central/rev/7b574c4583d1
Part 3: Restore custom search header editing. r=darktrojan
https://hg.mozilla.org/comm-central/rev/0ac179533417
Part 4: Confirm deletion from the search results delete column. r=darktrojan
https://hg.mozilla.org/comm-central/rev/3a9ee6027cd5
Part 5: Persist search result column widths. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: