Repository navigation
Fix Account scrolling and add logo-hover generation history #132
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
95aad93
fix: reveal history from logo and restore account scrolling
sgardoll 6fd0a74
fix: retain history drawer on logo reentry
sgardoll bd9b0b2
fix: preserve logo home navigation alongside history hover
sgardoll 6771653
fix: close history drawer when selecting Home
sgardoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
| import { applyDefaultRoutes, ENDPOINTS } from './fixtures/apiFixtures.js'; | ||
| test.use({hasTouch:true}); | ||
| for (const width of [360,1440]) test(`history drawer and account scrolling ${width}`,async({page})=>{ | ||
| await page.setViewportSize({width,height:700}); | ||
| await page.addInitScript(()=>{localStorage.setItem('hasSeenWalkthrough','true');localStorage.setItem('ccc_auth_session',JSON.stringify({email:'test@example.com',sessionToken:'synthetic'}));}); | ||
| await applyDefaultRoutes(page,{[ENDPOINTS.authRefreshSession]:{status:200,contentType:'application/json',body:JSON.stringify({email:'test@example.com',sessionToken:'synthetic'})}}); | ||
| await page.route('**/service/generation-history',r=>r.fulfill({json:{items:[{id:'saved-one',status:'success'}],nextCursor:null}})); | ||
| await page.goto('/#account');await expect(page.locator('#topbar-avatar')).toContainText('T'); | ||
| const account=page.locator('#account-view'); | ||
| await expect(account).toHaveCSS('overflow-y','auto'); | ||
| await account.evaluate(el=>{el.scrollTop=el.scrollHeight;}); | ||
| expect(await account.evaluate(el=>el.scrollTop)).toBeGreaterThan(0); | ||
| await expect(page.locator('#history-drawer')).toBeHidden(); | ||
| const logo=page.locator('.topbar .brand'); | ||
| if(width===1440) await logo.hover();else await logo.tap(); | ||
| await expect(page.locator('#history-drawer')).toBeVisible(); | ||
| await expect(page.locator('#history-drawer')).toContainText('saved-one'); | ||
| if(width===1440){await logo.dispatchEvent('pointerleave',{pointerType:'mouse'});await logo.dispatchEvent('pointerenter',{pointerType:'mouse'});await page.waitForTimeout(250);await expect(page.locator('#history-drawer')).toBeVisible();await page.mouse.move(1000,500);await expect(page.locator('#history-drawer')).toBeHidden();await logo.hover();await expect(page.locator('#history-drawer')).toBeVisible();} | ||
| await page.keyboard.press('Escape');await expect(page.locator('#history-drawer')).toBeHidden(); | ||
| await expect(logo).toBeFocused(); | ||
| await page.keyboard.press('ArrowDown');await expect(page.locator('#history-drawer')).toBeVisible(); | ||
| await page.locator('#history-drawer .history-drawer-actions a').click(); | ||
| await expect(page.locator('#history-drawer')).toBeHidden(); | ||
| await expect(page.locator('#home-view')).toBeVisible(); | ||
| await logo.focus();await page.keyboard.press('ArrowDown'); | ||
| await expect(page.locator('#history-drawer')).toBeVisible(); | ||
| await page.evaluate(()=>window.__CCC_HISTORY_TEST__.session('other@example.com','other-token')); | ||
| await expect(page.locator('#history-drawer')).toBeHidden(); | ||
| await expect(page.locator('#history-list')).toBeEmpty(); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /* Account scroll stays inside the fixed authored stage. */ | ||
| body[data-shell-view="account"] #account-view { position:absolute; inset:88px 0 0; min-height:0; height:auto; overflow-y:auto; overscroll-behavior:contain; display:block; } | ||
| @media(max-width:920px) { body[data-shell-view="account"] #account-view { top:64px; } } | ||
| #history-drawer { position:fixed; inset:0 auto 0 0; width:min(380px,100vw); z-index:150; background:var(--surface); border-right:1px solid var(--border); box-shadow:var(--shadow-md); padding:20px; overflow-y:auto; overscroll-behavior:contain; } | ||
| #history-drawer[hidden] { display:none; } | ||
| .history-drawer-actions { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; } | ||
| .history-drawer-actions button { padding:8px 12px; color:var(--fg); background:var(--surface); border:1px solid var(--border); border-radius:8px; cursor:pointer; } | ||
| #history-drawer .acct-history { padding:0; border:0; box-shadow:none; } | ||
| #history-drawer #history-list { padding-left:20px; } | ||
| #history-drawer #history-list li { margin:12px 0; overflow-wrap:anywhere; } | ||
| #history-drawer pre { white-space:pre-wrap; overflow-wrap:anywhere; } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.