Skip to content

Commit

Permalink
feat(file-picker): add fuzzy search to file picker (#3517)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo-vrijswijk authored Nov 22, 2024
1 parent 3c79cd1 commit 577c6c1
Show file tree
Hide file tree
Showing 38 changed files with 299 additions and 200 deletions.
3 changes: 1 addition & 2 deletions libs/eslint-plugin-mte/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ export default [
reportUnusedDisableDirectives: 'error',
},
rules: {
eqeqeq: 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
// Not useful for a lot of stuff, but mainly `.shadowRoot`
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions packages/elements/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@
"url": "http://localhost:5173",
"webRoot": "${workspaceFolder}",
"sourceMaps": true
},
{
"type": "node",
"request": "launch",
"name": "Run unit tests",
"program": "${workspaceFolder:parent}/node_modules/vitest/vitest.mjs",
"console": "integratedTerminal",
"skipFiles": ["<node_internals>/**"],
"args": ["--inspect-brk", "--browser", "--no-file-parallelism"]
},
{
"type": "chrome",
"request": "attach",
"name": "Attach to unit test browser",
"skipFiles": ["<node_internals>/**"],
"port": 9229
}
],
"compounds": [
{
"name": "Debug unit tests",
"configurations": ["Attach to unit test browser", "Run unit tests"],
"stopAll": true
}
]
}
1 change: 1 addition & 0 deletions packages/elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"esbuild": "0.24.0",
"eslint-config-mte": "*",
"express": "4.21.1",
"fuzzysort": "3.1.0",
"lit": "3.2.1",
"mutation-testing-metrics": "3.3.0",
"mutation-testing-real-time": "3.3.0",
Expand Down
11 changes: 6 additions & 5 deletions packages/elements/src/components/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { PropertyValues } from 'lit';
import { html, isServer, nothing, unsafeCSS } from 'lit';
import { customElement, property, query } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import type {
FileUnderTestModel,
Metrics,
Expand Down Expand Up @@ -370,11 +371,11 @@ export class MutationTestReportAppComponent extends RealTimeElement {
.path="${this.context.path}"
></mte-breadcrumb>
<mte-result-status-bar
.detected="${this.rootModel?.systemUnderTestMetrics.metrics.totalDetected}"
.noCoverage="${this.rootModel?.systemUnderTestMetrics.metrics.noCoverage}"
.pending="${this.rootModel?.systemUnderTestMetrics.metrics.pending}"
.survived="${this.rootModel?.systemUnderTestMetrics.metrics.survived}"
.total="${this.rootModel?.systemUnderTestMetrics.metrics.totalValid}"
detected="${ifDefined(this.rootModel?.systemUnderTestMetrics.metrics.totalDetected)}"
noCoverage="${ifDefined(this.rootModel?.systemUnderTestMetrics.metrics.noCoverage)}"
pending="${ifDefined(this.rootModel?.systemUnderTestMetrics.metrics.pending)}"
survived="${ifDefined(this.rootModel?.systemUnderTestMetrics.metrics.survived)}"
total="${ifDefined(this.rootModel?.systemUnderTestMetrics.metrics.totalValid)}"
></mte-result-status-bar>
${this.context.view === 'mutant' && this.context.result
? html`<mte-mutant-view
Expand Down
4 changes: 3 additions & 1 deletion packages/elements/src/components/breadcrumb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export class MutationTestReportBreadcrumbComponent extends LitElement {
}

#renderSearchIcon() {
return html` <button @click="${() => this.#dispatchFilePickerOpenEvent()}" class="ml-auto" title="open file picker">${searchIcon}</button> `;
return html`
<button @click="${() => this.#dispatchFilePickerOpenEvent()}" class="ml-auto" title="Open file picker (Ctrl-K)">${searchIcon}</button>
`;
}

#dispatchFilePickerOpenEvent() {
Expand Down
Loading

0 comments on commit 577c6c1

Please sign in to comment.