Skip to content

Comments

mailbox management fix UI#41

Open
printminion-co wants to merge 11 commits intofeature/provider_mails_adminfrom
mk/dev/mailboxadmin-fix-ui
Open

mailbox management fix UI#41
printminion-co wants to merge 11 commits intofeature/provider_mails_adminfrom
mk/dev/mailboxadmin-fix-ui

Conversation

@printminion-co
Copy link

@printminion-co printminion-co commented Feb 19, 2026

@printminion-co printminion-co force-pushed the mk/dev/mailboxadmin-fix-ui branch 2 times, most recently from fa8bf02 to dffbbd2 Compare February 19, 2026 16:38
@printminion-co printminion-co mentioned this pull request Feb 19, 2026
4 tasks
@printminion-co printminion-co added this to the ncw-4 milestone Feb 19, 2026
@printminion-co printminion-co force-pushed the mk/dev/mailboxadmin-fix-ui branch from dffbbd2 to 732b486 Compare February 19, 2026 17:02
@printminion-co printminion-co changed the title fix UI mailbox fix UI Feb 19, 2026
@printminion-co printminion-co marked this pull request as ready for review February 19, 2026 17:03
@printminion-co printminion-co force-pushed the mk/dev/mailboxadmin-fix-ui branch 2 times, most recently from a08601a to 732b486 Compare February 19, 2026 17:03
@printminion-co printminion-co changed the title mailbox fix UI mailbox management fix UI Feb 20, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds mailbox update functionality to the mail provider administration interface, allowing administrators to edit email localparts and display names for managed mailboxes. The PR implements a comprehensive feature including backend API endpoints, service layer logic, frontend UI components with inline editing, and extensive test coverage.

Changes:

  • Added updateMailbox API endpoint with proper authorization and validation
  • Implemented IONOS-specific mailbox update logic with email uniqueness checks
  • Enhanced UI with inline editing capabilities, virtual scrolling for performance, and improved styling
  • Added 24 comprehensive unit tests covering edge cases and error scenarios

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/Controller/ExternalAccountsController.php Added updateMailbox endpoint with input validation, error handling, and display name update logic
lib/Provider/MailAccountProvider/IMailAccountProvider.php Extended interface with updateMailbox method signature
lib/Provider/MailAccountProvider/Implementations/IonosProvider.php Implemented updateMailbox by delegating to facade
lib/Provider/MailAccountProvider/Implementations/Ionos/IonosProviderFacade.php Added updateMailbox with email uniqueness validation and local account synchronization
lib/Provider/MailAccountProvider/Implementations/Ionos/Service/Core/IonosAccountMutationService.php Implemented updateMailboxLocalpart with IONOS API integration and conflict detection
lib/Provider/MailAccountProvider/Dto/MailboxInfo.php Added withMailAppAccountName method for immutable updates
lib/Exception/AccountAlreadyExistsException.php New exception class for handling email conflicts with structured error data
lib/Settings/Section/MailProviderAccountsSection.php Changed icon from mail.svg to mail-dark.svg for better dark mode support
appinfo/routes.php Registered PUT endpoint for mailbox updates
src/service/ProviderMailboxService.js Added updateMailbox service method
src/components/provider/mailbox/ProviderMailboxListItem.vue Implemented inline editing with validation, loading states, and error handling
src/components/provider/mailbox/ProviderMailboxAdmin.vue Integrated VirtualList component and handleUpdate method
src/components/provider/mailbox/shared/VirtualList.vue New component for virtualized list rendering with scroll optimization
src/components/provider/mailbox/shared/MailboxListHeader.vue New header component with debug column support
src/components/provider/mailbox/shared/MailboxListFooter.vue New footer component showing mailbox count and loading state
src/components/provider/mailbox/shared/styles.scss Shared styles for mailbox list components
src/components/Envelope.vue Minor indentation fix (unrelated to main PR)
tests/Unit/Controller/ExternalAccountsControllerTest.php Added 24 comprehensive tests for updateMailbox endpoint
tests/Unit/Provider/MailAccountProvider/Implementations/Ionos/Service/Core/IonosAccountMutationServiceTest.php Updated test setup with queryService dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

* In Mailbox.onDelete, fetchNextEnvelopes requires the current envelope to find the next envelope.
* Therefore, it must run before removing the envelope.
*/
*/
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indentation fix (converting tabs to spaces in the comment block) is unrelated to the mailbox management feature being added in this PR. While it's a harmless improvement to code consistency, it would be better to keep such formatting fixes in separate commits or PRs to maintain clear commit history and make code reviews easier.

Copilot uses AI. Check for mistakes.
} catch (ServiceException $e) {
// Convert 409 conflicts to AccountAlreadyExistsException
if ($e->getCode() === 409) {
throw new \OCA\Mail\Exception\AccountAlreadyExistsException(
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing import statement for AccountAlreadyExistsException. While the fully qualified class name is used in the throw statement on line 366, it's better practice to add a proper use statement at the top of the file for consistency with the rest of the codebase. This also makes the code more maintainable.

Copilot uses AI. Check for mistakes.
Comment on lines +125 to +129
beforeDestroy() {
if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
},
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memory leak: The scroll event listener added in the mounted hook (line 122) is not removed in the beforeDestroy hook. This could lead to memory leaks if the component is destroyed and recreated multiple times. Add this.$el.removeEventListener('scroll', this.onScroll) in the beforeDestroy hook.

Copilot uses AI. Check for mistakes.
Comment on lines +98 to +99
const lastIndex = this.dataSources.length - this.startIndex - this.shownItems
const hiddenAfterItems = Math.min(this.dataSources.length - this.startIndex, lastIndex)
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential negative padding issue: When the number of items is less than the visible area (dataSources.length < shownItems), the calculation of hiddenAfterItems can result in a negative value. For example, if dataSources.length=5, startIndex=0, and shownItems=10, then lastIndex=-5 and hiddenAfterItems=-5, leading to negative paddingBottom. Consider wrapping the calculation with Math.max(0, ...) to prevent negative padding values.

Suggested change
const lastIndex = this.dataSources.length - this.startIndex - this.shownItems
const hiddenAfterItems = Math.min(this.dataSources.length - this.startIndex, lastIndex)
const lastIndex = Math.max(0, this.dataSources.length - this.startIndex - this.shownItems)
const hiddenAfterItems = lastIndex

Copilot uses AI. Check for mistakes.
Copy link

@tanyaka tanyaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's lowercase email input.

…d structure and styling

Refactor the mailbox list UI to use a more semantic structure with divs instead of tables,
implement sticky headers, and improve styling for better usability and consistency.
This change aims to enhance the user experience by providing a clearer layout and
more intuitive interaction with mailbox items.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…or better visibility

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…x update

Special handling for 404 errors has been added to provide a more helpful message when the mailbox cannot be found.
This enhances user experience by guiding users to verify mailbox existence or contact support.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…header and footer components

This update introduces a virtualized mailbox list to enhance performance
when rendering large datasets. The new structure includes a dedicated
header and footer component for better organization and user experience.
The mailbox list now efficiently handles scrolling and loading states.

Additionally, the styling has been improved for better visual consistency
across the mailbox administration interface.

Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@update="handleUpdate">
<template #before>
<caption class="hidden-visually">
{{ t('mail', 'List of mailboxes. This list is not fully rendered for performance reasons. The mailboxes will be rendered as you navigate through the list.') }}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caption text is quite verbose and technical. Consider simplifying to something like "Mailbox list with virtual scrolling for better performance" for better accessibility. Screen reader users will hear this when navigating the table.

Suggested change
{{ t('mail', 'List of mailboxes. This list is not fully rendered for performance reasons. The mailboxes will be rendered as you navigate through the list.') }}
{{ t('mail', 'Mailbox list with virtual scrolling for better performance.') }}

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +76
overflow-wrap: anywhere;
}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The combination of white-space: nowrap and overflow-wrap: anywhere is conflicting. The overflow-wrap property has no effect when white-space: nowrap is set, since wrapping is already prevented. Consider removing overflow-wrap: anywhere since the text-overflow: ellipsis with white-space: nowrap will handle overflow correctly.

Suggested change
overflow-wrap: anywhere;
}
}

Copilot uses AI. Check for mistakes.
Comment on lines +96 to +103
tbodyStyle() {
const isOverScrolled = this.startIndex + this.shownItems > this.dataSources.length
const lastIndex = this.dataSources.length - this.startIndex - this.shownItems
const hiddenAfterItems = Math.min(this.dataSources.length - this.startIndex, lastIndex)
return {
paddingTop: `${this.startIndex * this.itemHeight}px`,
paddingBottom: isOverScrolled ? 0 : `${hiddenAfterItems * this.itemHeight}px`,
}
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation of hiddenAfterItems appears incorrect. When computing padding for items after the visible area, you're using Math.min(this.dataSources.length - this.startIndex, lastIndex) where lastIndex is already the count of hidden items after. This logic seems confused. Consider: hiddenAfterItems should be Math.max(0, this.dataSources.length - this.startIndex - this.shownItems) to correctly calculate remaining items.

Copilot uses AI. Check for mistakes.
v-for="(item, i) in renderedItems"
:key="item[dataKey]"
:mailbox="item"
:visible="(i >= bufferItems || index <= bufferItems) && (i < shownItems - bufferItems)"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visible prop is calculated and passed to child components but doesn't appear to be used by ProviderMailboxListItem. If this is intentional for progressive rendering or future use, consider adding a comment explaining its purpose. Otherwise, this prop can be removed to simplify the code.

Suggested change
:visible="(i >= bufferItems || index <= bufferItems) && (i < shownItems - bufferItems)"

Copilot uses AI. Check for mistakes.
…tyles

Sass @import is deprecated and will be removed in Dart Sass 3.0.0.
Using @use is the modern replacement and avoids the deprecation warning
emitted during webpack compilation.

Signed-off-by: Tatjana Kaschperko Lindt <kaschperko-lindt@strato.de>
…ndicator

Sass is changing behavior for declarations that appear after nested rules
to match the CSS spec. Moving background-color above the @media block
keeps the existing behavior and eliminates the mixed-decls warning.

Signed-off-by: Tatjana Kaschperko Lindt <kaschperko-lindt@strato.de>
Sass emits a mixed-decls warning when plain declarations appear after
nested rules (produced by @include). Moving border-top above the
@include statements keeps correct rendering and silences the warning.

Signed-off-by: Tatjana Kaschperko Lindt <kaschperko-lindt@strato.de>
…ugin

CKEditorWebpackPlugin requires a strategy when multiple JS entry points
are present. Using translationsOutputFile targeting mail.js appends
CKEditor translations to that bundle, resolving the 'Too many JS assets'
error during compilation.

Signed-off-by: Tatjana Kaschperko Lindt <kaschperko-lindt@strato.de>
Signed-off-by: Tatjana Kaschperko Lindt <kaschperko-lindt@strato.de>
Signed-off-by: Tatjana Kaschperko Lindt <kaschperko-lindt@strato.de>
…ar component

this breaks info-popover by clicking on user icon

Signed-off-by: Tatjana Kaschperko Lindt <kaschperko-lindt@strato.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants