Overview
Theviews.js module is responsible for rendering HTML for all major views in Estudo Organizado. It contains view-specific rendering functions that generate markup based on application state.
Key Views:
- Home (Dashboard)
- MED (Today’s Study Events)
- Calendar (Month/Week)
- Dashboard (Analytics)
- Revisões (Spaced Repetition)
- Hábitos (Habit Tracking)
- Editais (Syllabus Management)
- Config (Settings)
Home View (Dashboard Redesign)
renderHome(el)
The main dashboard showing study metrics, goals, and predictive analytics.
Location: views.js:40-299
Home View Sections
Home View Sections
Top Stats (Line 1)
- Total study time
- Performance (% correct)
- Syllabus progress
- Pages read
- Last 30 days visualization
- Current streak and max streak
- Left: Subject performance table (time, correct, wrong, %)
- Right:
- Weekly prediction (Green/Yellow/Red)
- Exam date countdown
- Weekly goals (hours and questions)
- Weekly study chart (7-day bar chart)
- Predictive Stats
- Heatmap
The home view includes a weekly predictor that calculates if the user will hit their goals based on current burn rate:Status Logic:
- Green: On track or already met goal
- Yellow: Need +X min/day to reach goal (80-100% projected)
- Red: High deficit, unlikely to meet goal (less than 80% projected)
MED View (Today’s Events)
renderMED(el)
Displays today’s study events, split into “Agendado” (scheduled) and “Estudado” (completed).
Location: views.js:330-383
Surgical DOM UpdatesInstead of re-rendering the entire view when events change, MED uses targeted updates:
refreshEventCard(eventId): Updates a single event cardrefreshMEDSections(): Updates only the stats and event listsremoveDOMCard(eventId): Removes a deleted event without full re-render
views.js:386-456 for implementation.Calendar View
renderCalendar(el)
Displays events in a month or week grid.
Location: views.js:459-478
- Month View
- Week View
renderCalendarMonth() (views.js:490-542)- Generates 7x5 or 7x6 grid of calendar cells
- Fills in previous/next month days for alignment
- Displays up to 3 events per cell, with “+N more” indicator
- Clicking a cell opens event creation modal for that date
Dashboard View (Analytics)
renderDashboard(el)
Deep analytics with charts and period filtering.
Location: views.js:656-744
Daily Chart
Bar chart of study minutes per day using Chart.js
Discipline Chart
Doughnut chart of time distribution across subjects
Revisões View
renderRevisoes(el)
Displays pending and upcoming spaced repetition reviews.
Location: views.js:879-967
Review Actions:
- Marcar Feita: Adds today to
revisoesFetasarray, advances to next interval - Adiar +1 dia: Increments
adiamentoscounter, postpones all future revisions by 1 day
Hábitos View
renderHabitos(el)
Tracks study habits like questions solved, simulations, readings, etc.
Location: views.js:1015-1048
Available Habit Types
Available Habit Types
| Key | Icon | Label |
|---|---|---|
questoes | ❓ | Questões |
revisao | 🔄 | Revisão |
discursiva | ✍️ | Discursiva |
simulado | 📝 | Simulado |
leitura | 📖 | Leitura |
informativo | 📰 | Informativo |
sumula | ⚖️ | Súmula |
videoaula | 🎥 | Videoaula |
Event Detail Modal
openEventDetail(eventId)
Shows a detailed modal for a specific event.
Location: views.js:601-645
Summary
Home
Dashboard with metrics, streaks, goals, and predictions
MED
Today’s study events with targeted DOM updates
Calendar
Month/week view with event creation shortcuts
Dashboard
Analytics with period filtering and Chart.js graphs
Revisões
Spaced repetition review management
Hábitos
Habit tracking with paginated history