-
Notifications
You must be signed in to change notification settings - Fork 835
feat: log viewer, downloads, settings and document viewer as separate windows on a shared native shell #3444
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
41 commits
Select commit
Hold shift + click to select a range
b008ae2
feat(log-viewer): sidebar filters, native window chrome, paginated list
rodrigok d763d7e
feat(log-viewer): distribution timeline with drag range selection
rodrigok 6b10fbd
feat(log-viewer): inset log card, live transparency, restore on launch
rodrigok 9a03c72
feat(downloads): move downloads into its own window on shared chrome
rodrigok d5ea630
feat(downloads): grey document icon for file types
rodrigok 1ac6b86
feat(settings): settings in its own window, with remembered positions
rodrigok 34670d9
feat(windows): in-app title bar on Windows, and room for the theme op…
rodrigok 48e34a8
feat(settings): fold About into settings, and one spacing rhythm
rodrigok 31f3412
Merge branch 'master' into feat/log-viewer-revamp
rodrigok cfecaa9
fix(test): drive the clock in the downloads indicator seen test
rodrigok aaf4664
feat(document-viewer): open PDFs and markdown in their own window
rodrigok 37ef21a
feat(document-viewer): download the file, and read markdown as source
rodrigok 072093c
Merge branch 'master' into feat/log-viewer-revamp
rodrigok d21e53e
refactor(chrome): one title bar height across every window
rodrigok a76cf62
Merge branch 'master' into feat/log-viewer-revamp
rodrigok c21695a
fix(chrome): stop the filter checkbox toggling twice
rodrigok 02f8175
feat(chrome): let a filter be cleared completely
rodrigok 0f84aa1
fix(windows): stop secondary windows opening full screen
rodrigok 4f0c568
feat(downloads): show the same download row in the top bar panel
rodrigok c9e6710
fix(test): keep the downloads panel size test inside Jest's timeout
rodrigok 09fa0a3
fix: address review findings on the secondary windows
rodrigok 25ed2aa
fix(windows): restore minimized secondary windows on reopen
jeanfbrito 1d174eb
fix(document-viewer): surface save errors and stop dropping opens
jeanfbrito 25778d7
fix(chrome): keep out-of-universe values visible when facets narrow
jeanfbrito 69da9ca
fix(settings): settle update checks properly and keep search ephemeral
jeanfbrito ac2cb22
fix(app): never drop the last persisted state write
jeanfbrito 42082c8
fix(log-viewer): surface load failures and save feedback
jeanfbrito a50aae3
fix(log-viewer): give the timeline real slider keyboard semantics
jeanfbrito 9113ef3
fix(chrome): tokenize secondary-window card shadow and radius
jeanfbrito 7a0d4c0
fix(settings): give sidebar tabs real keyboard and selected weight
jeanfbrito 9a012ed
fix(chrome): tokenize hover fills and announce copy and save
jeanfbrito 83fdc45
fix(log-viewer): use system tokens and distinguish display toggles
jeanfbrito 1103968
fix(windows): confirm destructive clears and tokenize progress
jeanfbrito 983ed6b
fix(app): persist immediately when the throttle interval elapses
jeanfbrito 520fe19
fix(document-viewer): surface rejected save invocations
jeanfbrito 3821eac
fix(log-viewer): drop stale loads and hide logs on error
jeanfbrito 7703f26
fix(chrome): share section labels and Cmd+F search focus
jeanfbrito 6842803
fix(chrome): drop extra icon colors and literal list chrome
jeanfbrito 66c9314
fix(ui): close leftover CodeRabbit polish notes
jeanfbrito 43d46cd
fix(downloads): use font-info for the row progress fill
jeanfbrito 4666c44
fix(settings): answer the secondary-window IPC invoke in window specs
jeanfbrito 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
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,122 @@ | ||
| import type { PersistableValues } from '../PersistableValues'; | ||
| import type * as PersistenceModule from './persistence'; | ||
|
|
||
| const mockSet = jest.fn(); | ||
|
|
||
| jest.mock('electron', () => ({ | ||
| app: { | ||
| getVersion: jest.fn().mockReturnValue('1.0.0'), | ||
| }, | ||
| })); | ||
|
|
||
| jest.mock('electron-store', () => { | ||
| return jest.fn().mockImplementation(() => ({ | ||
| store: {}, | ||
| set: mockSet, | ||
| get: jest.fn(), | ||
| })); | ||
| }); | ||
|
|
||
| const value = (n: number): PersistableValues => | ||
| ({ marker: n }) as unknown as PersistableValues; | ||
|
|
||
| describe('persistValues throttling', () => { | ||
| let persistValues: typeof PersistenceModule.persistValues; | ||
| let flushPersistedValues: typeof PersistenceModule.flushPersistedValues; | ||
|
|
||
| beforeEach(() => { | ||
| jest.useFakeTimers(); | ||
| jest.setSystemTime(0); | ||
| mockSet.mockClear(); | ||
| jest.resetModules(); | ||
| // eslint-disable-next-line @typescript-eslint/no-var-requires | ||
| const persistence: typeof PersistenceModule = require('./persistence'); | ||
| persistValues = persistence.persistValues; | ||
| flushPersistedValues = persistence.flushPersistedValues; | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| flushPersistedValues(); | ||
| jest.useRealTimers(); | ||
| }); | ||
|
|
||
| it('writes immediately when outside the throttle window', () => { | ||
| jest.advanceTimersByTime(2000); | ||
| persistValues(value(1)); | ||
|
|
||
| expect(mockSet).toHaveBeenCalledTimes(1); | ||
| expect(mockSet).toHaveBeenCalledWith(value(1)); | ||
| }); | ||
|
|
||
| it('writes immediately when the throttle interval has elapsed exactly', () => { | ||
| jest.advanceTimersByTime(2000); | ||
| persistValues(value(1)); | ||
| mockSet.mockClear(); | ||
|
|
||
| jest.advanceTimersByTime(1000); | ||
| persistValues(value(2)); | ||
|
|
||
| expect(mockSet).toHaveBeenCalledTimes(1); | ||
| expect(mockSet).toHaveBeenCalledWith(value(2)); | ||
| }); | ||
|
|
||
| it('coalesces rapid successive calls and persists only the final values after the trailing interval', () => { | ||
| jest.advanceTimersByTime(2000); | ||
| persistValues(value(1)); | ||
| mockSet.mockClear(); | ||
|
|
||
| jest.advanceTimersByTime(100); | ||
| persistValues(value(2)); | ||
| jest.advanceTimersByTime(200); | ||
| persistValues(value(3)); | ||
| jest.advanceTimersByTime(200); | ||
| persistValues(value(4)); | ||
|
|
||
| expect(mockSet).not.toHaveBeenCalled(); | ||
|
|
||
| jest.advanceTimersByTime(500); | ||
|
|
||
| expect(mockSet).toHaveBeenCalledTimes(1); | ||
| expect(mockSet).toHaveBeenCalledWith(value(4)); | ||
| }); | ||
|
|
||
| it('does not drop the final write when it lands inside the throttle window', () => { | ||
| jest.advanceTimersByTime(2000); | ||
| persistValues(value(1)); | ||
| mockSet.mockClear(); | ||
|
|
||
| jest.advanceTimersByTime(200); | ||
| persistValues(value(2)); | ||
|
|
||
| jest.advanceTimersByTime(800); | ||
|
|
||
| expect(mockSet).toHaveBeenCalledTimes(1); | ||
| expect(mockSet).toHaveBeenCalledWith(value(2)); | ||
| }); | ||
|
|
||
| it('flush writes pending values immediately without waiting for the trailing timer', () => { | ||
| jest.advanceTimersByTime(2000); | ||
| persistValues(value(1)); | ||
| mockSet.mockClear(); | ||
|
|
||
| jest.advanceTimersByTime(200); | ||
| persistValues(value(2)); | ||
|
|
||
| expect(mockSet).not.toHaveBeenCalled(); | ||
|
|
||
| flushPersistedValues(); | ||
|
|
||
| expect(mockSet).toHaveBeenCalledTimes(1); | ||
| expect(mockSet).toHaveBeenCalledWith(value(2)); | ||
| }); | ||
|
|
||
| it('flush is a no-op when there is no pending write', () => { | ||
| jest.advanceTimersByTime(2000); | ||
| persistValues(value(1)); | ||
| mockSet.mockClear(); | ||
|
|
||
| flushPersistedValues(); | ||
|
|
||
| expect(mockSet).not.toHaveBeenCalled(); | ||
| }); | ||
| }); |
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
Oops, something went wrong.
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.