AaronTekle commited on
Commit
542cf03
·
verified ·
1 Parent(s): 908fff8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +66 -5
app.py CHANGED
@@ -1937,6 +1937,50 @@ ul.options[role="listbox"] {
1937
  }
1938
  }
1939
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1940
  '''
1941
 
1942
 
@@ -2011,11 +2055,28 @@ def build_app():
2011
  label="Dataset file",
2012
  file_types=[".csv", ".parquet", ".json", ".jsonl", ".xlsx", ".xls"],
2013
  )
2014
- # Groups the dataset load, example-load, and workspace-reset actions together
2015
- with gr.Row():
2016
- load_btn = gr.Button("Load + Profile Dataset", variant="primary", elem_id="load-button")
2017
- example_btn = gr.Button("Load HF Dataset (Example Dataset)")
2018
- clear_btn = gr.Button("Clear Workspace")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2019
  # Creates read-only dataframe components for the dataset preview and inferred schema
2020
  preview = gr.Dataframe(label="Dataset Preview:", interactive=False, wrap=True, elem_id="dataset-preview")
2021
  schema_table = gr.Dataframe(label="Dataset Schema:", interactive=False, wrap=True, elem_id="dataset-schema")
 
1937
  }
1938
  }
1939
 
1940
+
1941
+ /* =========================================================
1942
+ DATASET ACTION BUTTON STANDARDIZATION
1943
+ Keep all three dataset actions identical in width/height.
1944
+ ========================================================= */
1945
+ #dataset-actions-row {
1946
+ align-items: stretch !important;
1947
+ }
1948
+
1949
+ #dataset-actions-row #load-button,
1950
+ #dataset-actions-row #example-button,
1951
+ #dataset-actions-row #clear-button {
1952
+ flex: 1 1 0 !important;
1953
+ width: 100% !important;
1954
+ min-width: 0 !important;
1955
+ height: 44px !important;
1956
+ min-height: 44px !important;
1957
+ max-height: 44px !important;
1958
+ margin: 0 !important;
1959
+ }
1960
+
1961
+ #dataset-actions-row #load-button button,
1962
+ #dataset-actions-row #example-button button,
1963
+ #dataset-actions-row #clear-button button {
1964
+ width: 100% !important;
1965
+ height: 44px !important;
1966
+ min-height: 44px !important;
1967
+ max-height: 44px !important;
1968
+ white-space: nowrap !important;
1969
+ }
1970
+
1971
+ /* Allow the row to adapt cleanly on smaller screens without uneven controls. */
1972
+ @media (max-width: 800px) {
1973
+ #dataset-actions-row {
1974
+ flex-wrap: wrap !important;
1975
+ }
1976
+
1977
+ #dataset-actions-row #load-button,
1978
+ #dataset-actions-row #example-button,
1979
+ #dataset-actions-row #clear-button {
1980
+ flex: 1 1 100% !important;
1981
+ }
1982
+ }
1983
+
1984
  '''
1985
 
1986
 
 
2055
  label="Dataset file",
2056
  file_types=[".csv", ".parquet", ".json", ".jsonl", ".xlsx", ".xls"],
2057
  )
2058
+ # Groups the dataset load, example-load, and workspace-reset actions together.
2059
+ # Equal scale/min-width values keep all three actions exactly the same width.
2060
+ with gr.Row(equal_height=True, elem_id="dataset-actions-row"):
2061
+ load_btn = gr.Button(
2062
+ "Load + Profile Dataset",
2063
+ variant="primary",
2064
+ elem_id="load-button",
2065
+ scale=1,
2066
+ min_width=0,
2067
+ )
2068
+ example_btn = gr.Button(
2069
+ "Load HF Dataset (Example Dataset)",
2070
+ elem_id="example-button",
2071
+ scale=1,
2072
+ min_width=0,
2073
+ )
2074
+ clear_btn = gr.Button(
2075
+ "Clear Workspace",
2076
+ elem_id="clear-button",
2077
+ scale=1,
2078
+ min_width=0,
2079
+ )
2080
  # Creates read-only dataframe components for the dataset preview and inferred schema
2081
  preview = gr.Dataframe(label="Dataset Preview:", interactive=False, wrap=True, elem_id="dataset-preview")
2082
  schema_table = gr.Dataframe(label="Dataset Schema:", interactive=False, wrap=True, elem_id="dataset-schema")