-
Notifications
You must be signed in to change notification settings - Fork 3
Add option to control line spacing in STET output doc #355
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
base: doc-dev.walink.org
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| <script lang="ts"> | ||
| import { settingsUpdatedStore } from '$lib/stet/stores/SettingsStore' | ||
| import { errorStore } from '$lib/stet/stores/NotificationStore' | ||
| export let id = '' | ||
| export let checked = false | ||
| export let disabled = false | ||
| </script> | ||
|
|
||
| <label for={id}> | ||
| <div class="switch"> | ||
| <input | ||
| {id} | ||
| name={id} | ||
| type="checkbox" | ||
| class="sr-only" | ||
| {disabled} | ||
| bind:checked | ||
| on:change={() => { | ||
| $settingsUpdatedStore = true | ||
| $errorStore = '' | ||
| }} | ||
| /> | ||
| <div class="track" /> | ||
| <div class="thumb" /> | ||
| </div> | ||
| </label> | ||
|
|
||
| <style global lang="postcss"> | ||
| .switch { | ||
| @apply relative inline-block align-middle cursor-pointer select-none bg-transparent; | ||
| } | ||
| .track { | ||
| @apply w-11 h-7 bg-white border border-[#343434] rounded-full shadow-inner; | ||
| } | ||
| .thumb { | ||
| @apply transition-all duration-300 ease-in-out absolute top-1 left-1 w-5 h-5 bg-[#343434] rounded-full; | ||
| } | ||
| input[type='checkbox']:checked ~ .thumb { | ||
| @apply transform translate-x-4; | ||
| } | ||
| input[type='checkbox']:checked ~ .track { | ||
| @apply transform transition-colors; | ||
| background: | ||
| linear-gradient(180deg, #1876fd 0%, #015ad9 100%), linear-gradient(0deg, #343434, #343434); | ||
| } | ||
| input[type='checkbox']:disabled ~ .track { | ||
| @apply bg-gray-500; | ||
| } | ||
| input[type='checkbox']:disabled ~ .thumb { | ||
| @apply bg-gray-100 border-gray-500; | ||
| } | ||
| input[type='checkbox']:focus + .track, | ||
| input[type='checkbox']:active + .track { | ||
| @apply outline outline-2; | ||
| } | ||
| </style> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,3 +123,20 @@ test.describe('Desktop Tests', () => { | |
| await expect(page.getByText('Tok Pisin')).not.toBeVisible({ timeout: 64_000 }) | ||
| }) | ||
| }) | ||
|
|
||
| test('test line spacing option', async ({ page }) => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test appears to be outside the "Desktop Tests" block -- is that intentional? |
||
| await page.goto('http://localhost:8001/stet') | ||
| await page.getByLabel('Tiếng Việt (Vietnamese) vi').check() | ||
| await page.getByRole('button', { name: 'Next' }).click() | ||
| await page.getByText('Cebuano').click() | ||
| await page.getByRole('button', { name: 'Next' }).click() | ||
| await page.getByRole('button', { name: 'Generate File' }).click() | ||
| await page.getByRole('link', { name: 'Target Language' }).click() | ||
| await page.getByRole('button', { name: 'Next' }).click() | ||
| await expect(page.getByRole('main')).toContainText('Increase line spacing to') | ||
| await expect(page.getByRole('main')).toContainText('Generate File') | ||
| await page.getByRole('button', { name: 'Generate File' }).click() | ||
| await expect(page.getByRole('main')).toContainText('Download') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this generation could take a while; I recommend you add the |
||
| await page.locator('.thumb').click() | ||
| await page.getByRole('button', { name: 'Generate File' }).click() | ||
| }) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logging call now has a fourth parameter, but only three arguments to the logging string. Recommend you add:
use_increased_line_spacing: %s