Skip to content

feat: configure toast timeout - #62689

Open
kristian-zendato wants to merge 1 commit into
masterfrom
feat/toast-timeout-configuration
Open

feat: configure toast timeout#62689
kristian-zendato wants to merge 1 commit into
masterfrom
feat/toast-timeout-configuration

Conversation

@kristian-zendato

Copy link
Copy Markdown

Summary

Adds a personal theming setting to configure how long toast notifications remain visible.

  • Provides default, 15-second, 30-second, and never-dismiss options
  • Applies changes immediately and persists the preference
  • Validates allowed values server-side
  • Falls back safely to the default 7-second timeout

Checklist

AI (if applicable)

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

Signed-off-by: Kristian Zendato <kristian.zendato@nextcloud.com>
@kristian-zendato
kristian-zendato requested review from a team as code owners July 30, 2026 11:14
@kristian-zendato
kristian-zendato requested review from Altahrim, leftybournes, nfebe, skjnldsv and sorbaugh and removed request for a team July 30, 2026 11:14
$this->initialState->provideLazyInitialState('toastTimeout', function () {
if ($this->userSession->getUser()) {
$uid = $this->userSession->getUser()->getUID();
$value = $this->config->getUserValue($uid, Application::APP_ID, 'toast_timeout', '7000');

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.

please use IUserConfig in new code

return false;
});

$this->initialState->provideLazyInitialState('toastTimeout', function () {

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.

Suggested change
$this->initialState->provideLazyInitialState('toastTimeout', function () {
$this->initialState->provideLazyInitialState('toastTimeout', function (): int {

*
* @var string[]
*/
public const TOAST_TIMEOUT_VALUES = ['15000', '30000', '-1'];

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.

Suggested change
public const TOAST_TIMEOUT_VALUES = ['15000', '30000', '-1'];
public const array TOAST_TIMEOUT_VALUES = ['15000', '30000', '-1'];

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.

[core] provide accessibility user setting to configure toast timeout

2 participants