Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint:js
- run: npm run lint:css

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm test

validate-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- run: node tests/validate-manifest.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
8 changes: 8 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "stylelint-config-standard",
"rules": {
"custom-property-pattern": null,
"selector-class-pattern": null,
"declaration-block-no-redundant-longhand-properties": null
}
}
4 changes: 2 additions & 2 deletions content.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

.ghawf-folder-header:hover {
background-color: var(--bgColor-neutral-muted, rgba(175, 184, 193, 0.2));
background-color: var(--bgColor-neutral-muted, rgb(175 184 193 / 20%));
}

.ghawf-folder-arrow {
Expand Down Expand Up @@ -56,7 +56,7 @@
height: 20px;
padding: 0 6px;
border-radius: 10px;
background-color: var(--bgColor-neutral-muted, rgba(175, 184, 193, 0.2));
background-color: var(--bgColor-neutral-muted, rgb(175 184 193 / 20%));
color: var(--fgColor-muted);
font-size: 12px;
font-weight: 500;
Expand Down
14 changes: 1 addition & 13 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

const ATTR_ORIGINAL_NAME = "data-ghawf-original-name";

let debounceTimer = null;
let expandingAll = false;

/**
Expand Down Expand Up @@ -171,7 +170,7 @@
const items = Array.from(ul.querySelectorAll(SELECTORS.workflowItem));
if (items.length === 0) return;

const { ungrouped, folders } = buildTree(items);
const { folders } = buildTree(items);
if (folders.size === 0) return;

// Find the "Show more" element to insert folders before it
Expand Down Expand Up @@ -250,17 +249,6 @@
});
}

/**
* Debounced apply.
*/
function scheduleApply() {
if (debounceTimer) clearTimeout(debounceTimer);
debounceTimer = setTimeout(() => {
debounceTimer = null;
applyGrouping();
}, 100);
}

/**
* Set up MutationObserver for SPA navigation.
* While expandingAll is true, skip re-grouping (handled by expandAllThenGroup).
Expand Down
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export default [
{
files: ["content.js"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "script",
globals: {
document: "readonly",
window: "readonly",
MutationObserver: "readonly",
Node: "readonly",
setTimeout: "readonly",
clearTimeout: "readonly",
getComputedStyle: "readonly",
},
},
rules: {
"no-unused-vars": "error",
"no-undef": "error",
eqeqeq: "error",
"no-var": "error",
"prefer-const": "error",
},
},
{
ignores: ["node_modules/", "tests/", "eslint.config.js"],
},
];
Loading