Page MenuHomePhabricator

[WtC-M3] [QB] Port DateInput to Query Builder
Open, Needs TriagePublic

Description

Problem

The DateInput component was implemented in WiKit to fulfill the Query builder use case. This input type is quite specific to Wikibase, so Codex won't include it as a core element available for all projects.

Solution

In order to unblock the migration to Codex and the deprecation of WiKit, we'll port the WiKit DataInput component to the Query Builder repository. We'll apply all necessary changes to make the element compatible with the new version of the tool.

Considerations
  • DateInput is dependent on the porting of: Icon, InputWithExtender and BouncingDots
  • Styles: In order to unblock WiKit's deprecation, we should also replace all WiKit tokens used currently to style the QuantityInput by Codex's tokens. Find the replaced styles and discrete values below:

image.png (2×2 px, 270 KB)

<style lang="scss">
.wikit-DateInput {
	&__IntroText {
		padding-block-end: $spacing-25;
		font-family: $font-family-system-sans;
		font-weight: $font-weight-normal;
		font-size: $font-size-medium;
		line-height: $line-height-xx-small;
		color: $color-base;
	}

	&__ParsedValue {
		padding-block: $spacing-25;
		font-family: $font-family-system-sans;
		font-weight: $font-weight-semi-bold;
		font-size: $font-size-medium;
		line-height: $line-height-xx-small;
		color: $color-base;
	}

	&__CalendarNotice {
		padding-block-start: $spacing-25;
		font-family: $font-family-system-sans;
		font-weight: $font-weight-normal;
		font-size: $font-size-small;
		line-height: $line-height-small;
		color: $color-subtle;
	}

	&__Prompt {
		font-family: $font-family-system-sans;
		font-weight: $font-weight-normal;
		font-size: $font-size-medium;
		line-height: $line-height-xx-small;
		color: $color-placeholder;
	}
}
</style>

Please note that the Calendar Notice includes an icon size small (which translates to 1em/16px in Codex). The color of the icon should be $color-subtle, like its surrounding text.

Acceptance criteria
  • The WiKit DateInput is ported to Query builder and made compatible with the migrated version of the tool
  • We apply the necessary visual adjustments to make the component consistent with Codex input fields
  • Any WiKit building blocks, dependencies or styles are replaced or ported too

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Fix WikitDateInput componentrepos/wmde/wikidata-query-builder!3haakT367898-fixmaster
Customize query in GitLab

Related Objects

Event Timeline

This task will require design validation. As indicated in the description, some visual changes were applied to the DateInput. We'll need to make sure that the ported component reflects the changes applied to itself and InputWithExtender (T367902).

DateInput also contains Icon (T369841) and BouncingDots (T370141). No visual adjustments were directly applied to either of these elements, so they can be validated directly as part of the DateInput verification: In the case of Icon, we just need to make sure that it's rendered as specified in this task. In the case of BouncingDots, we need to verify that its appearance and behavior are aligned with the WiKit original.

Change #1100073 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Port Wikit Date Input to QB

https://gerrit.wikimedia.org/r/1100073

Change #1100073 merged by jenkins-bot:

[wikidata/query-builder@master] Port Wikit Date Input to QB

https://gerrit.wikimedia.org/r/1100073

Could you please provide me with a netlify link so that i can review the changes?

  1. There are no bouncing dots as addressed in T370141
  2. Line height for prompt and intro text seems to be 1.6 instead of 1.375em
  3. Parsed value's line height should also be 1.375 but is 1.6em
  4. Parsed value's weight should be semi-bold (600 in codex) but my dev-tools tell me it's 400

hm, i'm starting to realise, no matter which element I select with the dev tools in the extender, it gives me the same values which makes me believe that I don't know how to inspect the extender with the dev tools. Would someone be able to show me how to do that or could do it with me in a call? Until then I'm not sure how to verify the extender unfortunately.
@HasanAkgun_WMDE @ItamarWMDE

Change #1118516 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Fix WikitDateInput component

https://gerrit.wikimedia.org/r/1118516

Had a look together with @HasanAkgun_WMDE and everything looks good now 🎉