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

Subpage Navigation via Buttons #170

Merged
merged 30 commits into from
Nov 6, 2024
Merged

Conversation

mtwente
Copy link
Member

@mtwente mtwente commented Oct 25, 2024

Pull request

Proposed changes

  • remove dropdowns from navbar, fixes Enhance Navbar #87

    • data.html
      • turn Datenarchiv into its own button on data.html
      • remove separate Quellcode button (still available via a modal on data.html, could also be added to the footer if necessary).
    • browse.html
    • timeline.html
      • add button to the right for changing views to browse, subjects and wordcloud
      • remove separate button for selecting each year separately, since with more data, the dropdown menu is becoming longer than the Rhine). We could have the dropdown selection with centuries? But that would still be a large dropdown menu with the entries from Volume 1.
    • subjects.html
      • add button to the right for changing views to browse, timeline and wordcloud
    • eras.html
      • add button to the right for changing views to browse, timeline and subjects.
      • this button is centered on smaller screens for better visual appearance
  • minor CSS improvements for browse.html regarding colouring and mobile view

  • add "Ansicht umschalten", "Zeitachse", "Themen", "Epochen" as entries to translations.yml (ignored translations to Spanish...). I am not sure about the wording/translation for browse. Now it does not really fit to the other categories (verb vs. noun), but I did not have any good idea for phrasing at the moment.

Types of changes

  • New feature (non-breaking change which adds functionality).
  • Enhancement (non-breaking change which enhances functionality)
  • Bug Fix (non-breaking change which fixes an issue).
  • Breaking change (fix or feature that would cause existing functionality to change).

Checklist

  • I have read the CONTRIBUTING document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added multilingual support with new translation keys for various UI elements: "Download," "Filtered Metadata (Excel)," "Filtered Metadata (CSV)," "More Exports," "Objects," "Timeline," "Subjects," "Eras," and "Switch View."
    • Introduced a dropdown menu for switching views in the cloud layout.
  • User Interface Enhancements

    • Updated button labels for data export functionality to improve clarity.
    • Reorganized layout for better usability, including replacing sorting options with view-switching mechanisms.
    • Enhanced styling for input fields and interactive elements for improved user experience.
    • Updated content in the "Research Data" page to reflect new focus and improved clarity.
    • Improved layout and navigation structure on the "Browse" and "Timeline" pages for better accessibility.
    • Adjusted button layout in the timeline and list pages for a more intuitive navigation experience.
    • Implemented responsive design for button layouts based on screen size.

@mtwente mtwente requested review from maehr and koilebeit October 25, 2024 17:06
Copy link

changeset-bot bot commented Oct 25, 2024

⚠️ No Changeset found

Latest commit: 28129cb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

coderabbitai bot commented Oct 25, 2024

Walkthrough

The pull request introduces multiple enhancements to the application's user interface and localization capabilities. Key changes include the addition of new translation keys in the _data/translations.yml file for various UI elements, modifications to button labels and functionality in the JavaScript file _includes/js/table-js.html, and a redesign of the "Browse" page layout in _layouts/browse.html. Additional updates include new dropdown menus for view switching across different layouts and styling adjustments in _sass/_custom.scss to improve visual consistency.

Changes

File Path Change Summary
_data/translations.yml Added new translation keys: download, filtered_metadata_excel, filtered_metadata_csv, more_exports, objects, timeline, subjects, eras, view-objects, view-timeline, view-subjects, view-eras, switch-view.
_includes/js/table-js.html Updated button text for export functionality and adjusted layout of DataTables controls.
_layouts/browse.html Removed sorting button and added buttons for switching views: Objects, Timeline, Subjects, Eras.
_layouts/cloud.html Introduced a new dropdown menu for switching views with links to "Browse," "Timeline," "Subjects," and "Eras."
_layouts/list.html Integrated sorting dropdown into a new flexbox layout and added a view-switching dropdown.
_layouts/timeline_edtf.html Replaced year navigation dropdown with a "Switch View" button and enhanced layout using flexbox.
_sass/_custom.scss Modified styles for .form-control, added new style for #site-search, and adjusted hover/focus states.
pages/data.md Changed title from "Metadaten" to "Forschungsdaten" and updated content for clarity and detail.
pages/eras.md Changed section title from "Epochen durchsuchen" to "Sammlung durchsuchen."
pages/subjects.md Changed section title from "Themen durchsuchen" to "Sammlung durchsuchen."
pages/timeline.md Changed title from "Zeitachse der Daten" to "Sammlung durchsuchen."
_includes/js/switch-view-js.html Added a new function toggleButtonView for responsive button layout changes.

Assessment against linked issues

Objective Addressed Explanation
Enhance Navbar ( #87 ) No split dropdown buttons were implemented.
Remove sorting by date on the browse page ( #146 ) Sorting functionality was removed as per the requirement.

Possibly related PRs

  • add global trigger warning #155: The changes in the main PR regarding new translation keys for "Download" and "More Exports" are related to the modifications in _includes/js/table-js.html, which also introduces new variables for localized button text including "download" and "more_exports".
  • fix timeline #171: The timeline layout changes in the main PR are relevant to the modifications in _layouts/timeline_edtf.html, which also deals with the timeline feature and its presentation.
  • improve dropdown button on timeline #180: The updates to the translations for the timeline feature in the main PR connect with the changes made in _data/translations.yml, which includes updates to the translations related to the timeline dropdown functionality.

Suggested reviewers

  • maehr

Poem

In the fields where rabbits play,
New buttons and views brighten the day.
With translations added, we hop with glee,
A joyful interface for you and me! 🐇✨
Switch and browse, oh what a sight,
Our little world now feels just right!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4435f70 and 28129cb.

📒 Files selected for processing (1)
  • _includes/js/switch-view-js.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • _includes/js/switch-view-js.html

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🧹 Outside diff range and nitpick comments (3)
_layouts/cloud.html (1)

11-20: Enhance accessibility with ARIA labels.

The dropdown button could benefit from more descriptive ARIA labels to improve accessibility.

 <button
   class="btn btn-outline-primary mt-1 dropdown-toggle"
   type="button"
   id="switchViewButton"
   data-bs-toggle="dropdown"
   aria-haspopup="true"
   aria-expanded="false"
+  aria-label="{{ site.data.translations._layouts['browse.html']['switch-view'][site.lang] | default: 'Switch View' }}"
 >
_sass/_custom.scss (2)

97-97: Consider adding a transition for smoother focus effect.

The inset shadow provides a more subtle and modern focus state. To enhance the user experience further, consider adding a transition for the box-shadow property.

 .form-control {    
     &:focus {
         border-width: 1px;
         border-color: #ffe880;
-        box-shadow:inset 0 0 0 .15rem #ffe880;
+        box-shadow:inset 0 0 0 .15rem #ffe880;
+        transition: box-shadow 0.15s ease-in-out;
     }
 }

101-103: Ensure consistent styling with form-control focus state.

The new filterTextBox styling maintains visual consistency with the yellow theme. However, to ensure a cohesive user experience, consider matching the border-width with the form-control focus state.

 #filterTextBox {
-    border-color: #ffe880;
+    border-color: #ffe880;
+    border-width: 1px;
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 7e7d40d and 3ae784c.

⛔ Files ignored due to path filters (1)
  • _data/config-nav.csv is excluded by !**/*.csv
📒 Files selected for processing (7)
  • _data/translations.yml (1 hunks)
  • _includes/js/table-js.html (2 hunks)
  • _layouts/browse.html (1 hunks)
  • _layouts/cloud.html (1 hunks)
  • _layouts/list.html (1 hunks)
  • _layouts/timeline_edtf.html (1 hunks)
  • _sass/_custom.scss (1 hunks)
🔇 Additional comments (12)
_layouts/cloud.html (3)

Line range hint 35-65: LGTM! Clean integration with existing cloud functionality.

The new navigation dropdown is well-integrated with the existing cloud generation logic, maintaining clear separation of concerns.


22-30: Verify translation key availability.

Ensure that all translation keys used in this template are properly defined in _data/translations.yml.

✅ Verification successful

Translation keys are properly defined and available

The translation keys used in the template are correctly defined in the translations file. Specifically:

  • browse.html.browse is defined with translations for en/es/de
  • browse.html.timeline is defined with translations for en/es/de
  • browse.html.subjects is defined with translations for en/es/de
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the translation keys exist in translations.yml
rg -A 3 "'browse.html':" _data/translations.yml

Length of output: 55


Script:

#!/bin/bash
# Let's check if translations.yml exists and its content
fd -t f "translations.yml" _data/ --exec cat {}

# Also check for any other translation files that might contain these keys
fd -t f ".*translations.*" _data/ --exec cat {}

Length of output: 56075


8-34: Verify alignment with PR objectives regarding dropdowns.

The PR objectives mention removing dropdown menus, but this implementation adds a new dropdown for view switching. While this might be intentionally different from the navbar dropdowns being removed, we should verify this approach aligns with the intended navigation structure.

✅ Verification successful

The view-switching dropdown is consistent with the site's navigation pattern

The implementation of the view-switching dropdown in cloud.html is actually consistent with the existing pattern used across the site. The PR's objective about removing dropdown menus specifically refers to the main navigation dropdowns in collection-nav.html, while this is a different UI component used consistently for view switching in various layout templates (browse.html, timeline.html, etc.). The view switcher dropdown is a well-established pattern in this codebase that helps users navigate between different visualization modes of the same content.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other dropdown implementations to understand the navigation pattern
rg -l "dropdown-toggle|dropdown-menu" --type html

Length of output: 283


Script:

#!/bin/bash
# Let's check the content of collection-nav files to understand if dropdowns are being removed there
echo "=== collection-nav.html ==="
cat _includes/collection-nav.html
echo -e "\n=== collection-nav-sgb.html ==="
cat _includes/collection-nav-sgb.html

# Also check timeline and browse layouts to see the navigation pattern
echo -e "\n=== timeline.html ==="
cat _layouts/timeline.html
echo -e "\n=== browse.html ==="
cat _layouts/browse.html

Length of output: 15710

_layouts/browse.html (1)

36-36: LGTM: Improved visual spacing.

The added margin-top creates better vertical spacing between the search form and the results counter.

_includes/js/table-js.html (3)

30-30: LGTM! Button text change improves clarity.

The change from "exportieren" to "herunterladen" makes the action more intuitive for users.


47-52: LGTM! Export button text is more descriptive.

The addition of "exportieren" in the button text makes the action more explicit while maintaining the same functionality.


Line range hint 30-58: Verify text consistency across files.

The button text changes look good, but let's ensure consistency with translations in other files.

✅ Verification successful

Let me search for any other language variations or translations to ensure completeness.


Button text changes are consistent with existing translations

The changes are consistent with the German language interface of the application. The search results show:

  • "Tabelle" and "Sammlungsdaten" terms are already used in translations
  • The button texts follow the established German language pattern
  • No conflicting or inconsistent translations were found in other files
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistency of button labels across files
# Expected: Button labels should match in translations and templates

# Check for button text in translation files
echo "Checking translations..."
rg -i "tabelle.*herunterladen|sammlungsdaten.*exportieren|datenarchiv" _data/translations.yml

# Check for button text in other template files
echo "Checking other template files..."
rg -i "tabelle.*herunterladen|sammlungsdaten.*exportieren|datenarchiv" _includes/ _layouts/

Length of output: 546


Script:

#!/bin/bash
# Search for any other language variations of these buttons
# Including potential English translations or other language files

# Check all yml files for similar button patterns
echo "Checking all yml files..."
fd -e yml -x rg -i "table.*download|collection.*export|data.*archive|tabelle|sammlungsdaten|datenarchiv" {}

# Check for any language-specific template variations
echo "Checking template variations..."
fd -e html -x rg -i "table.*download|collection.*export|data.*archive|tabelle|sammlungsdaten|datenarchiv" {}

Length of output: 808

_layouts/list.html (2)

27-51: LGTM! Well-structured sorting dropdown implementation.

The flexbox layout with Bootstrap classes provides good alignment, and the sorting dropdown is properly implemented with accessibility considerations.


27-76: Verify mobile responsiveness of the new dropdowns.

While the implementation uses Bootstrap's responsive classes, please ensure that:

  1. Dropdowns don't overflow on small screens
  2. Buttons remain properly aligned on mobile devices
  3. Text doesn't wrap awkwardly within the buttons

Test the mobile layout with different screen sizes:

✅ Verification successful

Mobile responsiveness appears to be properly implemented

The implementation uses Bootstrap's responsive classes appropriately:

  • d-flex justify-content-between align-items-center ensures proper alignment
  • btn-outline-primary uses Bootstrap's responsive button sizing
  • dropdown-menu and dropdown-toggle use Bootstrap's built-in responsive behavior
  • mt-1 provides consistent spacing across devices
  • ms-auto handles proper margin spacing responsively

The code follows Bootstrap's mobile-first approach and will adapt well to different screen sizes without custom media queries needed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any custom mobile-specific styles that might affect these dropdowns
rg -l "[@]media.*?max-width" --type css

Length of output: 153


Script:

#!/bin/bash
# Let's check for any custom CSS that might affect these dropdowns in our project
rg -g "assets/css/*" "dropdown|button|@media" --type css -C 2

# Also check if there are any specific mobile-related styles in the main stylesheet
rg -g "assets/css/style.css" "(@media|dropdown|\.btn)" --type css -C 2

Length of output: 283


Script:

#!/bin/bash
# Let's try finding CSS files in the repository first
fd -e css

# Then check the content of any custom CSS files
rg "dropdown|button|@media" --type css

Length of output: 184858

_sass/_custom.scss (1)

97-103: Verify consistent styling across related UI components.

These styling changes appear to be part of broader UI improvements. Let's verify the styling consistency across related components.

✅ Verification successful

Let me analyze the styling changes and gather more information to verify consistency.


Styling is consistently applied across related UI components

The search results show that the #ffe880 color is used consistently throughout the codebase for:

  • Box shadows with inset style
  • Border colors
  • Background colors
  • Text/fill colors

The filter textbox styling aligns with this color scheme and the broader UI patterns. The box-shadow and border-color properties match other interactive elements using the same color value.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any inconsistent color usage or related styling patterns
rg -g "*.{scss,css}" --no-filename "box-shadow|border-color" | grep -i "#ffe880"

# Look for other filter-related styling
rg -g "*.{scss,css}" --no-filename "filter|search"

Length of output: 169653


Script:

#!/bin/bash
# Search for other instances of #ffe880 color usage
rg -g "*.{scss,css}" "#ffe880"

# Look for related focus/hover states and box-shadow styles
rg -g "*.{scss,css}" "box-shadow.*inset|:focus|:hover"

# Check for filter-related styling patterns
rg -g "*.{scss,css}" "#filterTextBox|filter-"

Length of output: 185215

_layouts/timeline_edtf.html (1)

29-34: LGTM! Clean implementation of the year range navigation.

The flexbox layout ensures proper alignment and the year range links provide efficient navigation through the timeline.

_data/translations.yml (1)

601-620: LGTM! New translations align with PR objectives.

The added translations support the PR's goal of enhancing navigation through dedicated buttons. The translations are consistent with existing patterns and cover all the new UI elements mentioned in the PR objectives:

  • Switch view functionality
  • Browse navigation
  • Timeline view
  • Subjects view
  • Eras view

_layouts/browse.html Outdated Show resolved Hide resolved
_layouts/browse.html Outdated Show resolved Hide resolved
_includes/js/table-js.html Outdated Show resolved Hide resolved
_layouts/list.html Outdated Show resolved Hide resolved
_layouts/timeline_edtf.html Outdated Show resolved Hide resolved
_layouts/timeline_edtf.html Outdated Show resolved Hide resolved
_layouts/timeline_edtf.html Outdated Show resolved Hide resolved
_data/translations.yml Outdated Show resolved Hide resolved
Copy link
Member

@maehr maehr left a comment

Choose a reason for hiding this comment

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

Hi @mtwente, thanks for your PR. It solves a lot of latent problems. Here's my 5 cents:

@mtwente
Copy link
Member Author

mtwente commented Oct 26, 2024

Like this? And on the other pages, I keep it as a dropdown and on the right side?

btn-group

@maehr
Copy link
Member

maehr commented Oct 26, 2024

Like this? And on the other pages, I keep it as a dropdown and on the right side?

btn-group

This looks great! Thank you. If possible we should keep the UX the same on timeline and subjects as well.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3ae784c and 1ae2262.

📒 Files selected for processing (6)
  • _data/translations.yml (1 hunks)
  • _includes/js/table-js.html (2 hunks)
  • _layouts/browse.html (1 hunks)
  • _layouts/cloud.html (1 hunks)
  • _layouts/list.html (1 hunks)
  • _layouts/timeline_edtf.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • _data/translations.yml
  • _includes/js/table-js.html
  • _layouts/cloud.html
  • _layouts/list.html
  • _layouts/timeline_edtf.html
🔇 Additional comments (2)
_layouts/browse.html (2)

Line range hint 72-89: LGTM! Loading and results display implementation looks good.

The implementation includes:

  • Accessible loading indicator with proper ARIA attributes
  • Translated loading text
  • Clear visual feedback for users

22-36: Verify translations for view switching options.

Following up on previous comments about missing translations, let's verify if all required translations are now available.

✅ Verification successful

All translations for view switching options are properly configured

Based on the translations file content, all the required translations for the view switching options in browse.html are properly configured:

  1. Timeline:
timeline:
  en: "Timeline"
  es: "Línea de tiempo"
  de: "Zeitachse"
  1. Subjects:
subjects:
  en: "Subjects"
  es: "Temas"
  de: "Themen"
  1. Eras:
eras:
  en: "Eras"
  es: "Épocas"
  de: "Epochen"

All these translations are properly defined under _layouts.browse.html section in the translations file and are correctly referenced in the template using site.data.translations._layouts['browse.html'] path.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check translations for view switching options
echo "Checking translations in _data/translations.yml..."
rg -A 2 "'timeline'|'subjects'|'eras'" _data/translations.yml

# Also check for any untranslated strings
echo -e "\nChecking for potential missing translations..."
for lang in en de fr es; do
  echo "Checking $lang translations..."
  rg "\\[$lang\\]" _data/translations.yml
done

Length of output: 813


Script:

#!/bin/bash
# Let's check if the translations file exists and its content
echo "Checking if translations file exists and its content:"
if [ -f "_data/translations.yml" ]; then
    cat "_data/translations.yml"
else
    echo "translations.yml not found in _data directory"
    # Let's check where translations might be stored
    fd "translations" --type f
fi

# Also check the browse.html layout for translation keys
echo -e "\nChecking browse.html for translation keys:"
cat "_layouts/browse.html"

Length of output: 31103

_layouts/browse.html Outdated Show resolved Hide resolved
_layouts/browse.html Outdated Show resolved Hide resolved
_layouts/browse.html Outdated Show resolved Hide resolved
_layouts/browse.html Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
pages/data.md (2)

9-9: Fix whitespace between sentences.

Add spaces between sentences to improve readability.

-Die Stadt.Geschichte.Basel macht projektbezogene Daten in verschiedenen Formaten zugänglich. Verfügbar sind wissenschaftliche Publikationen mit Projektbezug einerseits, sowie die Metadaten zu den auf dieser Plattform bereitgestellten Quellen und historischen Forschungsdaten andererseits.
+Die Stadt.Geschichte.Basel macht projektbezogene Daten in verschiedenen Formaten zugänglich.  Verfügbar sind wissenschaftliche Publikationen mit Projektbezug einerseits, sowie die Metadaten zu den auf dieser Plattform bereitgestellten Quellen und historischen Forschungsdaten andererseits.
🧰 Tools
🪛 LanguageTool

[whitespace] ~9-~9: Fügen Sie zwischen Sätzen ein Leerzeichen ein.
Context: ...data.html --- # Datenarchiv Die Stadt.Geschichte.Basel macht projektbezogene Daten in ve...

(DE_SENTENCE_WHITESPACE)


[whitespace] ~9-~9: Fügen Sie zwischen Sätzen ein Leerzeichen ein.
Context: ...-- # Datenarchiv Die Stadt.Geschichte.Basel macht projektbezogene Daten in verschie...

(DE_SENTENCE_WHITESPACE)


[typographical] ~9-~9: Zeichen ohne sein Gegenstück: ‚"‘ scheint zu fehlen
Context: ...erungsfreie-metadaten/){:target="_blank"} erstellt und aufbereitet worden. ## P...

(DE_UNPAIRED_QUOTES)


13-13: Consider rephrasing for better style (optional).

The phrase "im Zusammenhang mit" could be replaced with alternatives like "aus" or "zu" for more concise writing.

-Wissenschaftliche Veröffentlichungen, die im Zusammenhang mit dem Forschungsprojekt stehen,
+Wissenschaftliche Veröffentlichungen aus dem Forschungsprojekt
🧰 Tools
🪛 LanguageTool

[style] ~13-~13: Der Ausdruck ‚im Zusammenhang mit‘ kommt sehr häufig vor. Möchten Sie ihn durch eine Alternative ersetzen, um Ihren Text individueller zu machen?
Context: ...ssenschaftliche Veröffentlichungen, die im Zusammenhang mit dem Forschungsprojekt stehen, sind [auf Zenodo archiviert](ht...

(IN_ZUSAMMENHANG_MIT)


[uncategorized] ~13-~13: Hier scheint ein Satzzeichen überflüssig zu sein. Überlegen Sie, es zu löschen.
Context: ... mit dem Forschungsprojekt stehen, sind [auf Zenodo archiviert](https://zenodo.or...

(AI_DE_GGEC_UNNECESSARY_PUNCTUATION_OPEN_BRACKET)


[uncategorized] ~13-~13: Das sieht falsch aus. Überlegen Sie, es zu ersetzen.
Context: ...schungsprojekt stehen, sind auf Zenodo archiviert{:target="_blank...

(AI_DE_GGEC_REPLACEMENT_OTHER)


[typographical] ~13-~13: Zeichen ohne sein Gegenstück: ‚"‘ scheint zu fehlen
Context: ...stadt-geschichte-basel){:target="_blank"}. Die im Rahmen von Konferenzen und Wor...

(DE_UNPAIRED_QUOTES)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1ae2262 and f8cfd31.

⛔ Files ignored due to path filters (1)
  • _data/config-nav.csv is excluded by !**/*.csv
📒 Files selected for processing (7)
  • _includes/js/table-js.html (2 hunks)
  • _layouts/browse.html (1 hunks)
  • _layouts/cloud.html (1 hunks)
  • _layouts/list.html (1 hunks)
  • _layouts/timeline_edtf.html (1 hunks)
  • _sass/_custom.scss (2 hunks)
  • pages/data.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • _includes/js/table-js.html
  • _layouts/cloud.html
  • _layouts/list.html
  • _layouts/timeline_edtf.html
  • _sass/_custom.scss
🧰 Additional context used
🪛 LanguageTool
pages/data.md

[whitespace] ~9-~9: Fügen Sie zwischen Sätzen ein Leerzeichen ein.
Context: ...data.html --- # Datenarchiv Die Stadt.Geschichte.Basel macht projektbezogene Daten in ve...

(DE_SENTENCE_WHITESPACE)


[whitespace] ~9-~9: Fügen Sie zwischen Sätzen ein Leerzeichen ein.
Context: ...-- # Datenarchiv Die Stadt.Geschichte.Basel macht projektbezogene Daten in verschie...

(DE_SENTENCE_WHITESPACE)


[typographical] ~9-~9: Zeichen ohne sein Gegenstück: ‚"‘ scheint zu fehlen
Context: ...erungsfreie-metadaten/){:target="_blank"} erstellt und aufbereitet worden. ## P...

(DE_UNPAIRED_QUOTES)


[style] ~13-~13: Der Ausdruck ‚im Zusammenhang mit‘ kommt sehr häufig vor. Möchten Sie ihn durch eine Alternative ersetzen, um Ihren Text individueller zu machen?
Context: ...ssenschaftliche Veröffentlichungen, die im Zusammenhang mit dem Forschungsprojekt stehen, sind [auf Zenodo archiviert](ht...

(IN_ZUSAMMENHANG_MIT)


[uncategorized] ~13-~13: Hier scheint ein Satzzeichen überflüssig zu sein. Überlegen Sie, es zu löschen.
Context: ... mit dem Forschungsprojekt stehen, sind [auf Zenodo archiviert](https://zenodo.or...

(AI_DE_GGEC_UNNECESSARY_PUNCTUATION_OPEN_BRACKET)


[uncategorized] ~13-~13: Das sieht falsch aus. Überlegen Sie, es zu ersetzen.
Context: ...schungsprojekt stehen, sind auf Zenodo archiviert{:target="_blank...

(AI_DE_GGEC_REPLACEMENT_OTHER)


[typographical] ~13-~13: Zeichen ohne sein Gegenstück: ‚"‘ scheint zu fehlen
Context: ...stadt-geschichte-basel){:target="_blank"}. Die im Rahmen von Konferenzen und Wor...

(DE_UNPAIRED_QUOTES)

🔇 Additional comments (5)
pages/data.md (3)

2-2: LGTM: Title change appropriately reflects broader content scope.

The change from "Metadaten" to "Forschungsdaten" better represents the expanded content that now includes both publications and metadata.


17-18: LGTM: Clear and user-friendly download instructions.

The instructions for downloading and exporting metadata are well-structured and easy to follow. The separation between filtered and complete collection exports is clearly explained.


7-18: Verify integration with new navigation structure.

The content changes align well with the PR's navigation improvements. Let's verify the integration of the new button-based navigation mentioned in the PR objectives.

✅ Verification successful

Based on the gathered information, I can now generate the final response:

Navigation structure has been properly implemented

The content changes in data.md are properly integrated with the new navigation structure. The navigation configuration shows "Daten" is implemented as a top-level link (/data.html) without dropdown menus, aligning with the PR's objective of simplifying navigation. The page is accessible through standard button-based navigation as evidenced by the implementation in _includes/collection-nav-sgb.html and _includes/collection-nav.html.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the implementation of related navigation elements

# Check for button implementations in related templates
echo "Checking for button implementations in related templates:"
rg -l "Datenarchiv" "_includes/" "_layouts/"

# Check for removed dropdown references
echo "Checking for any remaining dropdown references:"
rg -l "dropdown.*Datenarchiv" "_includes/" "_layouts/"

Length of output: 323


Script:

#!/bin/bash
# Let's try a broader search to understand the navigation structure

# Check for navigation-related files
echo "Navigation-related files:"
fd -t f "nav|menu|header" "_includes/" "_layouts/"

# Look for any navigation implementation files
echo -e "\nChecking navigation implementation:"
rg -l "navigation|menu" "_includes/" "_layouts/"

# Search for Datenarchiv references in all template files
echo -e "\nBroader search for Datenarchiv in all template files:"
fd . "_includes/" "_layouts/" -t f --exec rg -l "Datenarchiv" {}

# Check if there are any remaining dropdown implementations
echo -e "\nChecking for any dropdown implementations:"
rg -l "dropdown|pulldown" "_includes/" "_layouts/"

Length of output: 1149


Script:

#!/bin/bash
# Let's examine the dropdown implementations and navigation structure more closely

# Check the content of collection navigation files
echo "Content of collection-nav-sgb.html:"
cat "_includes/collection-nav-sgb.html"

echo -e "\nContent of collection-nav.html:"
cat "_includes/collection-nav.html"

# Look for specific dropdown usage related to Datenarchiv
echo -e "\nChecking dropdown usage with Datenarchiv context:"
rg -A 5 -B 5 "dropdown.*Datenarchiv|Datenarchiv.*dropdown" "_includes/" "_layouts/"

# Check for button implementations in list layout
echo -e "\nChecking list layout implementation:"
cat "_layouts/list.html"

Length of output: 11873


Script:

#!/bin/bash
# Let's check the navigation configuration to see how Datenarchiv is integrated

# Check the navigation configuration
echo "Checking navigation configuration:"
cat "_data/config-nav.yml"

# Look for any references to data or archive pages
echo -e "\nChecking for data/archive page references:"
rg -l "data|archiv" "_data/"

# Check for button implementations specific to data pages
echo -e "\nChecking for data-related button implementations:"
rg "btn.*data|data.*btn" "_includes/" "_layouts/"

Length of output: 4109


Script:

#!/bin/bash
# Let's check the CSV navigation configuration and translations

# Check the navigation configuration CSV
echo "Checking navigation configuration CSV:"
cat "_data/config-nav.csv"

# Check translations related to data archive
echo -e "\nChecking translations for data archive:"
cat "_data/translations.yml"

# Check theme configuration
echo -e "\nChecking theme configuration:"
cat "_data/theme.yml"

Length of output: 35798

🧰 Tools
🪛 LanguageTool

[whitespace] ~9-~9: Fügen Sie zwischen Sätzen ein Leerzeichen ein.
Context: ...data.html --- # Datenarchiv Die Stadt.Geschichte.Basel macht projektbezogene Daten in ve...

(DE_SENTENCE_WHITESPACE)


[whitespace] ~9-~9: Fügen Sie zwischen Sätzen ein Leerzeichen ein.
Context: ...-- # Datenarchiv Die Stadt.Geschichte.Basel macht projektbezogene Daten in verschie...

(DE_SENTENCE_WHITESPACE)


[typographical] ~9-~9: Zeichen ohne sein Gegenstück: ‚"‘ scheint zu fehlen
Context: ...erungsfreie-metadaten/){:target="_blank"} erstellt und aufbereitet worden. ## P...

(DE_UNPAIRED_QUOTES)


[style] ~13-~13: Der Ausdruck ‚im Zusammenhang mit‘ kommt sehr häufig vor. Möchten Sie ihn durch eine Alternative ersetzen, um Ihren Text individueller zu machen?
Context: ...ssenschaftliche Veröffentlichungen, die im Zusammenhang mit dem Forschungsprojekt stehen, sind [auf Zenodo archiviert](ht...

(IN_ZUSAMMENHANG_MIT)


[uncategorized] ~13-~13: Hier scheint ein Satzzeichen überflüssig zu sein. Überlegen Sie, es zu löschen.
Context: ... mit dem Forschungsprojekt stehen, sind [auf Zenodo archiviert](https://zenodo.or...

(AI_DE_GGEC_UNNECESSARY_PUNCTUATION_OPEN_BRACKET)


[uncategorized] ~13-~13: Das sieht falsch aus. Überlegen Sie, es zu ersetzen.
Context: ...schungsprojekt stehen, sind auf Zenodo archiviert{:target="_blank...

(AI_DE_GGEC_REPLACEMENT_OTHER)


[typographical] ~13-~13: Zeichen ohne sein Gegenstück: ‚"‘ scheint zu fehlen
Context: ...stadt-geschichte-basel){:target="_blank"}. Die im Rahmen von Konferenzen und Wor...

(DE_UNPAIRED_QUOTES)

_layouts/browse.html (2)

8-40: Well-structured navigation implementation!

The new button group implementation is clean and follows best practices:

  • Proper responsive classes with flex-wrap
  • Consistent button styling
  • Localized button text
  • Clear navigation structure

73-74: LGTM!

The loading indicator and results container implementation is clean and accessible.

_layouts/browse.html Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
_layouts/browse.html (1)

51-58: Consider adding a search icon to improve UX.

The search button could benefit from a visual indicator. Consider adding a search icon alongside the text.

 <button
   class="btn btn-secondary"
   type="submit"
   title="{{ site.data.translations['_layouts']['browse.html']['filter-items'][site.lang] | default: 'Filter items' }}"
   id="filterButton"
 >
+  <i class="fas fa-search me-1" aria-hidden="true"></i>
   {{ site.data.translations._layouts['browse.html'].search[site.lang] | default: 'Search' }}
 </button>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f8cfd31 and 540c9f6.

📒 Files selected for processing (1)
  • _layouts/browse.html (1 hunks)
🔇 Additional comments (3)
_layouts/browse.html (3)

11-16: LGTM! Button group structure follows best practices.

The button group implementation uses proper semantic HTML with appropriate ARIA roles and Bootstrap classes for layout and responsiveness.


73-74: LGTM! Loading indicator implementation is accessible.

The loading spinner implementation follows accessibility best practices with proper ARIA attributes and visually-hidden text.

Also applies to: 76-84


22-22: Verify all required translations exist.

Let's ensure all translation keys used in this file are properly defined in the translations file.

Also applies to: 29-29, 36-36, 48-48, 49-49, 54-54, 57-57, 65-65

✅ Verification successful

The previous script didn't capture all translation keys correctly. Let's modify our approach to better detect the translation patterns:


We've identified the translation keys used in browse.html, but we need to verify their existence in translations.yml. Let's try a different approach:


Let's try one final approach to check if the translations file exists and verify its content:


All required translations for browse.html are present and properly defined

After examining the translations.yml file, I can confirm that all the translation keys used in browse.html are properly defined under _layouts/browse.html: section, including:

  • timeline
  • eras
  • loading
  • reset
  • search
  • subjects

Each key has translations for multiple languages (en, es, de) and is properly structured within the YAML file.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all required translations exist in translations.yml
# Expected: All translation keys should be present for all supported languages

echo "Checking for required translation keys..."
rg --no-filename "browse\.html'\.(\w+)\[" _layouts/browse.html | sort -u | while read -r match; do
  key=$(echo "$match" | sed -E "s/.*browse\.html'\.(\w+)\[.*/\1/")
  echo "Checking key: $key"
  rg -A 1 "browse\.html:(\s+)?$key:" _data/translations.yml
done

Length of output: 186


Script:

#!/bin/bash
# Get all translation keys used in browse.html
echo "Translation keys used in browse.html:"
rg "site\.data\.translations\._layouts\['browse\.html'\]\.([\w.]+)" -o --no-filename _layouts/browse.html | sed -E "s/.*'browse\.html'\]\.([^[]+).*/\1/" | sort -u

echo -e "\nChecking translations.yml content for browse.html:"
cat _data/translations.yml | grep -A 5 "_layouts/browse.html:"

Length of output: 485


Script:

#!/bin/bash
# Check each translation key individually
echo "Checking individual translation keys in translations.yml:"
for key in "timeline" "eras" "loading" "reset" "search" "subjects"; do
    echo -e "\nChecking key: $key"
    rg "_layouts/browse\.html:(\s+)?$key:" _data/translations.yml -A 2
done

# Also check the overall structure
echo -e "\nChecking browse.html section in translations.yml:"
rg "_layouts/browse\.html:" _data/translations.yml -A 10

Length of output: 1486


Script:

#!/bin/bash
# First check if the translations file exists
echo "Checking if translations file exists:"
ls -l _data/translations.yml

echo -e "\nChecking content of translations file:"
cat _data/translations.yml

echo -e "\nChecking directory structure:"
ls -R _data/

Length of output: 28442

Copy link

@koilebeit koilebeit left a comment

Choose a reason for hiding this comment

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

I like it!! It's much better than before (everything in the main nav)

But we should have some kind of dropdown button on the timeline to jump to certain points in time, otherwise you scroll forever. But that can be a separate issue/pr

Copy link
Member

@maehr maehr left a comment

Choose a reason for hiding this comment

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

Thanks again for the changes. Here are some minor remarks:

  • The buttons are sized differently on browse vs cloud, list and timeline_edtf
  • The button group should have the same order on all pages
  • The button group should have 4 elements, i.e. links to browse, cloud, list and timeline_edtf, on all pages
  • The button group should indicate which button is active (aria and visually)

Thanks again. I really like it!

@mtwente
Copy link
Member Author

mtwente commented Oct 30, 2024

  • The buttons are sized differently on browse vs cloud, list and timeline_edtf

I made the buttons bigger on browse so it aligns with the search bar. Smaller buttons on browse look like they're detached from the rest of the content (as with the dropdown-button to the right in the current version of the page). On the other pages, I found large buttons to be too much.

I could change the search bar from large to small.

  • The button group should have 4 elements, i.e. links to browse, cloud, list and timeline_edtf, on all pages
  • The button group should have the same order on all pages

They do have the same order (Browse/Timeline/List/Eras), it's just that the active page/view is not shown as button (heading only). If I put all four buttons next to each other on all pages, it takes away quite a lot of space (especially on browse, there is very little space left for the search bar). That's also why I removed the button for the active view.

I could try moving the four buttons on their own row, stretch them across the whole page and have the search box below as-is, but that just creates oversized buttons.

But we should have some kind of dropdown button on the timeline to jump to certain points in time, otherwise you scroll forever. But that can be a separate issue/pr

The dropdown menu (in its current status) is not that different from scrolling for ages, is it? Especially if we have more content for the stone age etc. Then it does not help to increase the dropdown-menu to show centuries only, it will still be a long menu.

@mtwente
Copy link
Member Author

mtwente commented Oct 31, 2024

Here are a few visual modifications:

Medium-sized buttons, to the left.
This way, the btn-group is vertically aligned with the filter box, but not with the btn-groups on the other pages.
btn-md-left

Large-sized buttons, to the left.
btn-lg-left

Medium-sized buttons, stretched on top.
btn-md-stretch

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
_layouts/browse.html (2)

52-58: Enhance search input accessibility.

While the input has basic ARIA support, consider adding aria-controls="browseItems" to better indicate what the search affects.

         <input
           type="text"
           class="form-control flex-nowrap"
           id="filterTextBox"
+          aria-controls="browseItems"
           placeholder="{{ site.data.translations['_layouts']['browse.html']['filter'][site.lang] | default: 'Filter' }} ..."
           aria-label="{{ site.data.translations['_layouts']['browse.html']['search'][site.lang] | default: 'Search' }}"
         >

82-88: Enhance loading state feedback.

Consider adding ARIA live regions to announce loading state changes to screen readers.

-  <div id="loadingIcon" class="text-center">
+  <div id="loadingIcon" class="text-center" aria-live="polite">
     <div class="spinner-border text-dark" role="status">
       <span class="visually-hidden">
         {{- site.data.translations._layouts['browse.html'].loading[site.lang] | default: 'Loading' }}...</span
       >
     </div>
   </div>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 540c9f6 and cebae16.

📒 Files selected for processing (9)
  • _data/translations.yml (1 hunks)
  • _layouts/browse.html (1 hunks)
  • _layouts/cloud.html (1 hunks)
  • _layouts/list.html (1 hunks)
  • _layouts/timeline_edtf.html (1 hunks)
  • _sass/_custom.scss (3 hunks)
  • pages/eras.md (1 hunks)
  • pages/subjects.md (1 hunks)
  • pages/timeline.md (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • pages/eras.md
  • pages/subjects.md
  • pages/timeline.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • _data/translations.yml
  • _layouts/cloud.html
  • _layouts/list.html
  • _layouts/timeline_edtf.html
  • _sass/_custom.scss

_layouts/browse.html Outdated Show resolved Hide resolved
_layouts/browse.html Show resolved Hide resolved
Copy link
Member

@maehr maehr left a comment

Choose a reason for hiding this comment

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

@mtwente Thanks again for the improvement. On mobile we still run into problems (I also tested it on my native device)

savage-poltergeist-g4r44g9gr6p2w4gg-4000 app github dev_browse html(iPhone 12 Pro)

pages/data.md Show resolved Hide resolved
@mtwente
Copy link
Member Author

mtwente commented Nov 2, 2024

@mtwente Thanks again for the improvement. On mobile we still run into problems (I also tested it on my native device)

Yes, I was just trying a few different solutions for that!

@mtwente mtwente requested review from koilebeit and maehr November 4, 2024 17:17
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (3)
_layouts/browse.html (1)

91-97: Consider enhancing loading state management.

While the loading spinner implementation is accessible, consider adding ARIA live regions to announce loading state changes to screen readers.

Add this attribute to improve accessibility:

-  <div id="loadingIcon" class="text-center">
+  <div id="loadingIcon" class="text-center" aria-live="polite">
_sass/_custom.scss (2)

248-252: Consider adding ARIA roles for better accessibility.

The layout styling looks good, but consider adding appropriate ARIA roles to enhance accessibility for these interactive elements.

Add these attributes to the respective HTML elements:

<div class="pagination-controls" role="navigation" aria-label="Pagination">
<div class="search-box" role="search">

254-303: Consider optimizing the responsive styles.

While the implementation works well, there are opportunities for optimization:

  1. Consider using CSS custom properties for repeated values like border radius and colors
  2. The active state styles could be consolidated

Here's how you could optimize the code:

/* At the top of the file */
:root {
  --border-radius: .25rem;
  --color-primary: #3a1e3e;
  --color-accent: #ffe880;
}

/* Then in your media queries */
#switch-view {
  .btn {
    &.active {
      color: var(--color-accent);
      
      &:not(.btn-group-vertical .btn) {
        border-radius: var(--border-radius) 0 var(--border-radius) 0;
      }
    }
    
    &:nth-last-child(2) {
      border-radius: 0 var(--border-radius) var(--border-radius) var(--border-radius);
    }
  }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between cebae16 and 603305f.

📒 Files selected for processing (7)
  • _data/translations.yml (1 hunks)
  • _includes/js/switch-view-js.html (1 hunks)
  • _layouts/browse.html (1 hunks)
  • _layouts/cloud.html (1 hunks)
  • _layouts/list.html (2 hunks)
  • _layouts/timeline_edtf.html (2 hunks)
  • _sass/_custom.scss (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • _data/translations.yml
  • _layouts/cloud.html
  • _layouts/list.html
  • _layouts/timeline_edtf.html
🔇 Additional comments (6)
_includes/js/switch-view-js.html (1)

1-26: Verify integration with layout files.

Let's ensure this script is properly integrated with all relevant layout files and that the required elements are present.

✅ Verification successful

Integration verified across layout files

The script is properly integrated and consistent across all relevant layout files:

  • All 4 layout files (_layouts/browse.html, _layouts/list.html, _layouts/cloud.html, _layouts/timeline_edtf.html) include the switch-view-js.html script
  • Each layout file has the required 'switch-view' element with matching structure:
    • Consistent ID attribute
    • Matching Bootstrap classes (btn-group, btn-group-toggle, d-flex)
    • Same data-toggle and role attributes
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify integration of switch-view-js.html and presence of required elements

echo "Checking for switch-view-js.html inclusion in layouts:"
rg -l 'switch-view-js.html' '_layouts/'

echo -e "\nChecking for 'switch-view' element in layout files:"
rg -l 'id="switch-view"' '_layouts/'

echo -e "\nChecking button group structure:"
rg -A 5 'id="switch-view"' '_layouts/'

Length of output: 1823

_layouts/browse.html (2)

59-85: LGTM! Search form implementation is well structured.

The form implementation shows good practices:

  • Proper event handling with preventDefault
  • Accessible input group with appropriate ARIA labels
  • Reset functionality with proper button type

48-54: Clarify the purpose of the toggle button.

The toggle button's purpose is not immediately clear from its label "Switch View". Consider:

  1. Adding a more descriptive label that indicates what views are being toggled
  2. Including a tooltip to explain the functionality

Let's check how the toggle functionality is implemented:

_sass/_custom.scss (3)

93-98: LGTM! Improved form control focus state.

The inset shadow provides better visual feedback while maintaining the theme's color scheme.


102-106: LGTM! Consistent search input styling.

The styling matches the theme's color scheme and maintains consistent border radius.


155-162: LGTM! Clear visual feedback for button states.

The styling provides clear visual distinction for active states while maintaining clean button group appearance.

_includes/js/switch-view-js.html Outdated Show resolved Hide resolved
_includes/js/switch-view-js.html Outdated Show resolved Hide resolved
Copy link

@koilebeit koilebeit left a comment

Choose a reason for hiding this comment

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

Thank you for your great work

Copy link
Member

@maehr maehr left a comment

Choose a reason for hiding this comment

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

As discussed over the phone: Great PR, fix the localization either in this or in separate PR. If separate PR please open an issue.
cheers moritz

_includes/js/table-js.html Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (2)
_includes/js/table-js.html (2)

30-30: Enhance accessibility of DataTable controls.

While the flexbox layout improves visual organization, consider adding ARIA labels to improve screen reader navigation.

-dom: 'B<"d-flex justify-content-between align-items-center flex-nowrap mt-2"<"pagination-controls"l><"search-box"f>>t<"row"<"col-md-6"i><"col-md-6"p>>',
+dom: 'B<"d-flex justify-content-between align-items-center flex-nowrap mt-2"<"pagination-controls" role="navigation" aria-label="Results per page"l><"search-box" role="search"f>>t<"row"<"col-md-6"i><"col-md-6" role="navigation" aria-label="Pagination"p>>',

Line range hint 50-55: Add error handling for modal interaction.

Consider adding error handling for the modal interaction to gracefully handle cases where the modal fails to load or initialize.

 {
     text: '{{ more_exports }}',
     action: function ( e, dt, node, config ) {
-            $('#dataModal').modal('show');
+            try {
+                const modal = $('#dataModal');
+                if (modal.length === 0) {
+                    console.error('Modal element not found');
+                    return;
+                }
+                modal.modal('show').on('shown.bs.modal', function () {
+                    $(this).find('[data-focus-first]').focus();
+                });
+            } catch (error) {
+                console.error('Failed to show modal:', error);
+            }
         },
     className: 'btn btn-outline-primary'
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 603305f and 2c28d4c.

📒 Files selected for processing (2)
  • _data/translations.yml (2 hunks)
  • _includes/js/table-js.html (2 hunks)
🔇 Additional comments (2)
_includes/js/table-js.html (1)

3-6: Verify translation keys exist in translations.yml.

The code assumes the existence of specific translation keys. Let's verify they are properly defined.

✅ Verification successful

Let me verify the actual content of the translations to ensure they are properly defined with values.


Translation keys are properly defined with appropriate values

All required translation keys (download, filtered_metadata_excel, filtered_metadata_csv, more_exports) are present in _data/translations.yml with translations for English (en), Spanish (es), and German (de) languages. The default values in the code match the English translations, providing proper fallback behavior.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that all required translation keys exist in translations.yml

# Test: Check if all required translation keys are present
echo "Checking for required translation keys..."
rg -A 10 "table-js\.html:" "_data/translations.yml" | rg -q "download:|filtered_metadata_excel:|filtered_metadata_csv:|more_exports:" && echo "✓ All required translation keys found" || echo "✗ Missing translation keys"

Length of output: 311


Script:

#!/bin/bash
# Show the actual content of the translations for table-js.html
rg -A 15 "table-js\.html:" "_data/translations.yml"

Length of output: 544

_data/translations.yml (1)

429-444: LGTM! Download-related translations are complete.

The translations for download-related terms are properly implemented across all three languages (English, Spanish, and German) with consistent formatting.

_includes/js/table-js.html Outdated Show resolved Hide resolved
_data/translations.yml Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (4)
_includes/js/switch-view-js.html (2)

18-24: Add TypeScript-style documentation for better maintainability.

The debounce implementation would benefit from explicit documentation.

Add JSDoc documentation:

+/**
+ * Creates a debounced version of a function.
+ * @template T
+ * @param {(...args: any[]) => T} fn - The function to debounce
+ * @param {number} delay - The delay in milliseconds
+ * @returns {(...args: any[]) => void} - The debounced function
+ */
 const debounce = (fn, delay) => {

39-39: Add initial layout setup and cleanup.

The resize handler should run on initial load and clean up on page unload.

Apply this diff:

 window.addEventListener('resize', debounce(handleResize, 250));
+
+// Initial layout setup
+handleResize();
+
+// Cleanup
+window.addEventListener('unload', () => {
+  window.removeEventListener('resize', handleResize);
+});
_layouts/browse.html (2)

10-16: Consider enhancing mobile responsiveness.

While the button group layout looks good, it might benefit from additional responsive classes for better mobile display:

-    <div class="col-12 col-md-auto text-center text-md-center mb-2 mb-lg-0">
+    <div class="col-12 col-md-auto text-center text-md-center mb-3 mb-lg-0">
       <div
         id="switch-view"
-        class="btn-group btn-group-toggle d-flex justify-content-center"
+        class="btn-group btn-group-toggle d-flex justify-content-center flex-wrap gap-2"
         data-toggle="buttons"
         role="group"

74-81: Consider more intuitive mobile visibility class.

The reset button uses d-none d-sm-flex which hides it on extra small screens. Consider using a more intuitive approach:

-            class="btn btn-outline-secondary text-dark filter d-none d-sm-flex"
+            class="btn btn-outline-secondary text-dark filter d-none d-sm-inline-block"

This change makes the button's visibility behavior more predictable and consistent with typical Bootstrap patterns.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 16d0b5b and 4435f70.

📒 Files selected for processing (6)
  • _includes/js/switch-view-js.html (1 hunks)
  • _includes/js/table-js.html (2 hunks)
  • _layouts/browse.html (1 hunks)
  • _layouts/cloud.html (1 hunks)
  • _layouts/list.html (1 hunks)
  • _layouts/timeline_edtf.html (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • _includes/js/table-js.html
  • _layouts/cloud.html
  • _layouts/list.html
  • _layouts/timeline_edtf.html
🔇 Additional comments (3)
_includes/js/switch-view-js.html (1)

5-15: Previous review comment is still applicable.

The suggested improvements for the toggleButtonView function from the previous review remain relevant.

_layouts/browse.html (2)

91-99: LGTM! Well-implemented loading indicator.

The loading indicator implementation is excellent with proper:

  • Semantic HTML structure
  • Accessibility attributes
  • Translation support
  • Visual feedback

47-51: Verify the toggleButtonView implementation.

The toggleButtonView function is called but its implementation is not immediately visible. Let's verify its existence and implementation.

✅ Verification successful

The toggleButtonView implementation is properly implemented and used correctly

The function is well-implemented in _includes/js/switch-view-js.html with proper:

  • Null checks for the switch-view element
  • Bootstrap class toggling for vertical/horizontal layouts
  • Button visibility management
  • Responsive behavior with debounced window resize handling
  • Integration across multiple layout files
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for toggleButtonView implementation
echo "Searching for toggleButtonView implementation..."
rg -A 5 "function toggleButtonView" _includes/js/

Length of output: 517


Script:

#!/bin/bash
# Let's check the complete implementation and usage context
echo "Checking the complete switch-view-js.html file..."
cat _includes/js/switch-view-js.html

echo -e "\nChecking where this JS file is included..."
rg -l "switch-view-js.html" _layouts/

Length of output: 1529

_includes/js/switch-view-js.html Show resolved Hide resolved
_includes/js/switch-view-js.html Outdated Show resolved Hide resolved
@mtwente mtwente merged commit 6fd1525 into Stadt-Geschichte-Basel:main Nov 6, 2024
3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 13, 2024
7 tasks
@mtwente mtwente mentioned this pull request Nov 18, 2024
7 tasks
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.

Remove sorting by date on the browse page Enhance Navbar
3 participants