feat: initial conversational flow (#37)
* chore: only set visibility for container particles * create reusable controls indicator for reply or new * compress the size of top bar * refactor: restructure state, routing, and more * introduce stream compose flow * feat: compose new stream full flow * implement stream player * fix: prevent redirect for signed object urls * fix: implement stream playback cleaner structure * refactor: layout file name * feat: show stream name in breadcrumbs * chore: tweak padding * chore: adjust position of audio bars * feat: show latest particle preview in stream list * fix: remove console log * refactor: reorder classes * fix: avoid passing in updated_at to firestore particle * refactor: extract properties for container particles to flat fields in firestore * make the stream previews look alive * feat: show audio bars during audio clip playback * feat: order streams by last child creation * feat: playback where I left off * chore: remove unused store * fix: recording mode not using shared state * chore: clean unused variable * remove unused imports * fix: improve controls indicator immersion * feat: show playback progress in bar & auto-play text * feat: auto-exit stream on playback completion * fix: jittery media playback progress * fix: navigate during state change is invalid with react router * fix: buggy exit progress when changing clips * feat: add app icon * update package.json info * feat: only show streams visible to me * feat: show seen indicator on particles * fix: prevent unnecessary effects * fix: play new particle after playback is ended * use contols indicator for exit timer
This commit was merged in pull request #37.
This commit is contained in:
@@ -447,7 +447,7 @@ func (h *Handler) RemoveMemberFromNetwork(w http.ResponseWriter, r *http.Request
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
||||
|
||||
// DownloadParticleMedia redirects to a fresh signed download URL for media/file particles
|
||||
// DownloadParticleMedia returns a fresh signed download URL for media/file particles
|
||||
func (h *Handler) DownloadParticleMedia(w http.ResponseWriter, r *http.Request) {
|
||||
_, ok := middleware.EmailFromContext(r.Context())
|
||||
if !ok {
|
||||
@@ -459,33 +459,6 @@ func (h *Handler) DownloadParticleMedia(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
objectID := r.PathValue("id")
|
||||
|
||||
// particleID := r.PathValue("id")
|
||||
// if particleID == "" {
|
||||
// http.Error(w, "object id is required", http.StatusBadRequest)
|
||||
// return
|
||||
// }
|
||||
|
||||
// p, err := h.particleSvc.GetByID(r.Context(), particleID, email)
|
||||
// if err != nil {
|
||||
// if errors.Is(err, particle.ErrNotFound) {
|
||||
// http.Error(w, "particle not found", http.StatusNotFound)
|
||||
// return
|
||||
// }
|
||||
// if errors.Is(err, particle.ErrAccessDenied) {
|
||||
// http.Error(w, "access denied", http.StatusForbidden)
|
||||
// return
|
||||
// }
|
||||
// slog.Error("failed to get particle for download", "error", err, "particle_id", particleID, "email", email)
|
||||
// http.Error(w, "internal server error", http.StatusInternalServerError)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// objectID := extractObjectID(p)
|
||||
// if objectID == "" {
|
||||
// http.Error(w, "particle has no downloadable content", http.StatusBadRequest)
|
||||
// return
|
||||
// }
|
||||
|
||||
downloadURL, err := h.depotSvc.GetDownloadURL(r.Context(), objectID)
|
||||
if err != nil {
|
||||
slog.Error("failed to get download URL", "error", err, "object_id", objectID)
|
||||
@@ -493,7 +466,8 @@ func (h *Handler) DownloadParticleMedia(w http.ResponseWriter, r *http.Request)
|
||||
return
|
||||
}
|
||||
|
||||
http.Redirect(w, r, downloadURL, http.StatusFound)
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(map[string]string{"url": downloadURL})
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user