linguabot commited on
Commit
f1b89ee
·
verified ·
1 Parent(s): e021231

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. client/src/components/Refinity.tsx +17 -64
client/src/components/Refinity.tsx CHANGED
@@ -417,17 +417,13 @@ const Refinity: React.FC = () => {
417
  const limit = 160;
418
  const snippet = (v.content || '').slice(0, limit) + ((v.content || '').length > limit ? '…' : '');
419
  const isCenter = idx === flowIndex;
420
- if (v.versionNumber === 2) {
421
- console.log('v2 debug - idx:', idx, 'flowIndex:', flowIndex, 'isCenter:', isCenter, 'v.id:', v.id);
422
- }
423
  return (
424
  <SwiperSlide key={v.id} style={{ width: 'clamp(320px, 48vw, 720px)', height: isFullscreen ? '72vh' : '62.4vh' }}>
425
  <div
426
  className={`relative h-full rounded-2xl p-6 bg-white ring-1 ring-gray-200 shadow-xl text-base overflow-hidden flex flex-col ${isCenter ? 'z-10' : 'opacity-95 z-0'}`}
427
  onClick={(e) => {
428
  // Fallback click handler for center card - only trigger if clicking outside buttons
429
- if (isCenter && !(e.target as HTMLElement).closest('button')) {
430
- console.log('Fallback click on center card for version:', v.versionNumber);
431
  setPreviewVersionId(v.id);
432
  setStage('preview');
433
  }
@@ -440,46 +436,18 @@ const Refinity: React.FC = () => {
440
  <div className={`text-gray-900 whitespace-pre-wrap break-words leading-relaxed flex-1 overflow-hidden pr-1`}>{snippet}</div>
441
  {isCenter && (
442
  <div className="mt-4 flex gap-3">
443
- {/* Simple, direct button for v2 */}
444
- {v.versionNumber === 2 ? (
445
- <div
446
- onClick={() => {
447
- console.log('Simple button clicked for v2');
448
- setPreviewVersionId(v.id);
449
- setStage('preview');
450
- }}
451
- style={{
452
- display: 'inline-block',
453
- padding: '8px 12px',
454
- backgroundColor: 'rgba(255, 255, 255, 0.3)',
455
- border: '1px solid rgba(255, 255, 255, 0.5)',
456
- borderRadius: '16px',
457
- cursor: 'pointer',
458
- fontSize: '14px',
459
- fontWeight: '500',
460
- color: 'black',
461
- pointerEvents: 'auto',
462
- zIndex: 99999,
463
- position: 'relative'
464
- }}
465
- >
466
- Full Text
467
- </div>
468
- ) : (
469
- <button
470
- type="button"
471
- onClick={(e) => {
472
- e.preventDefault();
473
- e.stopPropagation();
474
- console.log('Full Text clicked for version:', v.versionNumber, 'id:', v.id, 'isCenter:', isCenter, 'flowIndex:', flowIndex);
475
- setPreviewVersionId(v.id);
476
- setStage('preview');
477
- }}
478
- className="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 cursor-pointer"
479
- >
480
- Full Text
481
- </button>
482
- )}
483
  <button
484
  type="button"
485
  onClick={() => selectManual(v.id)}
@@ -506,29 +474,14 @@ const Refinity: React.FC = () => {
506
  {taskVersions[flowIndex]?.versionNumber === 2 && (
507
  <div
508
  onClick={() => {
509
- console.log('External v2 button clicked');
510
  setPreviewVersionId(taskVersions[flowIndex].id);
511
  setStage('preview');
512
  }}
513
- style={{
514
- position: 'absolute',
515
- bottom: '24px',
516
- left: '50%',
517
- transform: 'translateX(-50%)',
518
- padding: '8px 12px',
519
- backgroundColor: 'rgba(255, 255, 255, 0.9)',
520
- border: '2px solid #3b82f6',
521
- borderRadius: '16px',
522
- cursor: 'pointer',
523
- fontSize: '14px',
524
- fontWeight: '600',
525
- color: '#1f2937',
526
- zIndex: 999999,
527
- pointerEvents: 'auto',
528
- boxShadow: '0 4px 12px rgba(0, 0, 0, 0.15)'
529
- }}
530
  >
531
- Full Text (External)
 
 
532
  </div>
533
  )}
534
 
 
417
  const limit = 160;
418
  const snippet = (v.content || '').slice(0, limit) + ((v.content || '').length > limit ? '…' : '');
419
  const isCenter = idx === flowIndex;
 
 
 
420
  return (
421
  <SwiperSlide key={v.id} style={{ width: 'clamp(320px, 48vw, 720px)', height: isFullscreen ? '72vh' : '62.4vh' }}>
422
  <div
423
  className={`relative h-full rounded-2xl p-6 bg-white ring-1 ring-gray-200 shadow-xl text-base overflow-hidden flex flex-col ${isCenter ? 'z-10' : 'opacity-95 z-0'}`}
424
  onClick={(e) => {
425
  // Fallback click handler for center card - only trigger if clicking outside buttons
426
+ if (isCenter && !(e.target as HTMLElement).closest('button') && v.versionNumber !== 2) {
 
427
  setPreviewVersionId(v.id);
428
  setStage('preview');
429
  }
 
436
  <div className={`text-gray-900 whitespace-pre-wrap break-words leading-relaxed flex-1 overflow-hidden pr-1`}>{snippet}</div>
437
  {isCenter && (
438
  <div className="mt-4 flex gap-3">
439
+ <button
440
+ type="button"
441
+ onClick={(e) => {
442
+ e.preventDefault();
443
+ e.stopPropagation();
444
+ setPreviewVersionId(v.id);
445
+ setStage('preview');
446
+ }}
447
+ className="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 cursor-pointer"
448
+ >
449
+ Full Text
450
+ </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  <button
452
  type="button"
453
  onClick={() => selectManual(v.id)}
 
474
  {taskVersions[flowIndex]?.versionNumber === 2 && (
475
  <div
476
  onClick={() => {
 
477
  setPreviewVersionId(taskVersions[flowIndex].id);
478
  setStage('preview');
479
  }}
480
+ className="absolute bottom-6 left-1/2 transform -translate-x-1/2 z-50"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  >
482
+ <div className="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 cursor-pointer">
483
+ Full Text
484
+ </div>
485
  </div>
486
  )}
487