Skip to content

Commit

Permalink
Dynamic title for expander/collapser button (jupyterlab#15826)
Browse files Browse the repository at this point in the history
* Dynamic title for expander/collapser button

* Lint fixes
  • Loading branch information
JasonWeill authored Feb 22, 2024
1 parent 15875f4 commit 2d68127
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions galata/test/jupyterlab/notebook-replace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test.describe('Notebook Search and Replace', () => {

await page.waitForSelector('text=1/21');

await page.click('button[title="Toggle Replace"]');
await page.click('button[title="Show Replace"]');

await page.fill('[placeholder="Replace"]', 'egg');

Expand All @@ -50,7 +50,7 @@ test.describe('Notebook Search and Replace', () => {
await page.fill('[placeholder="Find"]', 'text/(\\w+)');
await page.waitForSelector('text=1/3');

await page.click('button[title="Toggle Replace"]');
await page.click('button[title="Show Replace"]');
await page.fill('[placeholder="Replace"]', 'script/$1');
const cell = await page.notebook.getCell(2);
await expect(page.locator('body')).not.toContainText('script/plain');
Expand All @@ -75,7 +75,7 @@ test.describe('Notebook Search and Replace', () => {
clickCount: 4
});

await page.click('button[title="Toggle Replace"]');
await page.click('button[title="Show Replace"]');

await page.fill('[placeholder="Replace"]', 'egg');

Expand All @@ -98,7 +98,7 @@ test.describe('Notebook Search and Replace', () => {

await page.waitForSelector('text=1/21');

await page.click('button[title="Toggle Replace"]');
await page.click('button[title="Show Replace"]');

await page.fill('[placeholder="Replace"]', 'egg');

Expand All @@ -120,7 +120,7 @@ test.describe('Notebook Search and Replace', () => {
await page.keyboard.press('Control+f');
await page.fill('[placeholder="Find"]', 'test');

await page.click('button[title="Toggle Replace"]');
await page.click('button[title="Show Replace"]');
await page.fill('[placeholder="Replace"]', 'egg');

// TODO: Next Match press count should be one less
Expand Down
2 changes: 1 addition & 1 deletion galata/test/jupyterlab/notebook-search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test.describe('Notebook Search', () => {
await page.waitForSelector('text=1/1');

// Show replace buttons to check for visual regressions
await page.click('button[title="Toggle Replace"]');
await page.click('button[title="Show Replace"]');
await page.fill('[placeholder="Replace"]', 'line1\nline2');

const overlay = page.locator('.jp-DocumentSearch-overlay');
Expand Down
6 changes: 5 additions & 1 deletion packages/documentsearch/src/searchview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,11 @@ class SearchOverlay extends React.Component<ISearchOverlayProps> {
className={TOGGLE_WRAPPER}
onClick={() => this._onReplaceToggled()}
tabIndex={0}
title={trans.__('Toggle Replace')}
title={
showReplace
? trans.__('Hide Replace')
: trans.__('Show Replace')
}
>
<icon.react
className={`${REPLACE_TOGGLE_CLASS} ${BUTTON_CONTENT_CLASS}`}
Expand Down

0 comments on commit 2d68127

Please sign in to comment.