Skip to content

Commit 4a92a67

Browse files
authored
Wip/new to nl 2 (#658)
Changes made as part of the Wayfinder Project in partnership with Collective Interchange. https://github.com/collective-interchange-coop/new-to-nl # Summary: Wayfinder Enhancements and Fixes This pull request introduces a comprehensive set of updates, optimizations, and new features for the **Wayfinder Project** in partnership with **Collective Interchange**. The changes include enhancements to navigation, content blocks, caching, localization, and accessibility, as well as various bug fixes and performance improvements. --- ## Key Changes: ### 1. Navigation Improvements: - Improved sidebar and top navigation usability and performance. - Optimized SQL queries for navigation rendering, reducing database load times. - Cached sidebar, header, and footer navigation items for enhanced performance. - Enhanced dropdown menu styling and active state behavior. - Added scroll indicators to large hero blocks for better user experience. ### 2. Content Block Enhancements: - Introduced new content block types, including hero blocks and translatable HTML blocks. - Improved background image support with optimized rendering and caching. - Added a customizable CSS content block for platform-wide theming. - Enhanced page builder functionality with independent CRUD operations for blocks. ### 3. Caching and Performance Optimization: - Cached frequently accessed data such as navigation items, blocks, and permissions. - Preloaded associations to improve rendering times for navigation and profile pages. - Introduced instance-level caching for roles and CSS blocks. - Drastically improved load times for navigation and page blocks through caching. ### 4. Localization and Translation: - Completed Spanish and French translations for key views and features. - Added automated translation tasks using OpenAI API for translatable attributes. - Ensured consistent capitalization and localization of translated attributes. - Scoped routes and dispatch helpers to respect locale settings. ### 5. Notifications and Messaging: - Added the `noticed` gem for in-app notifications. - Introduced initial versions of messaging and conversations functionality. - Enhanced notification management actions and UI. ### 6. Metrics and Analytics: - Added tracking for page views, link clicks, and downloads. - Implemented background jobs to process social share and metrics data. - Excluded bot user agents and specific links (e.g., Trix editor links) from tracking. ### 7. Accessibility and UI Enhancements: - Improved accessibility for navigation, forms, and buttons. - Enhanced profile images and social share button layout. - Added password visibility toggles to login forms. - Improved structure and spacing of UI elements for a more user-friendly experience. ### 8. Bug Fixes: - Resolved issues with navigation item visibility checks and link generation. - Fixed problems with route generation in localized contexts. - Addressed caching issues for user navigation and content rendering. --- ## Technical Improvements: - Added default profile images for people and communities. - Enhanced performance profiling tools for platform managers. - Resolved Rubocop and Brakeman warnings for code quality and security. - Simplified Stimulus controller handling under the `better_together` namespace. --- ## Future Considerations: This PR establishes a solid foundation for upcoming features, including: - Expanded page builder capabilities with additional block types. - Improved metrics tracking and analytics reporting. - Further enhancements to automated translation for rich text attributes. ---
2 parents cbe099d + 8a63a81 commit 4a92a67

File tree

519 files changed

+11622
-4670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

519 files changed

+11622
-4670
lines changed

.github/workflows/rubyonrails.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
push:
1010
branches: [ "main" ]
1111
pull_request:
12-
branches: [ "main" ]
12+
branches: [ "main", "wip/new-to-nl-2" ]
1313
jobs:
1414
rspec:
1515
runs-on: ubuntu-latest

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ group :development do
7676
gem 'bundler-audit', require: false
7777
# Facilitate I18n translation management
7878
gem 'i18n_generators'
79+
80+
gem 'easy_translate'
7981
# Listen for file system changes
8082
gem 'listen', '>= 3.0.5', '< 3.10'
8183
# Rack mini profiler for performance profiling

Gemfile.lock

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ PATH
2020
remote: .
2121
specs:
2222
better_together (0.6.0)
23+
active_storage_svg_sanitizer
2324
active_storage_validations
2425
activerecord-import
2526
activerecord-postgis-adapter
@@ -33,21 +34,26 @@ PATH
3334
font-awesome-sass (~> 6.5)
3435
friendly_id (>= 5.2, < 5.6)
3536
friendly_id-mobility (~> 1.0.4)
37+
groupdate
3638
i18n-timezones
3739
image_processing (~> 1.2)
3840
importmap-rails (~> 2.0)
3941
jsonapi-resources (>= 0.10.0)
42+
memory_profiler
4043
mobility (>= 1.0.1, < 2.0)
4144
mobility-actiontext (~> 1.1)
4245
noticed
4346
premailer-rails
4447
pundit (>= 2.1, < 2.5)
4548
pundit-resources
4649
rack-cors (>= 1.1.1, < 2.1.0)
50+
rack-mini-profiler
4751
rails (>= 5.2.2, < 7.2.0)
4852
reform-rails (~> 0.2.0)
4953
rswag (>= 2.3.1, < 2.17.0)
54+
ruby-openai
5055
sprockets-rails
56+
stackprof
5157
stimulus-rails (~> 1.3)
5258
storext
5359
translate_enum
@@ -105,6 +111,8 @@ GEM
105111
erubi (~> 1.11)
106112
rails-dom-testing (~> 2.2)
107113
rails-html-sanitizer (~> 1.6)
114+
active_storage_svg_sanitizer (0.1.0)
115+
rails (>= 5.2)
108116
active_storage_validations (1.4.0)
109117
activejob (>= 6.1.4)
110118
activemodel (>= 6.1.4)
@@ -218,7 +226,7 @@ GEM
218226
thor (~> 1.2)
219227
tins (~> 1.32)
220228
crass (1.0.6)
221-
css_parser (1.19.0)
229+
css_parser (1.21.0)
222230
addressable
223231
dartsass-sprockets (3.2.0)
224232
railties (>= 4.0.0)
@@ -254,15 +262,19 @@ GEM
254262
representable (>= 3.1.1, < 4)
255263
docile (1.4.0)
256264
drb (2.2.1)
257-
dry-auto_inject (1.0.1)
258-
dry-core (~> 1.0)
265+
dry-auto_inject (1.1.0)
266+
dry-core (~> 1.1)
259267
zeitwerk (~> 2.6)
260-
dry-configurable (1.2.0)
261-
dry-core (~> 1.0, < 2)
268+
dry-configurable (1.3.0)
269+
dry-core (~> 1.1)
262270
zeitwerk (~> 2.6)
263-
dry-core (1.0.1)
271+
dry-core (1.1.0)
264272
concurrent-ruby (~> 1.0)
273+
logger
265274
zeitwerk (~> 2.6)
275+
easy_translate (0.5.1)
276+
thread
277+
thread_safe
266278
elasticsearch (7.17.11)
267279
elasticsearch-api (= 7.17.11)
268280
elasticsearch-transport (= 7.17.11)
@@ -278,20 +290,24 @@ GEM
278290
faraday (>= 1, < 3)
279291
multi_json
280292
erubi (1.13.1)
293+
event_stream_parser (1.0.0)
281294
excon (1.2.3)
282-
execjs (2.9.1)
295+
execjs (2.10.0)
283296
factory_bot (6.5.0)
284297
activesupport (>= 5.0.0)
285298
factory_bot_rails (6.4.4)
286299
factory_bot (~> 6.5)
287300
railties (>= 5.0.0)
288301
faker (3.5.1)
289302
i18n (>= 1.8.11, < 2)
290-
faraday (2.11.0)
291-
faraday-net_http (>= 2.0, < 3.4)
303+
faraday (2.12.2)
304+
faraday-net_http (>= 2.0, < 3.5)
305+
json
292306
logger
293-
faraday-net_http (3.3.0)
294-
net-http
307+
faraday-multipart (1.1.0)
308+
multipart-post (~> 2.0)
309+
faraday-net_http (3.4.0)
310+
net-http (>= 0.5.0)
295311
ffi (1.17.1-x86_64-linux-gnu)
296312
fog-aws (3.30.0)
297313
base64 (~> 0.2.0)
@@ -325,6 +341,8 @@ GEM
325341
google-protobuf (4.29.3-x86_64-linux)
326342
bigdecimal
327343
rake (>= 13)
344+
groupdate (6.5.1)
345+
activesupport (>= 7)
328346
hashie (5.0.0)
329347
highline (3.1.0)
330348
reline
@@ -362,13 +380,14 @@ GEM
362380
reline (>= 0.4.2)
363381
jmespath (1.6.2)
364382
json (2.10.1)
365-
json-schema (5.1.0)
383+
json-schema (5.1.1)
366384
addressable (~> 2.8)
385+
bigdecimal (~> 3.1)
367386
jsonapi-resources (0.10.7)
368387
activerecord (>= 4.1)
369388
concurrent-ruby
370389
railties (>= 4.1)
371-
jwt (2.8.2)
390+
jwt (2.10.1)
372391
base64
373392
language_server-protocol (3.17.0.4)
374393
lint_roller (1.1.0)
@@ -386,6 +405,7 @@ GEM
386405
net-smtp
387406
marcel (1.0.4)
388407
matrix (0.4.2)
408+
memory_profiler (1.1.0)
389409
method_source (1.1.0)
390410
mime-types (3.6.0)
391411
logger
@@ -404,8 +424,9 @@ GEM
404424
mobility (~> 1.2)
405425
msgpack (1.7.2)
406426
multi_json (1.15.0)
427+
multipart-post (2.4.1)
407428
mutex_m (0.3.0)
408-
net-http (0.4.1)
429+
net-http (0.6.0)
409430
uri
410431
net-imap (0.5.6)
411432
date
@@ -593,6 +614,10 @@ GEM
593614
rubocop-rspec (3.5.0)
594615
lint_roller (~> 1.1)
595616
rubocop (~> 1.72, >= 1.72.1)
617+
ruby-openai (7.3.1)
618+
event_stream_parser (>= 0.3.0, < 2.0.0)
619+
faraday (>= 1)
620+
faraday-multipart (>= 1)
596621
ruby-progressbar (1.13.0)
597622
ruby-vips (2.2.3)
598623
ffi (~> 1.12)
@@ -654,6 +679,7 @@ GEM
654679
terminal-table (3.0.2)
655680
unicode-display_width (>= 1.1.1, < 3)
656681
thor (1.3.2)
682+
thread (0.2.2)
657683
thread_safe (0.3.6)
658684
tilt (2.6.0)
659685
timeout (0.4.3)
@@ -673,14 +699,14 @@ GEM
673699
execjs (>= 0.3.0, < 3)
674700
unf (0.2.0)
675701
unicode-display_width (2.6.0)
676-
uri (0.13.1)
702+
uri (1.0.2)
677703
virtus (2.0.0)
678704
axiom-types (~> 0.1)
679705
coercible (~> 1.0)
680706
descendants_tracker (~> 0.0, >= 0.0.3)
681707
warden (1.2.9)
682708
rack (>= 2.0.9)
683-
warden-jwt_auth (0.10.0)
709+
warden-jwt_auth (0.11.0)
684710
dry-auto_inject (>= 0.8, < 2)
685711
dry-configurable (>= 0.13, < 2)
686712
jwt (~> 2.1)
@@ -721,6 +747,7 @@ DEPENDENCIES
721747
coveralls_reborn
722748
database_cleaner
723749
database_cleaner-active_record
750+
easy_translate
724751
factory_bot_rails
725752
faker
726753
fog-aws
102 KB
Loading
102 KB
Loading
102 KB
Loading
69 KB
Loading
69 KB
Loading
69 KB
Loading

app/assets/stylesheets/better_together/application.scss

Lines changed: 55 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,52 @@
1010
* files in this directory. Styles in this file should be added after the last require_* statement.
1111
* It is generally better to create a new file per style scope.
1212
*
13-
*= require_tree .
1413
*= require_self
1514
*/
1615

17-
@import 'bootstrap';
18-
@import 'font-awesome';
16+
@import 'theme';
1917

20-
/* Default text color for light mode */
21-
.text-opposite-theme {
22-
color: #333; /* dark text on light background */
18+
// Import Bootstrap and Font Awesome
19+
20+
@import 'bootstrap';
21+
@import 'font-awesome';
22+
@import 'actiontext';
23+
@import 'contact_details';
24+
@import 'content_blocks';
25+
@import 'conversations';
26+
@import 'forms';
27+
@import 'metrics';
28+
@import 'navigation';
29+
@import 'notifications';
30+
@import 'profiles';
31+
@import 'share';
32+
@import 'sidebar_nav';
33+
@import 'trix-extensions/richtext';
34+
35+
// Styles that use the variables
36+
.text-opposite-theme {
37+
color: $text-opposite-theme-color; /* Use the defined variable */
2338
}
2439

25-
/* When the user's system preference is dark mode, adjust text color */
2640
@media (prefers-color-scheme: dark) {
2741
.text-opposite-theme {
28-
color: #f8f9fa; /* light text on dark background */
42+
color: $dark-text-color;
2943
}
3044
}
3145

32-
/* Similarly, if the background is meant to be dark, you can set text to be light and vice versa */
33-
/* Default background color for light mode with dark text */
3446
.background-opposite-theme {
35-
background-color: #fff;
36-
color: #333;
47+
background-color: $background-opposite-theme-color;
48+
color: $text-opposite-theme-color;
3749
}
3850

39-
/* When the user's system preference is dark mode, adjust background and text color */
4051
@media (prefers-color-scheme: dark) {
4152
.background-opposite-theme {
42-
background-color: #212529;
43-
color: #f8f9fa;
53+
background-color: $dark-background-color;
54+
color: $dark-text-color;
4455
}
4556
}
4657

58+
4759
.highlight-translation-missing span.translation_missing {
4860
background: #e1b1ed;
4961
}
@@ -56,3 +68,31 @@
5668
#flash_messages {
5769
position: relative;
5870
}
71+
72+
.wrapper {
73+
display: flex;
74+
flex-direction: column;
75+
min-height: 100vh; /* Ensure the wrapper takes full height */
76+
}
77+
78+
.content {
79+
flex: 1; /* Allow the main content to grow and take up remaining space */
80+
position: relative;
81+
}
82+
83+
@keyframes flip {
84+
0% {
85+
transform: rotateY(0deg);
86+
}
87+
50% {
88+
transform: rotateY(180deg);
89+
}
90+
100% {
91+
transform: rotateY(360deg);
92+
}
93+
}
94+
95+
.spin-horizontal {
96+
animation: flip 1s linear infinite;
97+
}
98+

0 commit comments

Comments
 (0)