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

[Feature] Add global instance CSS customization setting #3352

Merged
merged 2 commits into from
Dec 2, 2024

Conversation

S0yKaf
Copy link
Contributor

@S0yKaf S0yKaf commented Sep 25, 2024

Description

If this is a code change, please include a summary of what you've coded, and link to the issue(s) it closes/implements.

If this is a documentation change, please briefly describe what you've changed and why.

Allow instance admins to add custom CSS that will affect every page of their instance.

This is done with a new CustomCSS instance setting that works pretty much exactly like the Users CustomCSS property. This custom CSS is then requested for every page load. User styles/themes take precedence over this CSS.

closes #3348

Checklist

Please put an x inside each checkbox to indicate that you've read and followed it: [ ] -> [x]

If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have not leveraged AI to create the proposed changes.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

Allow instance admins to add custom CSS that will affect
every page of their instance.

This is done with a new CustomCSS instance setting that
works pretty much exactly like the Users CustomCSS property.
This custom CSS is then requested for every page load.
User styles/themes take precedence over this CSS.
@S0yKaf S0yKaf changed the title Feat: Add global instance CSS customization setting [Feature] Add global instance CSS customization setting Sep 25, 2024
@S0yKaf S0yKaf marked this pull request as draft September 25, 2024 04:30
@S0yKaf S0yKaf marked this pull request as ready for review September 25, 2024 04:32
@S0yKaf
Copy link
Contributor Author

S0yKaf commented Sep 25, 2024

Contrary to what I've said in the Issue, this will also affect the CSS in the dashboard. Again, no stress for the review, I know you're all busy with the 0.17 release.

@S0yKaf
Copy link
Contributor Author

S0yKaf commented Sep 25, 2024

[GIN-debug] GET    /                         --> github.com/superseriousbusiness/gotosocial/internal/middleware_test.testHeaderFilter.func1 (2 handlers)
--- FAIL: TestThrottlingMiddleware (3.22s)
    throttling_test.go:100: did not return status 429 (200) with queueLimit=512 and request=530
FAIL
FAIL	github.com/superseriousbusiness/gotosocial/internal/middleware	15.506s
ok  	github.com/superseriousbusiness/gotosocial/internal/oauth	5.872s
ok  	github.com/superseriousbusiness/gotosocial/internal/paging	0.053s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing	16.454s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/account	58.451s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/admin	47.852s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/conversations	22.749s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/interactionrequests	13.797s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/media	21.014s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/polls	6.387s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/status	30.041s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/stream	6.448s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/timeline	7.412s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/user	8.663s
ok  	github.com/superseriousbusiness/gotosocial/internal/processing/workers	163.601s
ok  	github.com/superseriousbusiness/gotosocial/internal/router	0.047s
ok  	github.com/superseriousbusiness/gotosocial/internal/text	83.479s
ok  	github.com/superseriousbusiness/gotosocial/internal/timeline	36.871s
ok  	github.com/superseriousbusiness/gotosocial/internal/trans	6.882s
ok  	github.com/superseriousbusiness/gotosocial/internal/transport	19.790s
ok  	github.com/superseriousbusiness/gotosocial/internal/transport/delivery	(cached)
ok  	github.com/superseriousbusiness/gotosocial/internal/typeutils	115.179s
ok  	github.com/superseriousbusiness/gotosocial/internal/util	0.809s
ok  	github.com/superseriousbusiness/gotosocial/internal/validate	0.022s
FAIL

This is what's failing the tests but I can't seem to be able to reproduce it locally. Thoughts?

@tsmethurst
Copy link
Contributor

Yes, just a flaky test I think, I'll re-run

@tsmethurst
Copy link
Contributor

Great stuff, thank you! Sorry for the late review :') I'll get this branch up to date and squerge it.

@tsmethurst tsmethurst merged commit 9609c45 into superseriousbusiness:main Dec 2, 2024
3 checks passed
@S0yKaf
Copy link
Contributor Author

S0yKaf commented Dec 2, 2024

Hey cool, Thank you!

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.

[feature] Add custom CSS for Instance Frontpage
2 participants