Commit Graph

60 Commits

Author SHA1 Message Date
Iqbal
6d78476b2b Call it the Agent instead of AI in the interface
Hanabank asked for this naming at the 3 November 2026 meeting. Only display
text changes, in English and Indonesian; keys, API fields and class names stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 10:29:37 +07:00
Iqbal
a3be635648 Poll run history and processing documents every 5 seconds, not 3
Both are the app's fastest polls; at 5 seconds no read runs more often
than that, which leaves the engine more room when several tabs are open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:42:24 +07:00
Iqbal
eb194df8e0 Read only the schedules whose results changed, using the engine's agent status
Results polled one drafts endpoint per schedule every minute, archived ones
included, so the Network tab filled with video-drafts reads. Each poll now
reads GET /agents/status once (with If-None-Match, mostly a 304) and reads a
schedule's drafts again only when its status changed, while a production plan
is at work, or after 30 minutes so signed video URLs stay valid. Without the
status read, every schedule is read as before. The poll is now every 30s.

Also documents how Express uses the engine API in docs/engine-api.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:34:08 +07:00
Iqbal
46730279cb Show an approval at once, even when the next read is a remembered one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:41:12 +07:00
Iqbal
8a282b6d0d Let the space menu open past the collapsed sidebar
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 14:11:36 +07:00
Iqbal
822c5fcac9 Ask before uploading a file twice, and find material by name or status
The same file could be uploaded again and again without a word (three
copies of several catalogues), the list of about 150 materials had no
search or filter, and clicking a material that downloads instead of
opening seemed to do nothing. Uploading a file whose name is already in
the Brain now asks first, and cancelling skips those files; the list
has a search box and a status filter with counts; and a material that
is downloaded says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:55:02 +07:00
Iqbal
93c665fdbf Fit the layout between phone and desktop widths
From about 920px down to the phone layout (700px), the sidebar kept its
full width and the topbar's credit balance, Learning Lab link and
language switch ran past the right edge. Between 701 and 1024px the
sidebar now starts as the icon rail (the toggle opens it for the
visit), and up to 1100px the topbar and the page head's buttons wrap
onto another line, without the engine label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:54:18 +07:00
Iqbal
7ce5a0fa12 Finish the Indonesian translation
The Indonesian UI still showed English or mixed labels: Workspace
overview, Knowledge graph, Konten in progress, Lihat di Results, Masuk
Library, Sumber: seluruh Brain, and "Klik sebuah node". They are now
translated, and the Brain is called Otak throughout, as most Indonesian
text already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:53:16 +07:00
Iqbal
012159aae2 Name a node's neighbours in the graph only when there are few
Selecting the Knowledge base hub named every document linked to it at
once, hundreds of labels piled on top of each other. Neighbours are now
named only for a node that is not a hub and has at most 12 of them;
the others still light up, and each shows its name on hover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:52:23 +07:00
Iqbal
e1c88b291c Count content the same way on the dashboard and Results
The dashboard's "All content made" counted everything not failed,
pieces still being made included, while Results' tab counted every
piece and its "Done" filter only finished ones, so the numbers never
matched. The dashboard now counts what Results calls Done, and each
status filter on Results shows how many pieces it holds, so the total
splits into the same numbers the dashboard shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:52:10 +07:00
Iqbal
833eb00919 Fail a video the engine stopped and let it be cancelled
Videos whose clip step ended without a confirmed result
(video_clip_outcome_unknown) stayed "Generating" for good: the draft
still says it is at work, the card could not be opened, and nothing
offered a way out. Such a video now shows as failed and stopped, a
video card opens while it is being made, and its preview offers Cancel
video (the engine's cancel, which settles the known credits). Once
cancelled, the newest video can be made again with Retry. Run history
explains the outcome-unknown codes instead of showing them raw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:51:44 +07:00
Iqbal
677937eb98 Follow a running production every few seconds
A started production kept showing "AI picks new topics" for a minute
or more: each schedule's status was read once a minute, and the refresh
right after starting got the read kept from before the start. That read
is now dropped when a production starts, and while the latest production
is under way its status is read every five seconds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:50:05 +07:00
Iqbal
7a7f67d3e2 Approve a plan only once its kind, frequency and language are chosen
The plan's title said the kind and frequency were not chosen yet while
its fields showed Summary / per week and the Approve button was on, with
no content language picked. A guessed kind or frequency now shows as not
chosen in the fields too, and Approve waits until they and the language
are set, saying what is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:49:38 +07:00
Iqbal
74d7e01e4f Attach Brain material without blocking a schedule's status
Saving a topic or resuming sent one PUT per ready document (about 150),
and a topic change left the schedule in draft (shown as paused) until
all of them were done. Creating a schedule waited on the same loop with
no sign of progress.

A topic change now re-activates (or keeps paused) right after the PATCH,
and resuming is one activate; both then attach only the documents the
schedule does not have yet. Creating a schedule still attaches every
ready document, three at a time and paced under the proxy's rate limit,
retrying a busy answer instead of skipping it, and the Instruction chat
shows how many are done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 13:44:26 +07:00
Iqbal
7a51f35ec4 Keep scrollTo's Promise out of the route-change effect
Chrome's window.scrollTo now returns a Promise. The effect that opens
each page at the top returned it, so React kept it as the cleanup and
called it on the next route change: "TypeError: Z is not a function",
which unmounted the whole app until a reload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:25:59 +07:00
Iqbal
4e1bee4503 Show a crash outside a page instead of a white screen
Moving between pages sometimes left a white screen until a reload: an
error outside the page's own error boundary (the layout, the sign-in
gate) unmounted the whole app. An error boundary now wraps the whole
app, shows the error's name and message, and tries again when the route
changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:20:22 +07:00
Iqbal
977a8fafc4 Pace engine reads under the proxy's rate limit
The proxy allows 10 requests a second per address and answers the rest
503. Limiting how many reads run at once still sent 40-50 a second, since
each answers in about 100 ms. Reads now share one pace of 8 a second,
actions skip the queue, and a 503 pauses every read for 2 seconds.
Results and Schedule share each schedule's production status, and an
archived schedule is read once until an action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 10:06:40 +07:00
Iqbal
138be5ac96 Keep a schedule's last results while the engine is busy
A schedule the proxy's rate limit answered with 503 was left out of that poll, so every count on
Production dipped for a minute and came back on the next. A busy schedule is now asked once more
after a pause, and if it still fails its results from the last poll are shown. A refused one (4xx)
is still left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 23:09:45 +07:00
Iqbal
dfb3275afe Keep a page error or a busy engine from blanking the app
A user on Upload got a white page while the engine's proxy answered
many requests with nginx's rate-limit 503.

- Pages render inside an error boundary, so a crash shows a message
  with Try again and Reload instead of unmounting the whole app.
- A 503 or 429 without the engine's JSON reads "The engine is busy",
  and queries wait 5s, then 10s, before asking again instead of 1s.
- Upload asks for knowledge details two at a time and reuses them
  until the document's knowledge status changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 18:38:18 +07:00
Iqbal
a47fe0f845 Open each page at the top
The window scrolls rather than the page area, so moving to another page
after scrolling down opened it at the same depth. Scroll to the top
whenever the route changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:35:30 +07:00
Iqbal
ebfd3802c6 Read each schedule's production status once a minute
Every content schedule row on the Schedule page asked the engine for its
production status every 5s while a plan was running, a steady stream of
/content requests during production. Read it once a minute; starting a
production still refreshes it at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:20:43 +07:00
Iqbal
6ac8692d0d Read results once a minute
Every read of results asks each video schedule for its drafts, and the
dashboard read them every 10s while anything was being made, so the
network tab filled with video-drafts requests. Poll once a minute on the
dashboard and Results page, and reuse a read under a minute old when a
page opens or regains focus. Actions still refresh results at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:12:51 +07:00
Iqbal
3478d28bb2 Name the nodes linked to the one you point at in the knowledge graph
Hovering or selecting a content node lit up its links, but the linked
knowledge-base nodes stayed unlabelled, so you could not tell which
material it came from. Their titles now show, a little quieter than the
focused node's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:08:50 +07:00
Iqbal
4658d66503 Load results a few schedules at a time
The dashboard polls results every 10s, and each poll fetched every
schedule's drafts in parallel. With many video schedules that burst
overloaded the engine, which answered some with 503 and dropped those
schedules' results until the next poll. Run at most 4 at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 17:01:21 +07:00
Iqbal
c72807dc26 Rename Brain and AI to Instruction and write BAWANA in capitals
The page now lives at /instruction; /brain and /perintah redirect there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 14:45:05 +07:00
Iqbal
5bc0915edf Open all content filtered to the activity tab you were on
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:49:07 +07:00
Iqbal
d00561f75d Keep the sign-out button visible with a long name or email
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:25:50 +07:00
Iqbal
8d745ad96e Fit the knowledge graph in the viewport on short screens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:21:33 +07:00
Iqbal
bcd747721d Show who created each schedule and start with your own
Org admins see every Express schedule in the organization, so a shared
organization mixed everyone's schedules together. The Schedule page now
shows "Created by …" on each one and, when others' schedules are listed,
switches between Mine and Everyone in the organization.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:18:28 +07:00
Iqbal
bdae539e9e Show only the knowledge base and content in the knowledge graph
The graph now represents the agent's Brain: its documents and the
content made from them. Work in progress, failed runs, research
suggestions and schedules are status, so they are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 11:51:04 +07:00
Iqbal
643c3c39f9 Remove the Brain panel from the Brain and AI page
The page is back to the chat and the plan side by side. With nothing to
tick, new schedules always use the whole Brain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 11:50:39 +07:00
Iqbal
adbcfcc7ba Keep the knowledge graph when one schedule fails to load
One failing per-schedule request no longer blanks the whole graph, and
the graph shows the engine's own error instead of always saying the
engine cannot be reached.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 10:19:56 +07:00
Iqbal
278c66897a Make the sidebar collapsible and let the knowledge graph go full screen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 10:14:34 +07:00
Iqbal
bcd7964e0b Say when a research run found no new sources
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 10:14:34 +07:00
43a977017b Merge pull request 'show-run-errors-and-reprocess' (#2) from show-run-errors-and-reprocess into main
Reviewed-on: #2
2026-10-28 09:40:05 +00:00
Iqbal
a73a5a3fdf Require two materials for content schedules and scope readiness copy
The engine plans each production piece from a pair of documents, so a
summary, quiz or similar schedule with one material can never plan. Approving
such a plan is now blocked with a note to choose or upload another material,
and the engine's refusal on an existing schedule is explained in plain
language. Video and research schedules still work with one material.

The engine now checks only a schedule's own material before a run, so the
run error and Upload texts no longer say the whole Library or Brain is
checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 16:37:56 +07:00
Iqbal
d1492b9c76 Explain blocked schedule runs and let a failed document be processed again
Schedule history now shows a readable reason instead of the engine's raw code,
and under the newest run stopped by knowledge_not_ready it lists the Library
material that blocks it, with a link to fix it in Learning Studio. The list
refreshes while that material is still processing or building.

Upload gets a "Process again" button for a failed document, using the engine's
new reprocess endpoint; a knowledge base the document already has is kept. A
document being processed again no longer shows as "In the Brain".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:13:03 +07:00
Iqbal
b63e9c2ca8 Make the Brain agent ask instead of guess, and answer how schedules run
Generic requests ("10 konten", "10 pdf") now become a rule whose kind the
agent asks about, and a rule with no frequency is asked about instead of
silently becoming weekly. Times like 09.00 no longer split sentences, and
requests about drafts, the hour, scheduling, sources and duplicates get a
truthful note rather than an "I did not understand" loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 14:09:27 +07:00
Iqbal
d018c6826f Collapse sidebar nav groups into dropdowns that open on the active page
Each group label (Dashboard, Settings) toggles its items; a group starts
closed unless it holds the current route, and a manual toggle resets on
the next navigation. Mobile keeps every item visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 13:55:27 +07:00
Iqbal
844c88912a Add deploy.sh for Netlify production deploys
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:22:57 +07:00
Iqbal
6f3a5234b4 Turn Production into a welcome dashboard with content activity
Greet the user by name, drop the development-phase strip, move three metric
cards (material in the Brain, content made, uploaded to the LMS) below the
knowledge graph, and add a content activity section with the latest and
in-progress results as Results cards that open their preview in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:22:57 +07:00
Iqbal
3b56c27210 Show the Brain beside the AI chat and make schedules from chosen material
The Brain and AI page lists Brain material (failed documents hidden) with
search, open, delete and per-material or select-all ticks. New schedules use
only the ticked material, kept through topic edits and resumes; nothing ticked
means the whole Brain. With material ticked, the agent skips the content topic
question and names the material in the chat and plan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:53:38 +07:00
Iqbal
ef4fb7d971 Rename Brain to Upload material and Instruction to Brain and AI
Upload material (/upload) drops the metric cards for a larger upload box
above the material list; Brain and AI moves to /brain. Old paths redirect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:36:52 +07:00
c1063bfa7e Merge pull request 'production-dashboard' (#1) from production-dashboard into main
Reviewed-on: #1
2026-10-27 14:58:52 +00:00
Iqbal
68050d8d4b Pin production Clerk key and Studio URL for local builds
A build without them used learning-lab's dev Clerk key, so production
users signed in to the wrong instance and saw no data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:56:56 +07:00
Iqbal
9f9fc93dfe Retry failed videos with a new run and explain documents that fail after their build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:48:00 +07:00
Iqbal
8a02f68589 Link to Learning Lab from the topbar
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 21:48:00 +07:00
Iqbal
ddbdbc7d44 Add a Production dashboard with an animated knowledge graph
The sidebar now groups Production under Dashboard and the four existing
pages under Settings, and Production is the landing page. It shows content
in progress, material, content made, approved and LMS-ready counts, plus a
knowledge graph linking Brain documents, results, found sources and
schedules, with the schedule and what is being made right now beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 15:57:10 +07:00
Iqbal
6d4850f4ce Switch organizations from the Learning space card
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:59:22 +07:00
Iqbal
51700bc0f3 Deploy to Netlify with the engine behind a same-origin /api proxy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 09:56:37 +07:00