Pointf5ive commited on
Commit
aa7e2c2
·
verified ·
1 Parent(s): f2cb114

Fix tab visibility and single-title works autofill

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -77,11 +77,25 @@ footer { display: none !important; }
77
  background: #fffaf0 !important;
78
  border-bottom: 1px solid var(--studio-line);
79
  padding: 8px 10px;
 
 
80
  }
81
 
82
  .gradio-container [role="tab"] {
83
  opacity: 1 !important;
84
  visibility: visible !important;
 
 
 
 
 
 
 
 
 
 
 
 
85
  }
86
 
87
  #hidden-export, #hidden-status {
@@ -985,20 +999,8 @@ def autofill_codex_details(
985
  author_name = str(row["author_name"]).strip()
986
  author_id = str(row["authour_id"]).strip() or _generate_codex_author_id(author_name)
987
 
988
- by_author = catalogue[
989
- catalogue["author_name"].map(_normalise_lookup_key) == _normalise_lookup_key(author_name)
990
- ]
991
- if author_id:
992
- by_id = catalogue[
993
- catalogue["authour_id"].fillna("").astype(str).str.strip() == author_id
994
- ]
995
- if not by_id.empty:
996
- by_author = by_id
997
-
998
- works = [w for w in by_author["title"].astype(str).str.strip().tolist() if w]
999
- works_sampled = ", ".join(pd.Series(works).drop_duplicates().tolist())
1000
- if not works_sampled:
1001
- works_sampled = str(row["title"]).strip()
1002
 
1003
  return (
1004
  author_name,
 
77
  background: #fffaf0 !important;
78
  border-bottom: 1px solid var(--studio-line);
79
  padding: 8px 10px;
80
+ gap: 8px;
81
+ overflow: visible !important;
82
  }
83
 
84
  .gradio-container [role="tab"] {
85
  opacity: 1 !important;
86
  visibility: visible !important;
87
+ color: var(--studio-ink) !important;
88
+ background: #f4ecd6 !important;
89
+ border: 1px solid var(--studio-line) !important;
90
+ border-radius: 8px !important;
91
+ padding: 8px 14px !important;
92
+ font-weight: 700 !important;
93
+ }
94
+
95
+ .gradio-container [role="tab"][aria-selected="true"] {
96
+ background: linear-gradient(90deg, #f5c93c, #e5a721) !important;
97
+ color: white !important;
98
+ border-color: #d99e1b !important;
99
  }
100
 
101
  #hidden-export, #hidden-status {
 
999
  author_name = str(row["author_name"]).strip()
1000
  author_id = str(row["authour_id"]).strip() or _generate_codex_author_id(author_name)
1001
 
1002
+ # Populate only the matched title to avoid confusion during extraction.
1003
+ works_sampled = str(row["title"]).strip()
 
 
 
 
 
 
 
 
 
 
 
 
1004
 
1005
  return (
1006
  author_name,