Telefonica / webview-bridge

Novum JavaScript Bridge
MIT License
27 stars 7 forks source link

Evolution of "MESSAGE" event (Snackbar) #132

Closed jeslat closed 3 months ago

jeslat commented 4 months ago

We need to be able to customize the button content description (text that is talked by the device when the accessibility is enabled). We should add a new optional parameter to the method to set the button content description.

This requirement comes from Vivo https://www.figma.com/design/fjGgzSH1zdCTxAxMfOEUma/Menu-Mais?node-id=1197-324696&t=o0PMTgO238G06o57-0

drawing

Current status

nativeMessage: ({
        message: string;
        duration?: 'PERSISTENT';
        buttonText?: string;
        type?: 'INFORMATIVE' | 'CRITICAL' | 'SUCCESS';
        withDismiss?: boolean;
}) => Promise<{
    action: 'DISMISS' | 'BUTTON' | 'TIMEOUT' | 'CONSECUTIVE';
}>;

Proposed solution

Add a new optional field buttonAccessibilityLabel:

nativeMessage: ({
        message: string;
        duration?: 'PERSISTENT';
        buttonText?: string;
        buttonAccessibilityLabel?: string;
        type?: 'INFORMATIVE' | 'CRITICAL' | 'SUCCESS';
        withDismiss?: boolean;
}) => Promise<{
    action: 'DISMISS' | 'BUTTON' | 'TIMEOUT' | 'CONSECUTIVE';
}>;
amegias commented 4 months ago

Does buttonContentDescription mean the button's accessibility?

dhidalgofadrique commented 4 months ago

Does buttonContentDescription mean the button's accessibility?

If so maybe a name mentioning "accessibility" would be more appropiate (like buttonAccessibilityLabel or something similar). WDYT?

jeslat commented 4 months ago

Does buttonContentDescription mean the button's accessibility?

Yes, it means the text that will be spoken by the device when the accessibility is enabled. In Android, "content description" is the name used for this information. If iOS is different, I'm ok with buttonAccessibilityLabel

dhidalgofadrique commented 4 months ago

Does buttonContentDescription mean the button's accessibility?

Yes, it means the text that will be spoken by the device when the accessibility is enabled. In Android, "content description" is the name used for this information. If iOS is different, I'm ok with buttonAccessibilityLabel

Oh, I thought Android naming included accessibility word. If so, no problem about using buttonContentDescription 😉

jeslat commented 4 months ago

No, if "content description" doesn't mean anything in iOS, I prefer to put buttonAccessibilityLabel that is clearer.

amegias commented 4 months ago

No, if "content description" doesn't mean anything in iOS, I prefer to put buttonAccessibilityLabel that is clearer.

Yes please 😍 buttonAccessibilityLabel

jeslat commented 4 months ago

Description updated with buttonAccessibilityLabel

atabel commented 4 months ago

lgtm

atabel commented 3 months ago

https://jira.tid.es/browse/WEB-1906

atabel commented 3 months ago

@jeslat, @amegias, @dhidalgofadrique. Do you know the first app version supporting this? we need that to include in the docs