Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.6.0] - 2026-05-12

### Added
- **Precise Color Picker & Live Preview:** Replaced the generic color text inputs in Add and Edit forms with an interactive Color Input component. This new component combines text search with a native hex color picker and opacity slider, providing accurate visual representation while maintaining searchability. The form now features a live-updating `DiscPreview` that reflects changes in real-time. Hex color overrides seamlessly propagate to inventory lists, bag checklists, and flight charts.
- **Custom Molds:** Added the ability to create Custom Molds directly inline from the "Add Disc" form. If a disc does not exist in the Discit API, users can now define the disc's name, brand, category, and flight numbers to add it to their vault.

### Fixed
- **Secondary Patterns:** Standardized Secondary Pattern names (e.g. "Halo/Rim") to consistently display friendly labels across both the editor forms and the detail views instead of the raw database values. Fixed an issue where long pattern names would truncate in form inputs on smaller screens.
- **Disc Visuals:** Fixed an SVG rendering bug where translucent or "Clear" secondary colors in Half 'n Half and Halo patterns incorrectly showed the base disc color underneath them.
- **Location Picker:** Fixed an issue where heavily nested location paths would be truncated after selection. The dropdown button now expands vertically to wrap long text.

## [0.5.2] - 2026-05-07

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discvault",
"version": "0.5.0",
"version": "0.6.0",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
Expand Down
2 changes: 2 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ model Inventory {
userGlide Float?
userTurn Float?
secondaryColor String?
colorHex String?
secondaryColorHex String?
secondaryPattern String?
collection DiscCollection? @relation(fields: [collectionId], references: [id])
mold Mold @relation(fields: [moldId], references: [id])
Expand Down
10 changes: 10 additions & 0 deletions src/app/actions/inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export async function addDisc(formData: FormData) {
const userGlide = parseUserFlight(formData.get('userGlide'))
const userTurn = parseUserFlight(formData.get('userTurn'))
const userFade = parseUserFlight(formData.get('userFade'))
const colorHex = (formData.get('colorHex') as string) || null
const secondaryColorHex = (formData.get('secondaryColorHex') as string) || null

if (!moldId) throw new Error('Mold ID is required')

Expand All @@ -63,6 +65,8 @@ export async function addDisc(formData: FormData) {
weight,
color,
secondaryColor,
colorHex,
secondaryColorHex,
secondaryPattern,
plastic,
stamp,
Expand Down Expand Up @@ -103,6 +107,8 @@ export async function updateDisc(id: string, formData: FormData) {
const userGlide = parseUserFlight(formData.get('userGlide'))
const userTurn = parseUserFlight(formData.get('userTurn'))
const userFade = parseUserFlight(formData.get('userFade'))
const colorHex = (formData.get('colorHex') as string) || null
const secondaryColorHex = (formData.get('secondaryColorHex') as string) || null

try {
await prisma.inventory.update({
Expand All @@ -112,6 +118,8 @@ export async function updateDisc(id: string, formData: FormData) {
weight,
color,
secondaryColor,
colorHex,
secondaryColorHex,
secondaryPattern,
plastic,
stamp,
Expand Down Expand Up @@ -243,7 +251,9 @@ export async function importDiscs(records: any[], targetCollectionId?: string) {
plastic: record.plastic || null,
weight: parseSafeFloat(record.weight, NaN) || null,
color: record.color || null,
colorHex: record.colorHex || null,
secondaryColor: record.secondaryColor || null,
secondaryColorHex: record.secondaryColorHex || null,
secondaryPattern: record.secondaryPattern || null,
stamp: record.stamp || null,
stampFoil: record.stampFoil || null,
Expand Down
41 changes: 41 additions & 0 deletions src/app/actions/molds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,44 @@ export async function syncMolds() {
revalidatePath('/')
return { updatedCount, createdCount }
}

function getStability(turn: number, fade: number): string {
const score = turn + fade
if (score <= -2) return 'Understable'
if (score <= 0) return 'Stable'
if (score <= 2) return 'Overstable'
return 'Very Overstable'
}

export async function createCustomMold(formData: FormData) {
const name = formData.get('name') as string
const brand = formData.get('brand') as string
const category = formData.get('category') as string
const speed = parseFloat(formData.get('speed') as string)
const glide = parseFloat(formData.get('glide') as string)
const turn = parseFloat(formData.get('turn') as string)
const fade = parseFloat(formData.get('fade') as string)

if (!name || !brand || !category || isNaN(speed) || isNaN(glide) || isNaN(turn) || isNaN(fade)) {
throw new Error('All fields are required to create a custom mold.')
}

const stability = getStability(turn, fade)

const newMold = await prisma.mold.create({
data: {
name,
brand,
category,
speed,
glide,
turn,
fade,
stability,
isCustom: true
}
})

revalidatePath('/settings')
return newMold
}
2 changes: 2 additions & 0 deletions src/app/v/[vaultId]/bagcheck/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ export default async function BagCheckPage({
plastic: d.plastic,
weight: d.weight,
color: d.color,
colorHex: d.colorHex,
secondaryColor: d.secondaryColor,
secondaryColorHex: d.secondaryColorHex,
secondaryPattern: d.secondaryPattern,
stampFoil: d.stampFoil,
location: d.location,
Expand Down
Loading
Loading