Skip to content

Improve browser extension #406

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 21 commits into from
Apr 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ca75243
fix(browser): display host for feed links without a title
Jenselme Apr 3, 2025
39bc2cc
chore(browser): bump extension version
Jenselme Apr 3, 2025
2f22e52
feat(browser): can go back to list of actions from error, article & feed
Jenselme Apr 4, 2025
56f1ab0
chore: disable DDT profiling by default
Jenselme Apr 4, 2025
90db9c2
feat(browser): can delete article from extension
Jenselme Apr 4, 2025
4c8fba6
ref: switch to URL instead of link where we can
Jenselme Apr 8, 2025
d395625
fix(admin): correct CSP policy on Django admin
Jenselme Apr 8, 2025
04d53a9
ref(reading): move article deletion into reading app
Jenselme Apr 8, 2025
3c2058f
feat(api): can list articles
Jenselme Apr 8, 2025
75cf8ee
feat(api): can filter feeds by URL
Jenselme Apr 8, 2025
39111ae
feat(browser): display on actions chooser subscribed feeds
Jenselme Apr 8, 2025
c6301a4
fix(security): allow base64 encoded images
Jenselme Apr 8, 2025
7890c7d
fix(reading): keep h1 titles when we have more than 1
Jenselme Apr 8, 2025
52708ba
chore: update deps
Jenselme Apr 10, 2025
d3bd8ce
feat(browser): display on actions chooser whether the article is alre…
Jenselme Apr 10, 2025
57e2a64
ref(browser): use action object to create feed actions
Jenselme Apr 10, 2025
fc7b6da
feat(api): can filter feeds by enabled status
Jenselme Apr 10, 2025
5f295ab
feat(browser): can delete and disable/enable a feed
Jenselme Apr 10, 2025
8c022d8
doc: update Changelog
Jenselme Apr 10, 2025
8d19025
ref(browser): await saveArticle
Jenselme Apr 12, 2025
e4907d3
ref(notifications): improve naming
Jenselme Apr 12, 2025
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
- --allow-past-years

- repo: https://github.com/adamchainz/django-upgrade
rev: "1.23.1"
rev: "1.24.0"
hooks:
- id: django-upgrade
args: ["--target-version", "5.0"]
Expand All @@ -64,15 +64,15 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.11.2
rev: v0.11.5
hooks:
- id: ruff
args: [--fix, --preview]
- id: ruff-format
args: [--preview]

- repo: https://github.com/seddonym/import-linter
rev: v2.2
rev: v2.3
hooks:
- id: import-linter

Expand All @@ -91,7 +91,7 @@ repos:
args: [-e, SC1091]

- repo: https://github.com/thibaudcolas/pre-commit-stylelint
rev: v16.15.0
rev: v16.18.0
hooks:
- id: stylelint
args: [--fix]
Expand All @@ -100,7 +100,7 @@ repos:
- "[email protected]"

- repo: https://github.com/pre-commit/mirrors-eslint
rev: "v9.22.0"
rev: "v9.24.0"
hooks:
- id: eslint
args: [--fix]
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
## Unreleased

- Show reading list title and reading list actions when scrolling up.
- Improve browser extension:
- Display site title instead of nothing for feed links without a title attribute.
- Can go back to list of actions from error, article & feed.
- Can delete article from extension.
- Display on actions chooser whether the sure is subscribed feeds.
- Display on actions chooser whether the article is already saved.
- Can delete and disable/enable a feed from the extension.
- API changes:
- Switch from `link` to `url` to save articles. This is done to have a consistant naming in the codebase.
- Can list articles and filter them by URLs.
- Can list feeds and filter them by feed URLs and enabled status.
- Correct Django admin styling.
- This was caused by the update to `django-csp` 4.0 which changed how CSP rules are computed. It caused the admin to be unable to load its script files and stylesheets.
- Allow base64 encoded images.
- Keep h1 titles when we have more than 1.
- Some invalid articles may have multiple h1, keep them in this case since they are "normal" article titles and thus must be kept.

## 25.04.1

Expand Down
2 changes: 1 addition & 1 deletion browser-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "legadilo-browser-extension",
"version": "0.2.0",
"version": "0.3.0",
"dependencies": {
"bootstrap": "^5.3.3",
"bootstrap5-tags": "^1.7.5",
Expand Down
68 changes: 64 additions & 4 deletions browser-extension/src/action.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,25 @@
<div id="choose-action-container" class="row row-cols-1 m-auto">
<button id="save-article-action-btn"
class="btn btn-primary mb-2 col"
type="button">Save this article</button>
type="button">
Save this article
<img id="article-already-saved"
class="bi hidden"
src="./vendor/bs-icons/save-fill.svg"
alt="Article already saved" />
</button>
</div>
<div id="subscribe-to-feeds-container" class="row row-cols-1 m-auto"></div>
</div>
<div id="article-container">
<button id="article-nav-back"
class="btn btn-outline-secondary btn-sm"
type="button">
<img class="bi"
src="./vendor/bs-icons/arrow-left.svg"
alt="Go back button" />
Back
</button>
<form id="update-saved-article-form">
<div class="mb-3">
<label for="saved-article-title" class="form-label">
Expand Down Expand Up @@ -56,7 +71,9 @@
</select>
</div>
<div class="mb-3 d-flex justify-content-center">
<button class="btn btn-primary btn-sm" type="submit">Update</button>
<button id="update-saved-article"
class="btn btn-primary btn-sm"
type="submit">Update</button>
</div>
</form>
<div class="mb-3 d-flex justify-content-evenly">
Expand Down Expand Up @@ -96,6 +113,11 @@
src="./vendor/bs-icons/bookmark-fill.svg"
alt="Unmark as for later" />
</button>
<button class="btn btn-outline-danger btn-sm"
type="button"
id="delete-article">
<img class="bi" src="./vendor/bs-icons/trash.svg" alt="Delete article" />
</button>
<a id="open-article-details"
class="btn btn-outline-secondary btn-sm"
role="button"
Expand All @@ -105,6 +127,14 @@
</div>
</div>
<div id="feed-container">
<button id="feed-nav-back"
class="btn btn-outline-secondary btn-sm"
type="button">
<img class="bi"
src="./vendor/bs-icons/arrow-left.svg"
alt="Go back button" />
Back
</button>
<h2 id="feed-title"></h2>
<form id="update-feed-form">
<div class="mb-3">
Expand Down Expand Up @@ -148,19 +178,49 @@ <h2 id="feed-title"></h2>
<option disabled hidden value="">Choose a tag...</option>
</select>
</div>
<button class="btn btn-primary btn-sm">Update</button>
<div class="mb-3 d-flex justify-content-center">
<button id="update-feed" class="btn btn-primary btn-sm" type="submit">Update</button>
</div>
</form>
<div class="mb-3 d-flex justify-content-evenly">
<button id="enable-feed"
class="btn btn-outline-secondary btn-sm"
type="button">Enable</button>
<button id="disable-feed"
class="btn btn-outline-secondary btn-sm"
type="button">Disable</button>
<button class="btn btn-outline-danger btn-sm" type="button" id="delete-feed">
<img class="bi" src="./vendor/bs-icons/trash.svg" alt="Delete feed" />
</button>
<a id="open-feed-details"
class="btn btn-outline-secondary btn-sm"
role="button"
href="">
<img class="bi" src="./vendor/bs-icons/eye.svg" alt="Open feed" />
</a>
</form>
</div>
</div>
<div id="error-container" class="alert alert-danger">
<button id="error-nav-back"
class="btn btn-outline-secondary btn-sm"
type="button">
<img class="bi"
src="./vendor/bs-icons/arrow-left.svg"
alt="Go back button" />
Back
</button>
<p>An error occurred</p>
<pre id="error-message"></pre>
</div>
<dialog id="confirm-dialog">
<div class="modal-header">
<h2 id="confirm-dialog-title" class="modal-title">Do you confirm?</h2>
</div>
<button id="confirm-dialog-cancel-btn"
class="btn btn-outline-secondary"
type="button">No</button>
<button id="confirm-dialog-confirm-btn" class="btn btn-danger" type="button">Yes</button>
</dialog>
<script src="action.js" type="module"></script>
</body>
</html>
Loading