Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL support for user content in the app #4970

Merged
merged 13 commits into from
Jul 31, 2024
Merged

Conversation

magicznyleszek
Copy link
Member

@magicznyleszek magicznyleszek commented Jun 5, 2024

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

Almost all the places that display user-generated content will now correctly display RTL text (regardless of the app language selected in settings, i.e. Arabic text in English UI will be displayed as RTL).

Notes

Good reading on styling RTL: https://rtlstyling.com/

Things changed:

  • Basically every place in UI that displays asset name or description, or question name
  • Added dir="auto" to a lot of places - it makes the browser built-in functionality decide how to render the contents of given HTML node. Some notable components (that will handle RTL out of the box now):
  • Migrated few margin-* to margin-inline-*, as the first doesn't changed when RTL direction kicks in, and the latter does it awesomely (Note: we should most probably migrate much more margins in future)
  • Migrated few text-align: left to text-align: initial, as only the latter supports RTL
  • KoboSelect component now supports placement (the more generic KoboDropdown already supports placement, so we only had to pass it on)
  • Fixed few UI issues in the Project → Form → Manage Translations modal
    • Add language form button was misaligned
    • Pending status of button was behaving weirdly and inconsistently
  • CopyTeamPermissions component (from project sharing modal) now uses our KoboSelect component
  • Removed accidently duplicated code in jsapp/scss/libs/react-tagsinput.scss

Testing tips:

  • Create some content using arabic text. I've used https://www.branah.com/arabic to write some random text (note that the tool hijacks the cmd+c shortcut so best to use rightclick→copy). At least have:
    • A project with submissions
    • A collection with something inside
    • Some library items
  • It would be hard to list all the places touched by this issue, best way for testing would be finding in the UI all the dir="auto" changes. But for sure these places are improved:
    • Public Collections/My Library/Single collection tables
    • Projects table
    • Project Data tabs (all of them, except Map)
    • Account → Usage → Per Project
    • Form Builder
    • Header project title editor
    • Project → Form → Manage Translations

Related issues

Related to #4904

@magicznyleszek magicznyleszek marked this pull request as ready for review June 6, 2024 07:58
# Conflicts:
#	jsapp/js/account/usage/usageProjectBreakdown.tsx
#	jsapp/js/components/common/modal.scss
#	jsapp/js/components/library/assetContentSummary.tsx
#	jsapp/js/components/modalForms/languageForm.es6
#	jsapp/js/components/modalForms/translationSettings.es6
#	jsapp/js/components/submissions/columnsHideForm.tsx
#	jsapp/js/components/submissions/tableColumnSortDropdown.es6
#	jsapp/scss/libs/react-tagsinput.scss
@RuthShryock RuthShryock self-requested a review July 25, 2024 19:06
@RuthShryock RuthShryock self-assigned this Jul 25, 2024
# Conflicts:
#	jsapp/js/components/common/modal.scss
#	jsapp/js/components/reports/reportTable.component.tsx
#	jsapp/js/components/submissions/submissionDataTable.scss
#	jsapp/scss/components/_kobo.bem.ui.scss
Copy link
Member

@RuthShryock RuthShryock left a comment

Choose a reason for hiding this comment

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

Looks good! Just two comments :)

jsapp/js/components/formSummary.scss Show resolved Hide resolved
@magicznyleszek magicznyleszek merged commit 109a8b0 into beta Jul 31, 2024
1 of 4 checks passed
@magicznyleszek magicznyleszek deleted the rtl-support-in-whole-app branch July 31, 2024 10:26
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.

2 participants