Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0a7ae1e
feat: add interlinearizer.continuousScroll project setting with toggl…
imnasnainaec May 1, 2026
018fe12
feat: extract SegmentView component with token-chip and baseline-text…
imnasnainaec May 1, 2026
6b90d0c
Add ContinuousView core (continuous token strip, smooth incremental a…
imnasnainaec May 4, 2026
2509234
Compose ContinuousView above chapter rows and finalize conditional di…
imnasnainaec May 4, 2026
efdd310
Propagate verse change from ContinuousView arrow navigation to scroll…
imnasnainaec May 4, 2026
635bf68
Add PhraseBox-based phrase navigation and clickable focus behavior
imnasnainaec May 4, 2026
ac7813b
Use optimistic continuous-scroll state across webview
imnasnainaec May 4, 2026
2258983
Fix bugs
imnasnainaec May 4, 2026
fbe9fb6
Refine continuous view behavior and stabilize web-view tests
imnasnainaec May 5, 2026
04e852b
Extract book data into hook and restructure sticky layout
imnasnainaec May 5, 2026
4fcdb78
Add comprehensive web view, hook, and component tests
imnasnainaec May 5, 2026
189af0a
Add border below ContinuousView
imnasnainaec May 7, 2026
d3570b5
Memoize segment onClick
imnasnainaec May 7, 2026
ff9e202
Memoize PhraseBox, SegmentView, TokenChip
imnasnainaec May 7, 2026
680e8fd
Avoid first-load extra fire; Tidy code
imnasnainaec May 7, 2026
4a024ee
Add timeout if setting-save fails
imnasnainaec May 7, 2026
0b6ac12
Extract settings hook and add testing
imnasnainaec May 7, 2026
ce23c1d
Complete Web View coverage
imnasnainaec May 7, 2026
f6b7002
Complete ContinuousView test coverage
imnasnainaec May 7, 2026
4afb14a
Replace left/right with prev/next for RTL support
imnasnainaec May 7, 2026
8d43ce3
Fix arrows and RTL support
imnasnainaec May 7, 2026
3f387b5
Show loading while waiting for setting
imnasnainaec May 7, 2026
4fd183a
Use existing type
imnasnainaec May 7, 2026
6101294
Split up main Web View into pieces
imnasnainaec May 7, 2026
e119d68
Complete ContinuousView coverage
imnasnainaec May 7, 2026
6fc0c7f
Add setting type
imnasnainaec May 7, 2026
1af220e
Smooth-scroll for internal clicks
imnasnainaec May 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions __mocks__/platform-bible-react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,41 @@ export function BookChapterControl({
</div>
);
}

export function Switch({
checked,
disabled,
id,
onCheckedChange,
}: Readonly<{
checked?: boolean;
disabled?: boolean;
id?: string;
onCheckedChange?: (checked: boolean) => void;
}>): ReactElement {
return (
<input
checked={checked ?? false}
disabled={disabled}
id={id}
onChange={(e) => onCheckedChange?.(e.target.checked)}
type="checkbox"
/>
);
}

export function Label({
children,
className,
htmlFor,
}: Readonly<{
children?: ReactNode;
className?: string;
htmlFor?: string;
}>): ReactElement {
return (
<label className={className} htmlFor={htmlFor}>
{children}
</label>
);
}
6 changes: 5 additions & 1 deletion contributions/localizedStrings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"en": {
"%interlinearizer_dialog_open_title%": "Open Interlinearizer",
"%interlinearizer_dialog_open_prompt%": "Choose a project to open in the Interlinearizer:",
"%interlinearizer_openForProject%": "Open Interlinearizer for this Project"
"%interlinearizer_openForProject%": "Open Interlinearizer for this Project",
"%interlinearizer_projectSettings_title%": "Interlinearizer",
"%interlinearizer_projectSettings_continuousScroll%": "Continuous Scroll",
"%interlinearizer_projectSettings_continuousScrollDescription%": "Display tokens in a continuous horizontal scroll strip instead of chapter-segmented rows",
"%interlinearizer_continuousScrollToggle%": "Continuous Scroll"
}
}
}
14 changes: 13 additions & 1 deletion contributions/projectSettings.json
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
[]
[
{
"label": "%interlinearizer_projectSettings_title%",
"properties": {
"interlinearizer.continuousScroll": {
"label": "%interlinearizer_projectSettings_continuousScroll%",
"description": "%interlinearizer_projectSettings_continuousScrollDescription%",
"default": true,
"type": "boolean"
}
}
}
]
30 changes: 30 additions & 0 deletions src/__tests__/components/ContinuousScrollToggle.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/** @file Unit tests for components/ContinuousScrollToggle.tsx. */
/// <reference types="jest" />
/// <reference types="@testing-library/jest-dom" />

import { useLocalizedStrings } from '@papi/frontend/react';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import ContinuousScrollToggle from '../../components/ContinuousScrollToggle';

describe('ContinuousScrollToggle', () => {
beforeEach(() => {
jest
.mocked(useLocalizedStrings)
.mockReturnValue([
{ '%interlinearizer_continuousScrollToggle%': 'Continuous Scroll' },
false,
]);
});

it('calls onCheckedChange when toggled', async () => {
const onCheckedChange = jest.fn();
render(<ContinuousScrollToggle checked onCheckedChange={onCheckedChange} />);
const checkbox = screen.getByRole('checkbox');

expect(checkbox).toBeChecked();
await userEvent.click(checkbox);

expect(onCheckedChange).toHaveBeenCalledWith(false);
});
});
Loading
Loading