Skip to content

Sticky sidebar, unified platform fees, schema reset#5

Merged
NimbleEngineer21 merged 2 commits intomainfrom
fix/sticky-sidebar
Mar 5, 2026
Merged

Sticky sidebar, unified platform fees, schema reset#5
NimbleEngineer21 merged 2 commits intomainfrom
fix/sticky-sidebar

Conversation

@NimbleEngineer21
Copy link
Owner

@NimbleEngineer21 NimbleEngineer21 commented Mar 4, 2026

Summary

  • Sticky sidebar: Layout locked to viewport height — only the main content area scrolls, so Settings and Ko-fi are always visible
  • Unified platform fees: All three fee fields (Fee/Share, Flat Fee, Fee %) are now independently configurable per platform and applied additively
  • Schema reset: Consolidated to v1 with simplified migration (no existing users)
  • Settings cleanup: Removed "Seed Example Data" button from Data Management

Test plan

  • Verify sidebar stays fixed while scrolling long pages (e.g. Assets)
  • Verify Settings shows all 3 fee fields per platform
  • Verify Assets "Rates & Fees" card shows combined fee display
  • Verify adding a new platform creates all 3 fee fields
  • npm test — 415 tests pass
  • npm run lint — clean
  • npm run build — no errors

Platform fees: all three fee fields (feePerShare, flatFee, feePercent)
are now independently configurable per platform and applied additively.
Settings UI shows all fields; Assets displays non-zero components.

Layout: sidebar is now viewport-locked with only the main content area
scrollable. Settings: removed "Seed Example Data" button.

Schema: consolidated to v1 since there are no existing users.
Simplified migrateState to reset unknown versions to defaults.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the app layout to keep the sidebar fixed while the main content scrolls, unifies platform fee configuration to support additive per-share + flat + percentage fees, and resets the persisted schema to a simplified v1 migration approach.

Changes:

  • Make the sidebar sticky by constraining the app to 100vh and routing scrolling to the main content area.
  • Unify platform fee modeling/UI so all platforms can independently configure per-share, flat, and percent fees (applied additively).
  • Simplify schema handling by resetting to schema v1 and removing legacy migration/seed-data UI.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/pages/Settings.jsx Updates platform fee inputs to always show 3 fee fields; removes seeding UI.
src/pages/Assets.jsx Updates “Rates & Fees” display to show combined additive fees.
src/lib/storage.js Simplifies migration logic (future version passthrough; older versions reset).
src/lib/calculations.js Changes fee calculation to additive per-share + flat + percent.
src/lib/tests/storage.test.js Adjusts migration tests to match simplified migration behavior.
src/lib/tests/calculations.test.js Extends fee tests for additive “combo” fees.
src/data/defaults.js Updates default platforms to include all three fee fields; resets schema version to v1.
src/components/Layout.jsx Locks layout to viewport height and hides outer overflow to enable sticky sidebar behavior.
src/App.css Adds sidebar/main overflow behavior and flex fixes for viewport-locked layout.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Bump SCHEMA_VERSION to 3 with proper migration ladder:
- v1→v2: adds carMaintenanceAnnual to purchase
- v2→v3: normalizes platform fee fields (all three always present)

Addresses PR review findings:
- Guard against NaN when asset.quantity is undefined in calcFee
- Require schemaVersion on import to prevent silent data loss
- Extract feeLabel() helper for fee display in Assets
- Clamp fee inputs to non-negative values in Settings
- Fix inner flex child using height:100vh instead of minHeight:0
- Fix indentation and blank line formatting in Settings
@NimbleEngineer21 NimbleEngineer21 merged commit 3987e99 into main Mar 5, 2026
1 check passed
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.

2 participants