Skip to content
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

feat: allow selecting light/dark/follow themes in the webui #924

Merged
merged 19 commits into from
Jun 6, 2024

Conversation

Monirzadeh
Copy link
Collaborator

@Monirzadeh Monirzadeh commented Jun 1, 2024

This PR try to fix #251 and some other fix

  • fix warrning in login page
  • Login page allways follow system settings theme
  • have 3 option Follow system settings, Light , and dark theme
  • hide old NightMode from settings and replace that with drop down menu
  • fix bug that theme not apply if you select dark mode in browser
  • content page follow same settings
  • fix content page load-settings wrong syntax that block from load settings completely
  • drop down menu follow theme color
  • fix version number be always black in login page. now it follow the theme color

Closes #251
Closes #561

Copy link

codecov bot commented Jun 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.08%. Comparing base (47a0143) to head (168b669).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #924   +/-   ##
=======================================
  Coverage   34.08%   34.08%           
=======================================
  Files          60       60           
  Lines        4008     4008           
=======================================
  Hits         1366     1366           
  Misses       2420     2420           
  Partials      222      222           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome as always! This is something I had on my radar for quite a while now since I depend a lot on my system switching themes depending on the hour of the day.

I've given this a quick look and left some comments around. Let me know what you think.

internal/view/assets/js/page/setting.js Outdated Show resolved Hide resolved
internal/view/assets/js/page/setting.js Outdated Show resolved Hide resolved
internal/view/content.html Outdated Show resolved Hide resolved
internal/view/content.html Outdated Show resolved Hide resolved
internal/view/login.html Outdated Show resolved Hide resolved
internal/view/assets/less/common.less Outdated Show resolved Hide resolved
@Monirzadeh Monirzadeh requested a review from fmartingr June 3, 2024 11:11
@Monirzadeh
Copy link
Collaborator Author

Monirzadeh commented Jun 3, 2024

i don't know why but in some situation it need to refresh page. (when you set follow and system settings change i am not sure about best way to solve that or keep that as it is)

@fmartingr
Copy link
Member

fmartingr commented Jun 3, 2024

i don't know why but in some situation it need to refresh page.

hey I also forgot to send you this patch, I don't know how it will behave with the latest changes. It's a UI improvement to have the select at the right of the block.

Now that I see the screenshot maybe is weird having it on different positions as the checkboxes. Feel free to use it or not, we can address better UI changes in the future.

system-theme-justify.patch

Screenshot 2024-06-03 at 13 19 39

@Monirzadeh
Copy link
Collaborator Author

Monirzadeh commented Jun 3, 2024

@fmartingr What do you think?

  • ignore dark layer that you see in light them*/

Current

currentcurrent-d

Empty Space (need adjust currently get fix size)

empty
empty-d

icon (any other icon suggestion?)

icon
icon-d

@fmartingr
Copy link
Member

@fmartingr What do you think?

You have worked on this so I'll let you decide :)

@Monirzadeh
Copy link
Collaborator Author

I personaly like the simplicity of the current setup. Maybe change that later.

@fmartingr fmartingr changed the title feat : Shiori can follow system theme settings feat: allow using system dark/light theme in the webui Jun 3, 2024
@fmartingr
Copy link
Member

Can you check if with your changes you also solved #561?

@Monirzadeh
Copy link
Collaborator Author

No. it is not solve the problem and i can't find a clean solution for that yet.
the problem is that we try to update variable or element that not load yet. we can do some tricks like that done on that PR but i can't finding solution that convince me yet.

Copy link
Member

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @Monirzadeh 👏 I have been wanting this for quite some time.

I've left some comments of code parts I think are not in use, can you confirm?

internal/view/assets/js/page/base.js Outdated Show resolved Hide resolved
internal/view/assets/js/page/base.js Outdated Show resolved Hide resolved
internal/view/login.html Outdated Show resolved Hide resolved
internal/view/content.html Show resolved Hide resolved
@Monirzadeh Monirzadeh requested a review from fmartingr June 6, 2024 07:24
@fmartingr fmartingr changed the title feat: allow using system dark/light theme in the webui feat: allow selecting light/dark/follow themes in the webui Jun 6, 2024
@fmartingr fmartingr merged commit 2a231ec into go-shiori:master Jun 6, 2024
11 checks passed
@Monirzadeh Monirzadeh deleted the issue-215 branch June 6, 2024 09:14
truecharts-admin referenced this pull request in truecharts/public Jun 8, 2024
…0@85a47b2 by renovate (#23111)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/go-shiori/shiori](https://togithub.com/go-shiori/shiori) |
minor | `v1.6.3` -> `v1.7.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>go-shiori/shiori (ghcr.io/go-shiori/shiori)</summary>

###
[`v1.7.0`](https://togithub.com/go-shiori/shiori/releases/tag/v1.7.0)

[Compare
Source](https://togithub.com/go-shiori/shiori/compare/v1.6.3...v1.7.0)

**Always remember to backup your data before updating.**

#### Notable changes

##### System Theme
([@&#8203;Monirzadeh](https://togithub.com/Monirzadeh))
[#&#8203;924](https://togithub.com/go-shiori/shiori/issues/924)

Shiori now allows you to change the theme to light/dark or follow the
system configuration.

![Screenshot 2024-06-03 at 13 19
39](https://togithub.com/go-shiori/shiori/assets/812088/76e3e062-e36c-4118-84d5-563ad48334cb)

##### New migrations backend
([@&#8203;fmartingr](https://togithub.com/fmartingr))
[#&#8203;876](https://togithub.com/go-shiori/shiori/issues/876)

The underlying migrations system has been rewritten to custom code
removing the [go-migrate
dependency](https://togithub.com/golang-migrate/migrate).

This not only removes one more dependency but also allows for more
control over the migrations process by letting us add run code in a
migration, for example, to update the database schema.

This should be transparent for all users but if you find any problems
please [report
it](https://togithub.com/go-shiori/shiori/issues/new/choose)

##### OpenBSD support
([@&#8203;pacoesteban](https://togithub.com/pacoesteban))
[#&#8203;780](https://togithub.com/go-shiori/shiori/issues/780)

This has been in the works for several months since we broke it around
1.5 but thanks to the above migration changes and some custom database
engine backend for OpenBSD, we are now able to support OpenBSD again. We
added a CI step to get early warnings if we introduce something that
breaks support.

#### What's Changed

- feat: new migration system by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/876](https://togithub.com/go-shiori/shiori/pull/876)
- chore(deps): bump the all group across 1 directory with 4 updates by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-shiori/shiori/pull/895](https://togithub.com/go-shiori/shiori/pull/895)
- refactor: allow specific sqlite engine for OpenBSD by
[@&#8203;pacoesteban](https://togithub.com/pacoesteban) in
[https://github.com/go-shiori/shiori/pull/780](https://togithub.com/go-shiori/shiori/pull/780)
- chore(deps): bump the all group across 1 directory with 4 updates by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-shiori/shiori/pull/900](https://togithub.com/go-shiori/shiori/pull/900)
- chore(deps): bump the all group with 4 updates by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-shiori/shiori/pull/902](https://togithub.com/go-shiori/shiori/pull/902)
- fix: not checking for nil-pointer errors on migrations by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/906](https://togithub.com/go-shiori/shiori/pull/906)
- ci: unify local and ci docker workflows by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/907](https://togithub.com/go-shiori/shiori/pull/907)
- fix: ensure tmp folder is present on docker container by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/910](https://togithub.com/go-shiori/shiori/pull/910)
- deps: update golang dependencies by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/915](https://togithub.com/go-shiori/shiori/pull/915)
- chore(deps): bump the all group with 3 updates by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-shiori/shiori/pull/908](https://togithub.com/go-shiori/shiori/pull/908)
- chore(deps): bump the all group with 2 updates by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-shiori/shiori/pull/917](https://togithub.com/go-shiori/shiori/pull/917)
- feat: Home button clear search query by
[@&#8203;Monirzadeh](https://togithub.com/Monirzadeh) in
[https://github.com/go-shiori/shiori/pull/916](https://togithub.com/go-shiori/shiori/pull/916)
- chore(deps): bump codecov/codecov-action from 4.4.0 to 4.4.1 in the
all group by [@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-shiori/shiori/pull/922](https://togithub.com/go-shiori/shiori/pull/922)
- chore: check for avx2 processor feature when trying to run bun by
[@&#8203;Monirzadeh](https://togithub.com/Monirzadeh) in
[https://github.com/go-shiori/shiori/pull/920](https://togithub.com/go-shiori/shiori/pull/920)
- ci: fix codecov action by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/928](https://togithub.com/go-shiori/shiori/pull/928)
- fix: incorrect original link in archive page by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/931](https://togithub.com/go-shiori/shiori/pull/931)
- fix : wrong response type for readable endpoint documentation by
[@&#8203;Monirzadeh](https://togithub.com/Monirzadeh) in
[https://github.com/go-shiori/shiori/pull/932](https://togithub.com/go-shiori/shiori/pull/932)
- feat: allow selecting light/dark/follow themes in the webui by
[@&#8203;Monirzadeh](https://togithub.com/Monirzadeh) in
[https://github.com/go-shiori/shiori/pull/924](https://togithub.com/go-shiori/shiori/pull/924)
- fix: add version to goreleaser archive filename by
[@&#8203;fmartingr](https://togithub.com/fmartingr) in
[https://github.com/go-shiori/shiori/pull/934](https://togithub.com/go-shiori/shiori/pull/934)

#### New Contributors

- [@&#8203;pacoesteban](https://togithub.com/pacoesteban) made their
first contribution in
[https://github.com/go-shiori/shiori/pull/780](https://togithub.com/go-shiori/shiori/pull/780)

**Full Changelog**:
go-shiori/shiori@v1.6.3...v1.7.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTkuMyIsInVwZGF0ZWRJblZlciI6IjM3LjM5OS4zIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbImF1dG9tZXJnZSIsInVwZGF0ZS9kb2NrZXIvZ2VuZXJhbC9ub24tbWFqb3IiXX0=-->
@Monirzadeh Monirzadeh self-assigned this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to select between light, dark and follow system themes
2 participants