Skip to content

Conversation

@sean-zlai
Copy link
Contributor

@sean-zlai sean-zlai commented Feb 26, 2025

Summary

  • Improve code organization
    • rename ActionButtons to SortButton (only remaining use case)
    • move PageHeader out of EntityTable and into page
    • remove Entity.ts nesting
  • Update Learn button href based on conf/entity type (ex. Join goes to applicable page for both list and individual entity)
  • Rename Distributions to Summary tab/route (feedback from meeting, and uses getColumnSummary() API)
  • Sort default metric (PSI) first
  • Fix resetting zoom by clicking on chart (without drag)

Checklist

  • Added Unit Tests
  • Covered by existing CI
  • Integration tested
  • Documentation update

Summary by CodeRabbit

  • New Features

    • Chart Controls: Now feature a streamlined interface with a dedicated sort button replacing extra action buttons.
    • Drift Metrics: Display metrics in a sorted order with the default metric prioritized.
    • Entity Tables: Automatically derive header labels for clearer data presentation.
    • Page Headers: Now support an optional "Learn More" link to guide users to additional resources.
    • Navigation & Summary Views: Updated tabs and layouts now emphasize "Summary" data with column summaries.
    • Entity Configurations: Enhanced to include resource links for further learning.
  • Bug Fixes

    • Improved error handling in data retrieval processes for better user experience.
  • Documentation

    • Updated documentation to reflect changes in entity configurations and navigation structures.

@sean-zlai sean-zlai marked this pull request as draft February 26, 2025 22:04
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2025

Walkthrough

This pull request standardizes import paths for entity types and updates various UI components. It simplifies component interfaces by removing obsolete props and functions, introduces sorting mechanisms and dynamic linking via a new property in the header, and renames several variables to reflect a shift from "distributions" to "summary". Overall, the changes adjust module organization and enhance component clarity without altering core functionality.

Changes

File(s) Change Summary
frontend/src/lib/api/utils.ts, frontend/src/lib/components/ExpandableCell.svelte, frontend/src/lib/components/NavigationBar.svelte, frontend/src/lib/job/tree-builder/tree-builder.ts, frontend/src/lib/types/LogicalNode.ts, frontend/src/routes/+layout.svelte, frontend/src/routes/[conf]/+page.server.ts, frontend/src/routes/[conf]/[name]/+layout.ts, frontend/src/routes/[conf]/[name]/overview/+page.svelte, frontend/src/routes/[conf]/[name]/overview/EntityProperties.svelte Updated import paths to use generalized module locations for entity types/configuration.
frontend/src/lib/components/ChartControls.svelte, frontend/src/lib/components/DriftMetricToggle.svelte, frontend/src/lib/components/EntityTable.svelte, frontend/src/lib/components/PageHeader.svelte, frontend/src/lib/components/SortButton.svelte, frontend/src/lib/components/ObservabilityNavTabs.svelte Removed obsolete props/components; added SortButton and dynamic learnHref; restructured UI rendering logic.
frontend/src/routes/[conf]/[name]/observability/drift/+page.svelte, frontend/src/routes/[conf]/[name]/observability/summary/+page.svelte, frontend/src/routes/[conf]/[name]/observability/summary/+page.ts Renamed variables (e.g., distributions → columnSummaries) and updated context to "summary"; clarified brush event handling.
frontend/src/lib/types/Entity.ts Added new learnHref property for various entity types for documentation linking.
frontend/src/lib/util/sort.ts Updated SortContext type: replaced "distributions" with "summary".
frontend/src/routes/[conf]/+page.svelte, frontend/src/routes/[conf]/[name]/+layout.svelte Enhanced layout with a new header and separator; integrated dynamic learnHref via getEntityType.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PageHeader
    participant EntityConfig
    User->>PageHeader: Load page
    PageHeader->>EntityConfig: Retrieve learnHref based on entity type
    EntityConfig-->>PageHeader: Return URL
    User->>PageHeader: Click "Learn" button
    PageHeader->>User: Navigate to URL
Loading
sequenceDiagram
    participant User
    participant DriftMetricToggle
    participant sortFunc
    User->>DriftMetricToggle: Open metrics view
    DriftMetricToggle->>sortFunc: Request sorted metrics
    sortFunc-->>DriftMetricToggle: Return sorted list (PSI prioritized)
    DriftMetricToggle->>User: Render sorted metric buttons
Loading

Possibly related PRs

Suggested reviewers

  • ken-zlai

Poem

In code refined with paths aligned,
Old props shed, new links defined,
Sorting flows through metrics bright,
Headers gleam with learnHref light,
A joyful tune in ASCII rhyme! 🎶

Warning

Review ran into problems

🔥 Problems

GitHub Actions and Pipeline Checks: Resource not accessible by integration - https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository.

Please grant the required permissions to the CodeRabbit GitHub App under the organization or repository settings.


🪧 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.

@sean-zlai sean-zlai requested a review from ken-zlai February 27, 2025 15:13
@sean-zlai sean-zlai marked this pull request as ready for review February 27, 2025 15:13
@sean-zlai sean-zlai force-pushed the sean/ui-simplifications branch from 30dcc86 to 2208ba3 Compare February 27, 2025 15:13
Copy link
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 1aa8118 and 2208ba3.

📒 Files selected for processing (23)
  • frontend/src/lib/api/utils.ts (1 hunks)
  • frontend/src/lib/components/ChartControls.svelte (2 hunks)
  • frontend/src/lib/components/DriftMetricToggle.svelte (1 hunks)
  • frontend/src/lib/components/EntityTable.svelte (2 hunks)
  • frontend/src/lib/components/ExpandableCell.svelte (1 hunks)
  • frontend/src/lib/components/NavigationBar.svelte (1 hunks)
  • frontend/src/lib/components/PageHeader.svelte (2 hunks)
  • frontend/src/lib/components/SortButton.svelte (2 hunks)
  • frontend/src/lib/job/tree-builder/tree-builder.ts (1 hunks)
  • frontend/src/lib/types/Entity.ts (1 hunks)
  • frontend/src/lib/types/LogicalNode.ts (1 hunks)
  • frontend/src/lib/util/sort.ts (1 hunks)
  • frontend/src/routes/+layout.svelte (1 hunks)
  • frontend/src/routes/[conf]/+page.server.ts (1 hunks)
  • frontend/src/routes/[conf]/+page.svelte (1 hunks)
  • frontend/src/routes/[conf]/[name]/+layout.svelte (2 hunks)
  • frontend/src/routes/[conf]/[name]/+layout.ts (1 hunks)
  • frontend/src/routes/[conf]/[name]/observability/ObservabilityNavTabs.svelte (1 hunks)
  • frontend/src/routes/[conf]/[name]/observability/drift/+page.svelte (4 hunks)
  • frontend/src/routes/[conf]/[name]/observability/summary/+page.svelte (3 hunks)
  • frontend/src/routes/[conf]/[name]/observability/summary/+page.ts (2 hunks)
  • frontend/src/routes/[conf]/[name]/overview/+page.svelte (1 hunks)
  • frontend/src/routes/[conf]/[name]/overview/EntityProperties.svelte (1 hunks)
✅ Files skipped from review due to trivial changes (11)
  • frontend/src/routes/+layout.svelte
  • frontend/src/lib/types/LogicalNode.ts
  • frontend/src/lib/components/ExpandableCell.svelte
  • frontend/src/routes/[conf]/[name]/+layout.ts
  • frontend/src/routes/[conf]/[name]/overview/EntityProperties.svelte
  • frontend/src/routes/[conf]/[name]/observability/summary/+page.ts
  • frontend/src/routes/[conf]/+page.server.ts
  • frontend/src/lib/job/tree-builder/tree-builder.ts
  • frontend/src/lib/components/NavigationBar.svelte
  • frontend/src/lib/api/utils.ts
  • frontend/src/routes/[conf]/[name]/overview/+page.svelte
🔇 Additional comments (39)
frontend/src/routes/[conf]/[name]/observability/ObservabilityNavTabs.svelte (1)

14-16: Tab name change matches PR objectives.

The renaming from "Distributions" to "Summary" aligns with the PR description.

frontend/src/lib/util/sort.ts (1)

6-6: Type update consistent with tab renaming.

SortContext type updated to reflect "summary" instead of "distributions".

frontend/src/routes/[conf]/[name]/+layout.svelte (2)

3-3: Import addition for entity context.

New import enables dynamic learn link functionality.


17-20: Dynamic learn link implementation.

PageHeader now uses entity configuration to set appropriate learning resources.

frontend/src/lib/components/EntityTable.svelte (3)

11-12: Entity imports added.

Enables dynamic label generation from entity config.


23-24: Dynamic entity label.

Uses entity configuration to determine appropriate label based on entity type.


39-39: Message uses dynamic label.

Replaces hardcoded message with entity-appropriate term.

frontend/src/lib/components/PageHeader.svelte (2)

6-7: Flexible learning links.

The new learnHref property improves component versatility.


16-22: Conditional button rendering with dynamic linking.

Cleanly replaces old static function with dynamic link.

frontend/src/routes/[conf]/+page.svelte (3)

5-8: Imports align with component restructuring.

Appropriate imports for the restructured components.


19-22: Clean header and separator implementation.

The page structure is now properly organized.


23-23: Simplified EntityTable props.

Title prop correctly removed since it's now in PageHeader.

frontend/src/lib/components/SortButton.svelte (2)

10-13: Simplified props handling.

Good use of rest parameters for flexibility.


27-30: Clean button implementation.

Direct rendering with spread props improves maintainability.

frontend/src/lib/components/DriftMetricToggle.svelte (4)

6-6: Added sortFunc import.

Necessary import for the new sorting functionality.


9-14: Separated param config from initialization.

Cleaner structure for reusing config in sorting.


15-18: PSI metric prioritization.

Well-implemented sorting that fulfills PR objective.


22-22: Updated iteration to use sorted metrics.

Properly utilizes the new sorted metrics array.

frontend/src/routes/[conf]/[name]/observability/drift/+page.svelte (4)

157-158: ChartControls property update looks good.

The showSort property reflects the component's UI refinement.


198-200: Consistent event handler implementation.

Changed from arrow function to block statement for better readability.


288-290: Block statement for onbrushend - good consistency.

Maintains the same pattern as other event handlers.


306-308: Consistent onbrushend implementation.

Block statement matches other similar event handlers in the file.

frontend/src/lib/components/ChartControls.svelte (2)

5-5: Import updated to SortButton component.

Aligns with PR objective of renaming ActionButtons to SortButton.


43-45: SortButton implementation looks good.

Clean conditional rendering based on the showSort prop.

frontend/src/lib/types/Entity.ts (7)

41-43: Model entity learnHref added.

Good addition though TODO suggests more specific documentation might be needed.


50-52: Join entity learnHref added.

Appropriate documentation link for Joins.


59-61: GroupBy entity learnHref added.

Appropriate documentation link for GroupBys.


68-70: StagingQuery entity learnHref added.

Proper documentation link for Staging Queries.


77-79: EntitySource learnHref added.

Correct documentation link for Entity Sources.


86-88: EventSource learnHref added.

Reuses the Source documentation link appropriately.


95-97: JoinSource learnHref added.

Uses the ChainingFeatures documentation link.

frontend/src/routes/[conf]/[name]/observability/summary/+page.svelte (8)

17-18: Variable names updated for clarity.

Renamed from distributions-specific to more general columnSummaries.


20-23: Promise handling updated.

Now correctly uses columnSummariesPromise.


25-26: Error message updated.

Reflects the new terminology.


28-31: Sort context and function updated.

Now uses 'summary' context and sorts columnSummaries.


50-52: ChartControls context updated.

Context changed from 'distributions' to 'summary'.


60-62: Loading message updated.

Now references column summaries.


64-65: No data message updated.

Message now correctly references column summaries.


67-73: Iteration variables updated.

Now properly uses columnSummary variables throughout.

sort(data.items, (d) => (d.metaData?.name === 'risk.user_transactions.txn_join' ? -1 : 1))
);
const learnHref = entityConfig[getEntityType(data.items[0])].learnHref;
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Add null check for empty data arrays.

No check if data.items is empty before accessing first element.


🏁 Script executed:

#!/bin/bash
# Find if there are any defensive checks elsewhere for empty data.items
rg -A 3 "data.items\[0\]" --glob "*.svelte" --glob "*.ts"

Length of output: 349


Null check required on data.items access

  • The code in frontend/src/routes/[conf]/+page.svelte (line 16) directly accesses data.items[0] without checking if the array is empty.
  • Please add a condition to verify that data.items is non-empty before proceeding.

@ken-zlai
Copy link
Contributor

Looks good overall, but a few issues:

  1. Navigate to a join -> Click on "Staging Queries" -> Note how the route changes but you stay on the join
Screen.Recording.2025-02-27.at.8.21.15.AM.mov
  1. Navigate to http://localhost:5173/stagingqueries -> Refresh -> Error

Screenshot 2025-02-27 at 8 23 25 AM

  1. When clicking on "Staging Queries", the text is wrong.

Screenshot 2025-02-27 at 8 21 35 AM

@sean-zlai
Copy link
Contributor Author

@ken-zlai Good catch! Yeah, I was deriving the type from the first item, but that won't work when there are no results (the navigation issues are due to thrown errors). Let me rework how this is setup (probably just pass the type explicitly since it's known upstream). Thanks for catching this!

@sean-zlai
Copy link
Contributor Author

@ken-zlai I added getEntityConfigFromPath(path) to simplify this use case (and not determine based off the first item, which doesn't already exist). Ready for another review when you're ready. Thanks!

Copy link
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: 0

🧹 Nitpick comments (4)
frontend/src/routes/[conf]/[name]/+layout.ts (1)

4-4: Remove unused import.

The entityConfig import is defined but never used in this file.

-import { entityConfig, getEntityConfigFromPath } from '$src/lib/types/Entity';
+import { getEntityConfigFromPath } from '$src/lib/types/Entity';
🧰 Tools
🪛 GitHub Check: frontend_tests

[failure] 4-4:
'entityConfig' is defined but never used

frontend/src/routes/[conf]/+page.svelte (1)

7-7: Remove unused import.

The getEntityType import is defined but never used in this file.

-import { getEntityConfigFromPath, getEntityType } from '$lib/types/Entity';
+import { getEntityConfigFromPath } from '$lib/types/Entity';
🧰 Tools
🪛 GitHub Check: frontend_tests

[failure] 7-7:
'getEntityType' is defined but never used. Allowed unused vars must match /^$$(Props|Events|Slots|Generic)$/u

frontend/src/lib/types/Entity.ts (2)

42-42: Address TODO comment.

The TODO comment should be addressed by finding a specific documentation link for models.


140-143: Add input validation to getEntityConfigFromPath.

The function should handle edge cases like null/undefined paths.

export function getEntityConfigFromPath(path: string) {
+	if (!path) return undefined;
	const config = Object.values(entityConfig).find((c) => c.path != null && path.startsWith(c.path));
	return config;
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 2208ba3 and 3cba5ed.

📒 Files selected for processing (6)
  • frontend/src/lib/components/EntityTable.svelte (2 hunks)
  • frontend/src/lib/types/Entity.ts (2 hunks)
  • frontend/src/routes/[conf]/+page.server.ts (2 hunks)
  • frontend/src/routes/[conf]/+page.svelte (1 hunks)
  • frontend/src/routes/[conf]/[name]/+layout.svelte (2 hunks)
  • frontend/src/routes/[conf]/[name]/+layout.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/src/routes/[conf]/[name]/+layout.svelte
  • frontend/src/routes/[conf]/+page.server.ts
🧰 Additional context used
🪛 GitHub Check: frontend_tests
frontend/src/routes/[conf]/+page.svelte

[failure] 7-7:
'getEntityType' is defined but never used. Allowed unused vars must match /^$$(Props|Events|Slots|Generic)$/u

frontend/src/routes/[conf]/[name]/+layout.ts

[failure] 4-4:
'entityConfig' is defined but never used

🔇 Additional comments (5)
frontend/src/lib/components/EntityTable.svelte (2)

11-12: Component now uses EntityConfig instead of title prop.

Component now leverages a structured configuration object rather than a plain string, enabling more consistent behavior.

Also applies to: 16-20


39-39: Dynamic label generation is more maintainable.

Using entityConfig.label.toLowerCase() creates more consistent messaging across the application.

frontend/src/routes/[conf]/[name]/+layout.ts (1)

35-35: Simplified config retrieval.

Using getEntityConfigFromPath simplifies the code by deriving confType directly from the URL path.

frontend/src/routes/[conf]/+page.svelte (2)

18-18: Good use of optional chaining.

The code properly handles potential null/undefined values with optional chaining.


21-28: Improved conditional rendering with fallback.

The conditional rendering provides a clear fallback for unknown entity types, improving user experience.

@sean-zlai sean-zlai force-pushed the sean/ui-simplifications branch from 8622cff to 17c2a24 Compare February 27, 2025 17:44
Copy link
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: 0

🧹 Nitpick comments (1)
frontend/src/routes/[conf]/+page.server.ts (1)

35-37: Consider preserving original error.

Current implementation might lose original error context.

-		throw error;
+		throw new Error(`Failed to load ${entityConfig.label.toLowerCase()}`, { cause: error });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 3cba5ed and 17c2a24.

📒 Files selected for processing (23)
  • frontend/src/lib/api/utils.ts (1 hunks)
  • frontend/src/lib/components/ChartControls.svelte (2 hunks)
  • frontend/src/lib/components/DriftMetricToggle.svelte (1 hunks)
  • frontend/src/lib/components/EntityTable.svelte (2 hunks)
  • frontend/src/lib/components/ExpandableCell.svelte (1 hunks)
  • frontend/src/lib/components/NavigationBar.svelte (1 hunks)
  • frontend/src/lib/components/PageHeader.svelte (2 hunks)
  • frontend/src/lib/components/SortButton.svelte (2 hunks)
  • frontend/src/lib/job/tree-builder/tree-builder.ts (1 hunks)
  • frontend/src/lib/types/Entity.ts (2 hunks)
  • frontend/src/lib/types/LogicalNode.ts (1 hunks)
  • frontend/src/lib/util/sort.ts (1 hunks)
  • frontend/src/routes/+layout.svelte (1 hunks)
  • frontend/src/routes/[conf]/+page.server.ts (2 hunks)
  • frontend/src/routes/[conf]/+page.svelte (1 hunks)
  • frontend/src/routes/[conf]/[name]/+layout.svelte (2 hunks)
  • frontend/src/routes/[conf]/[name]/+layout.ts (2 hunks)
  • frontend/src/routes/[conf]/[name]/observability/ObservabilityNavTabs.svelte (1 hunks)
  • frontend/src/routes/[conf]/[name]/observability/drift/+page.svelte (4 hunks)
  • frontend/src/routes/[conf]/[name]/observability/summary/+page.svelte (3 hunks)
  • frontend/src/routes/[conf]/[name]/observability/summary/+page.ts (2 hunks)
  • frontend/src/routes/[conf]/[name]/overview/+page.svelte (1 hunks)
  • frontend/src/routes/[conf]/[name]/overview/EntityProperties.svelte (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (21)
  • frontend/src/routes/[conf]/[name]/observability/ObservabilityNavTabs.svelte
  • frontend/src/routes/[conf]/[name]/observability/summary/+page.ts
  • frontend/src/lib/util/sort.ts
  • frontend/src/lib/components/ExpandableCell.svelte
  • frontend/src/routes/[conf]/[name]/+layout.ts
  • frontend/src/lib/components/NavigationBar.svelte
  • frontend/src/lib/types/LogicalNode.ts
  • frontend/src/routes/[conf]/[name]/overview/+page.svelte
  • frontend/src/routes/[conf]/[name]/overview/EntityProperties.svelte
  • frontend/src/lib/components/EntityTable.svelte
  • frontend/src/lib/components/ChartControls.svelte
  • frontend/src/lib/job/tree-builder/tree-builder.ts
  • frontend/src/routes/[conf]/+page.svelte
  • frontend/src/lib/api/utils.ts
  • frontend/src/routes/[conf]/[name]/+layout.svelte
  • frontend/src/lib/components/DriftMetricToggle.svelte
  • frontend/src/lib/types/Entity.ts
  • frontend/src/routes/+layout.svelte
  • frontend/src/lib/components/SortButton.svelte
  • frontend/src/routes/[conf]/[name]/observability/summary/+page.svelte
  • frontend/src/routes/[conf]/[name]/observability/drift/+page.svelte
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: enforce_triggered_workflows
🔇 Additional comments (5)
frontend/src/lib/components/PageHeader.svelte (2)

6-7: Props signature updated to include learnHref.

Added optional learnHref parameter makes component more flexible.


16-22: Button now uses dynamic linking instead of fixed function.

Learn button conditionally renders based on learnHref and opens URL in new tab.

frontend/src/routes/[conf]/+page.server.ts (3)

14-16: Improved approach for config retrieval.

Using direct path-based config lookup instead of param matching simplifies the code.


18-20: Better error handling.

Clear 404 error when no valid config found.


5-5:

✅ Verification successful

Check import path alias.

The $src alias is unusual in SvelteKit. Standard is $lib. Verify this alias is properly configured.


🏁 Script executed:

#!/bin/bash
# Check for $src alias configuration
grep -r '\$src' --include="*.js" --include="*.json" --include="*.ts" --include="*.svelte" .

Length of output: 4616


Alias configuration verified – no changes needed.

The $src alias is explicitly defined in frontend/svelte.config.js (mapping $src to src) and is used consistently across the codebase. There’s no need to change it to $lib unless a project-wide standardization is desired.

Copy link
Contributor

@ken-zlai ken-zlai left a comment

Choose a reason for hiding this comment

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

Looks great! Once merged, I'll move the ` into page.svelte

@sean-zlai sean-zlai merged commit 4fedbb8 into main Feb 27, 2025
6 checks passed
@sean-zlai sean-zlai deleted the sean/ui-simplifications branch February 27, 2025 18:22
sean-zlai added a commit that referenced this pull request Feb 27, 2025
…ight and improved LineChart perf (up to 33%) (#451)

## Summary

Fixes close/overlapping series points not properly triggering highlight.
Video after update:

https://github.com/user-attachments/assets/fc4d8631-1525-4196-81b7-2092e47c58f1

Release also improves performance of Spline/LineCharts by up to 33% from
my [testing](techniq/layerchart#418). More work
to make the summary/distributions page initial render much faster, but
moving in the right direction.

This PR also fixes distribution zoom resetting on chart click (similar
to drift/feature chart change in #445)

## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update


<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated the charting component dependency to incorporate minor bug
fixes and improvements for enhanced stability.
- **Bug Fixes**
- Modified the event handling logic for the `PercentileLineChart`
component to ensure `xDomain` is assigned directly from event details.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Sean Lynch <[email protected]>
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.

4 participants