feat(aside_style): optimize and clean up css code#550
Open
feat(aside_style): optimize and clean up css code#550
Conversation
The additional_html action was missing from Folio::File::CANCAN_MAPPINGS[:read], causing CanCan::AccessDenied (401) for non-superadmin roles (editors, redactors) when accessing the file detail API endpoint in console.
…le is added (#525) * When file is updated it should be reflected on articles where this file is added
Contributor
Author
|
Byla provedena optimalizace aside stylu, protože v předchozí verzi mobilní verze byla ignorovaná a začalo se stylovat až od tabletové verzi. Teď můžeme stylovat od mobilní verzi. |
…ent (#549) * fix(audited-dropdown): flex-wrap and full-width label/small in component Made-with: Cursor * chore(changelog): log audited dropdown fix --------- Co-authored-by: Jiri Prusek <george@Jiri--Mac-mini.home> Co-authored-by: Petr Marek <contact@petrmarek.eu>
…link popover input
…te_attachments error
…ap (#555) .f-tiptap-content__root nastavuje white-space: pre-wrap pro správné renderování textu. Tato hodnota se dědí do .f-embed-box, kde způsobuje, že whitespace text nodes v raw HTML embedech (YouTube, Twitter apod.) se renderují jako viditelné prázdné řádky. ProseMirror tento problém řeší v editoru přes .ProseMirror [contenteditable="false"] { white-space: normal }, ale na frontendu atribut contenteditable chybí — proto je potřeba reset přímo na embed wrapperu.
…principles, foundational and migration tracks for Folio development
…erence to sinfin/aws-file-handler
…video workflow (#538) * feat(cra): presigned S3 URLs, progress tracking, multi-phase encoding - Replace SFTP video upload with presigned S3 URLs (CRA downloads directly from S3) - Add two-phase encoding support (SD first, then HD) with backward compat - Add real-time encoding progress tracking via MessageBus with phase milestones - Add encoding info ViewComponent with Stimulus controller for live progress display - Add error handling with automatic retry (1 retry on CRA failure) - Add safety nets: stuck video recovery, 4-hour timeout, reference_id cap at 128 chars - Add S3 server-side copy for video uploads (zero data transfer through pod) - Add single ffprobe call for video metadata via presigned URL - Prefer CRA cover for thumbnails to prevent 8K HEVC OOMKill - Add progressive video availability (SD playable before HD finishes) - Gracefully handle missing S3 source files in CreateMediaJob * fix(cra): review fixes — S3 dedup, race condition, state naming, tests Code review fixes for PR #538: - Extract s3_dragonfly_head_object/extract_s3_etag into Folio::S3::Client - Remove duplicate get_s3_metadata/extract_etag from Encoder and CreateMediaJob - Rewrite Folio::File#file_presigned_url to delegate to S3::Client module - Consolidate handle_job_failure to single save (eliminate double-save race) - Use "encoding_failed" state for CRA failures (distinct from "upload_failed") - Add broadcast after timeout transitions in CheckProgressJob and MonitorProcessingJob - Replace shell backticks with Open3.capture3 in video_resolution_too_high? - Fix MonitorProcessingJob to read encoding_generation from remote_services_data - Remove dead upload_progress line in upload_is_stuck? - Fix phase_failed locale to not instruct deleting indestructible videos - Add tests for processing_timed_out? and finalize_from_completed_phases! - Fix stale test assertions (mapped progress, encoding_failed state) - Add concurrency documentation comments * docs: add CRA encoding system design document Describes the complete folio + economia CRA integration: upload flow, two-phase encoding (single manifest with processingPhases attribute), progress tracking, state machine, error handling, progressive video availability, thumbnail generation, and S3 optimizations. Also documents known implementation gaps and test coverage gaps. * fix(cra): address code review issues — locks, safe defaults, query fix - Move broadcasts outside with_lock in CheckProgressJob#check_progress and remove them from handle_job_failure (emitted by caller after lock release) to avoid Redis I/O while holding a Postgres row lock - Wrap save_intermediate_phase_data calls in with_lock in both fetch_job_response and select_multi_phase_job to protect against concurrent MonitorProcessingJob/CreateMediaJob runs - Filter REMOVED jobs in reconcile_with_remote_jobs before JobResolver to avoid silently skipping active jobs in multi-phase encodings - Add COALESCE to retry_count query so videos without the key (pre- migration) are picked up by the lost-retry safety net - Return true (skip ffmpeg) on ffprobe exception instead of false to prevent OOMKilling pods on unknown-resolution videos - Fix cra_file? to check FileProcessing inclusion, covering enqueued state before remote_services_data["service"] is written - Move require "open-uri" to top of file; fix design doc references * fix(cra): move broadcasts outside lock in finalize_from_completed_phases! The previous round of fixes missed that finalize_from_completed_phases! still broadcast inside with_lock. This moves those broadcasts out of the lock block (same pattern as check_progress). Also adds comment explaining why processing_timed_out? intentionally broadcasts without a lock (unique job constraint prevents concurrency), and adds a regression test for reconcile_with_remote_jobs scheduling CheckProgressJob when all CRA jobs are REMOVED. * test: add coverage for failed-upload retry and orphan reconciliation - handle_failed_uploads_needing_retry: upload_failed and encoding_failed videos older than 5 min get CreateMediaJob; fresh failures are skipped - reconcile_video_state: API returns active job → remote_id updated, CheckProgressJob scheduled; API returns no jobs → reference_id and processing_state cleared (video queued for re-upload) * docs: correct REMOVED status explanation, mark test gaps closed Production investigation (20 oldest CRA videos, 4+ months old) confirmed CRA does NOT auto-purge completed jobs — DONE status persists indefinitely. REMOVED appears only when job content is explicitly deleted via DeleteMediaJob. - Fix misleading comment in check_progress_job.rb - Add REMOVED note + production finding to safety nets table in design doc - Mark MonitorProcessingJob and AdditionalHtmlComponent test gaps as closed * fix: defer Redis I/O outside Postgres lock, remove dead code, update docs - handle_job_failure: replace CreateMediaJob.perform_later with @pending_retry flag so the Redis RPUSH happens after with_lock releases the Postgres row lock - select_multi_phase_job next_phase_exists path: broadcast after with_lock when intermediate phase data is freshly saved (makes SD playability visible in UI) - encoder.rb: remove unused CHUNK_SIZE constant; use s3_bucket helper instead of raw ENV["S3_BUCKET_NAME"] (consistent with rest of S3::Client module) - create_media_job.rb: add comment explaining why REMOVED pre-filtering is intentionally omitted (JobResolver maps REMOVED → :not_found; CreateMediaJob correctly treats all-REMOVED as "start fresh", unlike MonitorProcessingJob) - design doc: remove duplicate XML block in §2 (already shown in §1), clarify timeout behaviour (CheckProgressJob 4h vs MonitorProcessingJob 6h backstop) - test: add REMOVED remote_id test — clears remote_id, reschedules, stays processing * fix(test): remove S3::Client include from CreateFileJobTest Minitest picks up test_aware_* module methods as test cases when the module is included, causing ArgumentError (missing keyword args). The test only needs the LOCAL_TEST_PATH constant, accessed via Folio::S3::Client::LOCAL_TEST_PATH — no include needed. * fix(cra): schedule CheckProgressJob when remote_id matches but state is stale When CreateMediaJob finds the CRA job DONE and the stored remote_id already matches, it previously did nothing ('already pointing to correct job'). If the local processing_state was stale (upload_failed, encoding_failed) — e.g. because CRA returned FAILED earlier but later completed the job — the video would be stuck forever: MonitorProcessingJob re-enqueued CreateMediaJob every 5 min, which kept finding remote_id == successful_job_id and silently returning. Fix: when remote_id matches but processing_state != full_media_processed, reset state to full_media_processing and schedule CheckProgressJob to finalize. Discovered via production video #327115 stuck for 25+ hours (manually unblocked). * chore: remove superseded CRA plan files Design doc (docs/design/cra-encoding-system.md) is the canonical reference. * docs: update cra-encoding-system.md — missing recovery paths, test coverage * test: close remaining CRA test coverage gaps Add tests for the three previously uncovered areas identified in the design doc: - Encoder: upload_file (manifest content + SFTP path), upload_with_retry (max_retries=0, transient failure, all retries exhausted), and with_robust_sftp_session (SSH auth failure, generic SFTP error wrapping) - CreateFileJob: S3 server-side copy path — verifies server-side copy is used instead of download flow when not on local file system - AASM state machine integration with CraMediaCloud::FileProcessing concern — process! enqueues CreateMediaJob, encoding_generation changes on re-encode, all AASM transitions (done/failed/retry), and destroy_attached_file enqueues DeleteMediaJob only when remote_id is present * feat: add video_poster_url provider-neutral hook to File::Video and CRA concern * refactor: remove CRA-specific knowledge from GenerateThumbnailJob Use provider-neutral video_poster_url hook instead of querying for remote_cover_url by name. Fixes log message and comments that named the CRA provider explicitly in a general folio job. * fix: set S3_BUCKET_NAME in create_media_job tests s3_dragonfly_head_object evaluates ENV.fetch("S3_BUCKET_NAME") as a positional argument before the mocked head_object can intercept it. Set the env var in with_mocked_s3_and_encoder and in the source_file_missing test so the KeyError no longer surfaces. * fix: delegate generate_dragonfly_uid to Dragonfly's own datastore method Avoids duplicating the S3DataStore UID format in folio code. Falls back to the hardcoded format for datastores that don't implement generate_uid (e.g. FileDataStore in test env). * bump to 7.5.0 CRA encoding improvements: presigned S3 URLs, two-phase encoding (SD + HD), progress tracking with ETA, console encoding info component. * chore: update Gemfile.lock for 7.5.0
…_generation
reference_id was using only slug (filename-derived) without the video record ID,
a regression from when hash_id was replaced with slug. This allowed different video
records uploading the same file to share reference_ids, causing CRA job cross-contamination.
When encoding_generation was nil (race condition), the truncated reference_id matched
stale CRA jobs from previous uploads, making CreateMediaJob incorrectly conclude
the video was "already done" — leaving it stuck in processing for ~14 minutes until
MonitorProcessingJob rescued it.
Changes:
- Add video ID to reference_id format: {env}-{slug}-{id}-{s3_etag}-{generation}
- Fail fast if encoding_generation is nil (Sidekiq will retry)
- Add tests for both guards
Reflects the fix in d6532d3 — format is now {env}-{slug}-{id}-{s3_etag}-{encoding_generation}
…ion timing CreateMediaJob: add reload fallback when encoding_generation is nil. When S3::CreateFileJob's transaction hasn't committed yet, the first read returns nil. A reload picks up the committed value, avoiding unnecessary Sidekiq retries. MonitorProcessingJob: add 10-minute threshold to orphan detection for videos with reference_id but no remote_id. Previously, a just-uploaded video (reference_id set, CRA manifest not yet ingested) would be incorrectly flagged as orphaned, causing state reset and duplicate manifest upload.
Bumps [actionview](https://github.com/rails/rails) from 8.0.4 to 8.0.4.1. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v8.1.2.1/actionview/CHANGELOG.md) - [Commits](rails/rails@v8.0.4...v8.0.4.1) --- updated-dependencies: - dependency-name: actionview dependency-version: 8.0.4.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [activestorage](https://github.com/rails/rails) from 8.0.4 to 8.0.4.1. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v8.1.2.1/activestorage/CHANGELOG.md) - [Commits](rails/rails@v8.0.4...v8.0.4.1) --- updated-dependencies: - dependency-name: activestorage dependency-version: 8.0.4.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [activesupport](https://github.com/rails/rails) from 8.0.4 to 8.0.4.1. - [Release notes](https://github.com/rails/rails/releases) - [Changelog](https://github.com/rails/rails/blob/v8.1.2.1/activesupport/CHANGELOG.md) - [Commits](rails/rails@v8.0.4...v8.0.4.1) --- updated-dependencies: - dependency-name: activesupport dependency-version: 8.0.4.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [json](https://github.com/ruby/json) from 2.18.1 to 2.19.2. - [Release notes](https://github.com/ruby/json/releases) - [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md) - [Commits](ruby/json@v2.18.1...v2.19.2) --- updated-dependencies: - dependency-name: json dependency-version: 2.19.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [bcrypt](https://github.com/bcrypt-ruby/bcrypt-ruby) from 3.1.20 to 3.1.22. - [Release notes](https://github.com/bcrypt-ruby/bcrypt-ruby/releases) - [Changelog](https://github.com/bcrypt-ruby/bcrypt-ruby/blob/master/CHANGELOG) - [Commits](bcrypt-ruby/bcrypt-ruby@v3.1.20...v3.1.22) --- updated-dependencies: - dependency-name: bcrypt dependency-version: 3.1.22 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [rack](https://github.com/rack/rack) from 2.2.21 to 2.2.22. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](rack/rack@v2.2.21...v2.2.22) --- updated-dependencies: - dependency-name: rack dependency-version: 2.2.22 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
) Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5. - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](isaacs/minimatch@v3.1.2...v3.1.5) --- updated-dependencies: - dependency-name: minimatch dependency-version: 3.1.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [svgo](https://github.com/svg/svgo) from 2.8.0 to 2.8.2. - [Release notes](https://github.com/svg/svgo/releases) - [Commits](svg/svgo@v2.8.0...v2.8.2) --- updated-dependencies: - dependency-name: svgo dependency-version: 2.8.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
# Conflicts: # CHANGELOG.md # Gemfile.lock # app/jobs/folio/files/after_save_job.rb # lib/folio/version.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.