Skip to content

update table with new styles#599

Merged
GeorgeGoodall-GovUk merged 2 commits into
mainfrom
598-update-table-with-new-styles
Oct 31, 2024
Merged

update table with new styles#599
GeorgeGoodall-GovUk merged 2 commits into
mainfrom
598-update-table-with-new-styles

Conversation

@GeorgeGoodall-GovUk
Copy link
Copy Markdown
Contributor

@GeorgeGoodall-GovUk GeorgeGoodall-GovUk commented Oct 29, 2024

What type of PR is this? (check all applicable)

  • Refactor

Description

Updates the style of the table, including making the table heading sticky

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

view any page with a table and ensure the style's are correct

Added/updated tests?

No

Summary by CodeRabbit

  • New Features

    • Introduced new styling classes for enhanced table and scrollable container layouts.
    • Added functionality for error indication in table cells.
  • Improvements

    • Enhanced HTML structure for table rendering, improving content display and error handling.

@GeorgeGoodall-GovUk GeorgeGoodall-GovUk linked an issue Oct 29, 2024 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 29, 2024

Walkthrough

The changes in this pull request introduce new CSS classes and styles to enhance the layout and appearance of tables and scrollable elements in the application. Specifically, new classes such as .dl-scrollable and .dl-table are added to the SCSS file, defining properties for horizontal and vertical scrolling. The HTML structure of the table component is also modified to incorporate these classes, along with updates to the logic for rendering cell content, improving the overall functionality and styling of the tables.

Changes

File Change Summary
src/assets/scss/index.scss Added new classes: .dl-scrollable, .dl-table, .dl-table__head, .dl-table__header, .dl-table__cell--error.
src/views/components/table.html Updated class attributes for <div> and <table>; modified <th> elements; introduced cellText for cell content handling.

Assessment against linked issues

Objective Addressed Explanation
Update table with new styles (#598)

Poem

In a world of tables, neat and bright,
New styles emerge, a splendid sight.
Scrollable wonders, headers that gleam,
With every change, we build our dream!
Hoppy times await, let’s take a leap,
For in our code, the magic runs deep! 🐇✨


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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 29, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 62.3% 3539 / 5680
🔵 Statements 62.3% 3539 / 5680
🔵 Functions 65.5% 150 / 229
🔵 Branches 81.08% 420 / 518
File CoverageNo changed files found.
Generated in workflow #125 for commit 8942d0c by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

@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: 5

🧹 Outside diff range and nitpick comments (2)
src/views/components/table.html (2)

4-6: LGTM! Consider adding ARIA attributes for better accessibility.

The structure looks good with proper class naming following BEM methodology. The scrollable container implementation is a standard pattern.

Consider adding these ARIA attributes to improve accessibility:

-    <div class="app-scrollable-container dl-scrollable">
+    <div class="app-scrollable-container dl-scrollable" role="region" aria-label="Scrollable table">

19-26: Consider adding defensive checks for undefined values.

While the current implementation handles HTML content well, it could benefit from additional null checks.

Consider this more defensive approach:

-    {% set cellText = columnData.html | safe if columnData.html else columnData.value%}
+    {% set cellText = columnData.html | safe if columnData and columnData.html else (columnData.value if columnData else '') %}

This change would prevent potential errors if columnData is undefined.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 124c853 and 3d25be6.

📒 Files selected for processing (2)
  • src/assets/scss/index.scss (1 hunks)
  • src/views/components/table.html (2 hunks)
🔇 Additional comments (2)
src/views/components/table.html (2)

9-9: LGTM! Header implementation follows accessibility best practices.

The table header implementation maintains proper accessibility with the scope attribute while incorporating the new styling class.


Line range hint 4-26: Verify cross-browser compatibility and responsive behaviour.

Since this implements sticky table headers and scrollable containers, please ensure:

  1. The sticky header works correctly in all supported browsers
  2. The table remains usable on mobile devices
  3. The scrollable behaviour functions properly with varying content lengths

Comment thread src/assets/scss/index.scss
Comment thread src/assets/scss/index.scss
Comment thread src/assets/scss/index.scss
Comment thread src/assets/scss/index.scss
Comment thread src/assets/scss/index.scss
@eveleighoj eveleighoj temporarily deployed to submit-pr-599 October 30, 2024 14:14 Inactive
@GeorgeGoodall-GovUk GeorgeGoodall-GovUk merged commit 424050d into main Oct 31, 2024
@rosado rosado deleted the 598-update-table-with-new-styles branch October 31, 2024 10:26
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.

Update table with new styles

4 participants