Skip to content

feat: let users order the fields shown under each contact name - #5889

Open
djs42012 wants to merge 2 commits into
nextcloud:mainfrom
djs42012:feat/list-subtitle-setting
Open

djs42012 wants to merge 2 commits into
nextcloud:mainfrom
djs42012:feat/list-subtitle-setting

Conversation

@djs42012

@djs42012 djs42012 commented Nov 8, 2026

Copy link
Copy Markdown

Closes #5786

The line under each name in the contacts list followed a fixed rule: organization, then email, then phone. This adds "Show under each name" to the General settings. It is an ordered list of Organization, Email and Phone number, moved with up and down buttons, and each contact shows the first field in that order that it has. The default is the old order, so no list changes until its user reorders it.

The order is a per-user config value, subtitle_order, declared in the config lexicon and provided as initial state. A new OCS endpoint saves it, PUT /api/v1/settings/subtitle-order, which accepts only org, email and tel, each exactly once.

The ordering replaces the fixed choices proposed in #5786, where "Automatic" and "Organization first" were the same order. An ordering covers the other choices and also sets their fallbacks.

Tests: Jest for picking the line and saving the order, and PHPUnit for the service, the endpoint and the initial state. Tested by hand on Nextcloud 33.0.10 with two users.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@djs42012

djs42012 commented Nov 8, 2026 •

Copy link
Copy Markdown
Author
1794165444484216244

Settings dialog with the new list, in the default order.

@djs42012

djs42012 commented Nov 8, 2026

Copy link
Copy Markdown
Author
image

Contact list after moving phone number to the top. Organization still shows ahead of email when both are present

Comment thread lib/ConfigLexicon.php
self::SUBTITLE_ORDER,
ValueType::ARRAY,
defaultRaw: SubtitleOrderService::DEFAULT_ORDER,
definition: 'Order in which the contacts list tries org, email and tel for the line under each name.',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason this isn't lazy?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Switched to lazy, matching the other entries in the lexicon.

@GVodyanov GVodyanov left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot for the contribution!

Blocking until we get design review from @kra-mo

I'm not super sure about adding this much UI for this

Maybe the originally proposed dropdown would be a more simple solution, even though I acknowledge that it would give less control over fallbacks

@kra-mo kra-mo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd much more be in favor of having a more flexible solution to this, such as a table view, instead of adding a separate setting for every potential use-case. I'm not a fan of this approach.

@kra-mo

kra-mo commented Nov 16, 2026

Copy link
Copy Markdown
Member

I think the separate layouts in Mail would be a good reference point for that, also for example, the different layouts in Evolution:

image

@GVodyanov

Copy link
Copy Markdown
Contributor
📸 Screenshots — 93649b5

Settings dialog at desktop and mobile, contacts list before and after reordering, close-ups of the control while idle, saving and after keyboard reordering, and the error state

Captured: the new setting at desktop and mobile width (new component in the settings dialog); the contacts list with the default order and with Phone number moved first; close-ups of the default, saving and keyboard-reordered states (focus stays on the moved row); a failed save (toast shown, order reverted).
Not captured: other themes (only @nextcloud/vue components and CSS variables); German (the new strings aren't translated yet).

Assisted by ClaudeCode:claude-opus-5-5

@GVodyanov

Copy link
Copy Markdown
Contributor

I think the separate layouts in Mail would be a good reference point for that, also for example, the different layouts in Evolution:

@kra-mo I don't quite understand what you mean, so in the sidebar list we would add more than one piece of information about the contact?

@kra-mo

kra-mo commented Nov 17, 2026

Copy link
Copy Markdown
Member

I don't quite understand what you mean, so in the sidebar list we would add more than one piece of information about the contact?

@GVodyanov I mean, instead of changing the current view, we could introduce different layouts. The same way that Mail has Vertical/Horizontal/List, Contacts could have the current Vertical layout, and then also Cards or Table, which could show more information and have a horizontal split.

@djs42012

Copy link
Copy Markdown
Author

Thanks for the reviews. A smaller version is possible: a single "Show under each name" dropdown with Organization, Email and Phone number. The chosen field is shown first, and the other two keep today's order as fallbacks, so it is one control the size of "Sort contacts by". Alternative layouts such as a table sound useful, but they are beyond the scope of this pull request.

@kra-mo

kra-mo commented Nov 23, 2026

Copy link
Copy Markdown
Member

beyond the scope of this pull request

Yes, but I think they would also solve the problem that this pull request tries to, as well as others, I'm inclined to go ahead with something like that instead.

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@djs42012

Copy link
Copy Markdown
Author

I am bit confused. The goal was to be able to scroll through the contact list seeing just each contact's name and a preferred field underneath, as opposed to the pre-configured default field, which may not be equally useful to all users. I am not seeing how the table UI accomplishes this. The intention was to be able to quickly scroll preferred info at a glance. If the table solution is adding additional UI, it does not solve the problem this PR is trying to address.

@kra-mo

kra-mo commented Nov 23, 2026

Copy link
Copy Markdown
Member

I am bit confused. The goal was to be able to scroll through the contact list seeing just each contact's name and a preferred field underneath, as opposed to the pre-configured default field, which may not be equally useful to all users. I am not seeing how the table UI accomplishes this. The intention was to be able to quickly scroll preferred info at a glance. If the table solution is adding additional UI, it does not solve the problem this PR is trying to address.

This PR adds extra configuration to change how the default UI works, which addressed a very specific problem, and which would have to be configured potentially multiple times by the same user, depending on what they are interested in at a time. With a separate table view, we could keep the default view simple, since it already works for most people, who do not need to necessarily see details right away. But for those that do, they would be able to switch to a more "advanced" table view, which would allow them to see and compare all of this info at once, no matter which field they are currently interested in.

@djs42012

Copy link
Copy Markdown
Author

I think it is more fair to say users would "get to" configure the contact list depending on what they are interested in at the time. No one would "have to" configure anything under this proposal, unless the default view specifically does not work for them.

The PR also does not address a need to see "more" details, but rather a need to configure what is already available at a glance. I personally do not see why organization should be a preferred field forced upon the user from the default interface, which otherwise feels perfectly intuitive.

Just to be clear. My intended use case for this PR was to be able to scroll down my contact list and read off a phone number for a contact without having to break context by expanding a contact or changing views, which costs additional keyboard inputs/clicks.

@kra-mo

kra-mo commented Nov 24, 2026

Copy link
Copy Markdown
Member

Even if we were to go ahead with this, this UI is just way too much for such a niche feature. I'd rather introduce a simple view menu where users can choose what to show as a single preferred field. The existing sorting option from the app settings should also then be moved here:

Menu

When typing in the search bar, it should expand to make room and hide this button, the same way that Talk's or Files' does.

How does this sound?

@djs42012

Copy link
Copy Markdown
Author

Thanks for the mockup, it looks much cleaner. Happy to rework it that way.

One question. The preferred field is saved to the user's account. The sort order is saved per browser. Side by side in one menu, that would feel odd. Moving the sort order to the account too seems worth it. Fine to include that here?

@kra-mo

kra-mo commented Nov 24, 2026

Copy link
Copy Markdown
Member

Not sure, I'd look at how other apps handle similar preferences (such as Talk for sorting and grouping) and go with that approach for both.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to show the phone number as the line under each name in the contacts list

3 participants