Repository: streamlit/streamlit
File: proto/streamlit/proto/PageConfig.proto (Protocol Buffers)

Code before:
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

option java_package = "com.snowflake.apps.streamlit";
option java_outer_classname = "PageConfigProto";

// Properties of the page that the app creator may configure.
message PageConfig {
  string title = 1;
  string favicon = 2;
  Layout layout = 3;
  SidebarState initial_sidebar_state = 4;
  MenuItems menu_items = 5;

  message MenuItems {
    string get_help_url = 1;
    bool hide_get_help = 2;
    string report_a_bug_url = 3;
    bool hide_report_a_bug = 4;
    string about_section_md = 5;
    // For multiple calls to set_page_config, clears set about markdown
    bool clear_about_md = 6;
  }

  enum Layout {
    // Render page elements in a centered block, roughly 730px wide.
    CENTERED = 0;

    // Use the full browser width to render elements.
    WIDE = 1;

    // Unset distinguishes that config was not provided - on initial call, will
    // set to centered as default. Otherwise, inherit value from previous call
    LAYOUT_UNSET = 2;
  }

  enum SidebarState {
    // Expand the sidebar if page width exceeds ~1000px; otherwise, collapse it
    AUTO = 0;

Review comment (suggestion):
[suggestion] This is good the way it is, but I am wondering if it might be a good idea to make this a message with `oneof` and make this `pixel_width` similar to [how we handle width/height](https://github.com/streamlit/streamlit/blob/develop/proto/streamlit/proto/WidthConfig.proto). This will just make it easier in the future if we decide to support rem or other ways to specify the width. Currently we must always keep the proto files backwards compatible (although that might change soon), so it is nice to make flexible designs.  

Code after:
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto3";

option java_package = "com.snowflake.apps.streamlit";
option java_outer_classname = "PageConfigProto";

// Properties of the page that the app creator may configure.
message PageConfig {
  string title = 1;
  string favicon = 2;
  Layout layout = 3;
  SidebarState initial_sidebar_state = 4;
  MenuItems menu_items = 5;
  optional SidebarWidthConfig initial_sidebar_width = 6;

  message MenuItems {
    string get_help_url = 1;
    bool hide_get_help = 2;
    string report_a_bug_url = 3;
    bool hide_report_a_bug = 4;
    string about_section_md = 5;
    // For multiple calls to set_page_config, clears set about markdown
    bool clear_about_md = 6;
  }

  enum Layout {
    // Render page elements in a centered block, roughly 730px wide.
    CENTERED = 0;

    // Use the full browser width to render elements.
    WIDE = 1;

    // Unset distinguishes that config was not provided - on initial call, will
    // set to centered as default. Otherwise, inherit value from previous call
    LAYOUT_UNSET = 2;
  }

  enum SidebarState {
    // Expand the sidebar if page width exceeds ~1000px; otherwise, collapse it