hydro-dev / hydro-dev/Hydro

Proposal: Enhance Problem Customization by Restructuring Tdoc Schema

Open
#1,015 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7k
Forks
476
Avg merge
15h 48m
Merged PRs (30d)
3

Description

Current Limitation

The current tdoc schema stores problem-related data through separate fields:

  • pids: Array of problem IDs
  • score: Fullmark value
  • balloon: Balloon color information

This structure don't support the customization of problem titles and labels (e.g., "A,B,C", "L1-1,L1-2", "A,B1,B2" formats).

Proposed Solution

Introduce a structured problems array field with enhanced flexibility:

export interface Tdoc extends Document {
    // ...
    problems: { 
        pid: number; 
        label: string;       // Custom label (required)
        title?: string;      // Optional custom title
        score?: number;      // Optional score override
        balloon?: string | { color: string, name: string }; // Optional balloon customization
    }[];
    // ...
}
Backward Compatibility
  • Maintain existing fields (pids, score, balloon) during transition
  • Implement synchronization mechanism between legacy fields and new structure
  • Add deprecation warnings for legacy fields
Feedback Request

Would the maintainers consider accepting this change? If so, I'm willing to try to work on this task.

I understand this represents a significant change - would you prefer this approach over maintaining the current schema?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the tdoc schema and its current pids, score, and balloon usages, then trace how problem data is read and written. Define the compatibility and synchronization behavior for the proposed problems array, including deprecation handling, and verify that legacy fields and customized labels, titles, scores, and balloons remain consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, typescript
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.