shareable URLs and configuration saving
Query params recreate a generate, named presets live in localStorage. Related: State, Schedule form.
Two mechanisms#
- URL.
nuqswrites year, batch, campus, selectedSubjects. - classConfigs. Named objects in localStorage.
Edits in editedSchedule are not encoded in the URL.
Query schema#
| Param | Parser |
|---|---|
| year | parseAsString |
| batch | parseAsString |
| campus | parseAsString |
| electiveCount | parseAsInteger |
| selectedSubjects | parseAsArrayOf(parseAsString) |
Example:
https://jiit-timetable.tashif.codes/?year=2&batch=B12&campus=62&selectedSubjects=CS311,CI573
flowchart TD
Form[ScheduleForm] --> nuqs
nuqs --> URL
URL --> Home[HomeContent mount]
Home --> Conflict{cachedScheduleParams?}
Conflict -->|none| AutoGen
Conflict -->|same| Keep
Conflict -->|different| DialogDialog#
UrlParamsDialog: override (queue pendingAutoGeneration), prefill, or view existing. Subject codes are split on commas and mapped to names via the campus JSON.
Auto-generate waits until mappings[campus][year] exists so Pyodide is not called with empty tables.
Named configs#
flowchart LR Save[handleSaveConfig] --> LS[(classConfigs)] LS --> Load[handleSelectConfig] Load --> Submit[handleFormSubmit] LS --> Share[share dialog copies URL] LS --> Del[handleDeleteConfig]
Stored object: { year, batch, campus, selectedSubjects }. Duplicate names are rejected. Compare page reads the same classConfigs key to fill either side.
Copy link#
ActionButtons.handleShare copies window.location.href. That is the nuqs URL of the current form, which may already match the generated params.