Closed elycheea closed 1 month ago
@amal-k-joy
<div>
element with "treegrid" role has keyboard accessDelete Condition
buttonhttps://github.com/user-attachments/assets/2eafdc04-0ea9-4414-930c-25a1e5252424
Esc
to close the Date Picker, it toggles the fullscreen. (preventDefault
)https://github.com/user-attachments/assets/aa76f403-10df-40df-84a9-d10f2627dfcc
console
from stories and tests filesup
and down
arrows in the Price fieldhttps://github.com/user-attachments/assets/10f13524-9d4c-416a-937b-cb2dbca60517
there's a lot to go through here, so i'm going to take my time, but i'd like to point out one issue now that's very glaring to me. in light of our recent discussions to give the user more control i think one of the best places to start is here with ConditionBuilder
.
in ConditionBuilderContent.tsx
we have this effect running to declare the builder is active
useEffect(() => {
if (rootState?.groups?.length) {
setIsConditionBuilderActive(true);
} else {
setIsConditionBuilderActive(false);
}
if (getConditionState) {
getConditionState(rootState ?? {});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [rootState]);
this is a good example of internal state we should avoid and let the user handle. i would simply remove this code and add a prop for the user to control the open
or active
state of the component.
the more effects we can remove the more unintentional side effects we can mitigate.
posting this comment from Linda for documentation purposes while we are going through the release review process as of 9/19/24
Recap on Condition Builder from today’s standup: Okay to merge PR for the usage docs to go live on new website Hold on bringing to stable Document only any a11y issues from either AvT or screenreader/voiceover. Issues created for bugs should be documented but don’t have to pick up work on those bugs.
the other major thing that i wanted to point out is that the translations need to be handled at the prop level and not be imported directly from the component folder import { useTranslations } from '../utils/useTranslations';
if we want to expose some kind of hook at the consumer level that's fine, but honestly it's probably just easier to provide the json structure in the docs and let the user pass the data structure directly. translations={clientTranslationObj}
there's a lot to go through here, so i'm going to take my time, but i'd like to point out one issue now that's very glaring to me. in light of our recent discussions to give the user more control i think one of the best places to start is here with
ConditionBuilder
.in
ConditionBuilderContent.tsx
we have this effect running to declare the builder is activeuseEffect(() => { if (rootState?.groups?.length) { setIsConditionBuilderActive(true); } else { setIsConditionBuilderActive(false); } if (getConditionState) { getConditionState(rootState ?? {}); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [rootState]);
this is a good example of internal state we should avoid and let the user handle. i would simply remove this code and add a prop for the user to control the
open
oractive
state of the component.the more effects we can remove the more unintentional side effects we can mitigate.
Hey @davidmenendez ,
Thanks for looking into this. This useEffect
is required when the user deletes all the conditions , then we need to show back the Add condition
button. So we need to listen to the root state for this. Also we have kept the Add condition
button as part our component.
Closing initial review, we'll open follow up issues for items discussed here.
the other major thing that i wanted to point out is that the translations need to be handled at the prop level and not be imported directly from the component folder
import { useTranslations } from '../utils/useTranslations';
if we want to expose some kind of hook at the consumer level that's fine, but honestly it's probably just easier to provide the json structure in the docs and let the user pass the data structure directly.
translations={clientTranslationObj}
Hey,
Based on our earlier discussion on the implementation of translation, we had decided to implement by exposing a prop translateWithId
, which is a callback to the user that will return the translated text. This approach aligns with core carbon as well.
Here useTranslations
is just a local hook that will grab the required text to our components either from users callback or from default translation object.
May be we can mention the expected translations keys in the story book docs
Review for release
Readiness
main
.Engineering review
className
.React.forwardRef
).title
,aria-*
, etc) are passed through to an appropriate DOM node of the component as HTML attributes./src/components/index.js
, each public component SCSS is included in/src/components/_index.scss
, and each public component has a flag inpackage-settings.js
.Standards
//prettier-ignore
).Testing
istanbul ignore
is appropriate and not extensive.Documentation
[^1]: Any labels, text, or other strings within a component should use a prop. [^2]: See Carbon’s Developer Handbook for guidance on class names.