linguabot commited on
Commit
236433f
·
verified ·
1 Parent(s): 6c7039f

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/components/Refinity.tsx +6 -5
client/src/components/Refinity.tsx CHANGED
@@ -367,7 +367,7 @@ const Refinity: React.FC = () => {
367
  </button>
368
  </div>
369
  </div>
370
- <div className="relative min-h-0" style={{ maxHeight: 'calc(100vh - 240px)' }}>
371
  <SwiperRoot
372
  modules={[EffectCoverflow, Navigation, Pagination, A11y]}
373
  effect="coverflow"
@@ -376,7 +376,7 @@ const Refinity: React.FC = () => {
376
  navigation
377
  pagination={{ clickable: true }}
378
  centeredSlides
379
- autoHeight
380
  slidesPerView={'auto'}
381
  spaceBetween={8}
382
  breakpoints={{
@@ -389,18 +389,19 @@ const Refinity: React.FC = () => {
389
  grabCursor
390
  coverflowEffect={{ rotate: 0, stretch: 0, depth: 80, modifier: 1, slideShadows: false }}
391
  className="!px-4 overflow-visible pb-2"
 
392
  >
393
  {taskVersions.map((v, idx) => {
394
  const snippet = (v.content || '').slice(0, 220) + ((v.content || '').length > 220 ? '…' : '');
395
  const isCenter = idx === flowIndex;
396
  return (
397
- <SwiperSlide key={v.id} style={{ width: 'min(92vw, 720px)', height: 'auto' }}>
398
- <div className="relative rounded-2xl p-6 bg-white ring-1 ring-gray-200 shadow-xl text-base max-h-[60vh] overflow-hidden">
399
  <div className="pointer-events-none absolute inset-0 rounded-2xl opacity-40 [background:linear-gradient(to_bottom,rgba(255,255,255,0.45),rgba(255,255,255,0)_28%),linear-gradient(to_right,rgba(255,255,255,0.35),rgba(255,255,255,0)_28%)]" />
400
  <div className="pointer-events-none absolute inset-0 rounded-2xl bg-gradient-to-tr from-white/30 via-white/10 to-transparent opacity-30" />
401
  <div className="text-gray-800 text-sm mb-2">Original: {v.originalAuthor}</div>
402
  <div className="text-gray-600 text-xs mb-3">Revised by: {v.revisedBy ? `${v.revisedBy} (v${v.versionNumber})` : `— (v${v.versionNumber})`}</div>
403
- <div className="text-gray-900 whitespace-pre-wrap break-words leading-relaxed max-h-[calc(100%-64px)] overflow-auto pr-1">{snippet}</div>
404
  {isCenter && (
405
  <div className="mt-4 flex gap-3">
406
  <button onClick={()=>{ setPreviewVersionId(v.id); setStage('preview'); }} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-black ring-1 ring-inset ring-white/50 backdrop-blur-md bg-white/30 active:translate-y-0.5 transition-all duration-200">Full Text</button>
 
367
  </button>
368
  </div>
369
  </div>
370
+ <div className="relative min-h-0" style={{ maxHeight: 'calc(100vh - 280px)' }}>
371
  <SwiperRoot
372
  modules={[EffectCoverflow, Navigation, Pagination, A11y]}
373
  effect="coverflow"
 
376
  navigation
377
  pagination={{ clickable: true }}
378
  centeredSlides
379
+ // fixed height so cards fit viewport and never overflow page
380
  slidesPerView={'auto'}
381
  spaceBetween={8}
382
  breakpoints={{
 
389
  grabCursor
390
  coverflowEffect={{ rotate: 0, stretch: 0, depth: 80, modifier: 1, slideShadows: false }}
391
  className="!px-4 overflow-visible pb-2"
392
+ style={{ height: 'min(64vh, calc(100vh - 320px))', minHeight: '360px' }}
393
  >
394
  {taskVersions.map((v, idx) => {
395
  const snippet = (v.content || '').slice(0, 220) + ((v.content || '').length > 220 ? '…' : '');
396
  const isCenter = idx === flowIndex;
397
  return (
398
+ <SwiperSlide key={v.id} style={{ width: 'min(92vw, 720px)', height: '100%' }}>
399
+ <div className="relative h-full rounded-2xl p-6 bg-white ring-1 ring-gray-200 shadow-xl text-base overflow-hidden flex flex-col">
400
  <div className="pointer-events-none absolute inset-0 rounded-2xl opacity-40 [background:linear-gradient(to_bottom,rgba(255,255,255,0.45),rgba(255,255,255,0)_28%),linear-gradient(to_right,rgba(255,255,255,0.35),rgba(255,255,255,0)_28%)]" />
401
  <div className="pointer-events-none absolute inset-0 rounded-2xl bg-gradient-to-tr from-white/30 via-white/10 to-transparent opacity-30" />
402
  <div className="text-gray-800 text-sm mb-2">Original: {v.originalAuthor}</div>
403
  <div className="text-gray-600 text-xs mb-3">Revised by: {v.revisedBy ? `${v.revisedBy} (v${v.versionNumber})` : `— (v${v.versionNumber})`}</div>
404
+ <div className="text-gray-900 whitespace-pre-wrap break-words leading-relaxed flex-1 overflow-auto pr-1">{snippet}</div>
405
  {isCenter && (
406
  <div className="mt-4 flex gap-3">
407
  <button onClick={()=>{ setPreviewVersionId(v.id); setStage('preview'); }} className="relative overflow-hidden inline-flex items-center justify-center gap-2 px-3 py-2 text-sm font-medium rounded-2xl text-black ring-1 ring-inset ring-white/50 backdrop-blur-md bg-white/30 active:translate-y-0.5 transition-all duration-200">Full Text</button>